@unbrained/pm-cli 2026.6.7 → 2026.6.9
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 +1 -1
- package/AGENTS.md +1 -1
- package/CHANGELOG.md +68 -6
- package/CONTRIBUTING.md +1 -1
- package/README.md +1 -1
- package/dist/cli/bootstrap-args.js +30 -13
- package/dist/cli/bootstrap-args.js.map +1 -1
- package/dist/cli/commands/close-many.js +9 -3
- package/dist/cli/commands/close-many.js.map +1 -1
- package/dist/cli/commands/close.js +15 -3
- package/dist/cli/commands/close.js.map +1 -1
- package/dist/cli/commands/comments-audit.js +4 -3
- package/dist/cli/commands/comments-audit.js.map +1 -1
- package/dist/cli/commands/completion.js +40 -33
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/extension/scaffold.js +6 -14
- package/dist/cli/commands/extension/scaffold.js.map +1 -1
- package/dist/cli/commands/gc.js +10 -2
- package/dist/cli/commands/gc.js.map +1 -1
- package/dist/cli/commands/health.js +10 -2
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/index.d.ts +1 -1
- package/dist/cli/commands/index.js +3 -3
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.d.ts +1 -0
- package/dist/cli/commands/init.js +48 -2
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/list.d.ts +11 -2
- package/dist/cli/commands/list.js +104 -2
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/normalize.js +6 -4
- package/dist/cli/commands/normalize.js.map +1 -1
- package/dist/cli/commands/schema.d.ts +13 -2
- package/dist/cli/commands/schema.js +66 -12
- package/dist/cli/commands/schema.js.map +1 -1
- package/dist/cli/commands/search.d.ts +10 -2
- package/dist/cli/commands/search.js +94 -5
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/upgrade.js +4 -12
- package/dist/cli/commands/upgrade.js.map +1 -1
- package/dist/cli/extension-command-options.js +40 -17
- package/dist/cli/extension-command-options.js.map +1 -1
- package/dist/cli/main.js +7 -18
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.js +5 -3
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.js +33 -24
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-setup.js +4 -2
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.js +7 -3
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/chunks/activity-HF3VJYKH.js +16 -0
- package/dist/cli-bundle/chunks/{activity-YVB3QRTE.js → activity-RUJATACW.js} +11 -11
- package/dist/cli-bundle/chunks/{aggregate-LH66F75F.js → aggregate-IQ27NFBI.js} +10 -11
- package/dist/cli-bundle/chunks/{aggregate-LH66F75F.js.map → aggregate-IQ27NFBI.js.map} +1 -1
- package/dist/cli-bundle/chunks/{aggregate-OHSWFQJM.js → aggregate-TT7OCHHT.js} +12 -13
- package/dist/cli-bundle/chunks/{aggregate-OHSWFQJM.js.map → aggregate-TT7OCHHT.js.map} +1 -1
- package/dist/cli-bundle/chunks/{append-2PPYFAG5.js → append-CWQZBUWV.js} +8 -8
- package/dist/cli-bundle/chunks/{append-AUGT5W6J.js → append-E7AJ5RTR.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-UIIQC5YO.js → chunk-23WNCJBA.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-GPXQBR3H.js → chunk-3RHE76G6.js} +12 -12
- package/dist/cli-bundle/chunks/{chunk-GUZBNB3G.js → chunk-42IULX44.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-HLC3KTLP.js → chunk-44JP4PYY.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-MWRS7Z4P.js → chunk-4LRVXVJK.js} +15 -13
- package/dist/cli-bundle/chunks/chunk-4LRVXVJK.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-HV5SSZXF.js → chunk-4TJWRPIH.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-UYQ7HXH4.js → chunk-5ATRWEZO.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-X4IZKYHP.js → chunk-5JF76OJF.js} +246 -17
- package/dist/cli-bundle/chunks/chunk-5JF76OJF.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-WYEXLDDY.js → chunk-5MMLINZB.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-2IF7WLB7.js → chunk-6IGTNFE3.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-UT6WFXW2.js → chunk-7CR4GAYN.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NHR2QXXZ.js → chunk-7YTWXGE3.js} +20 -8
- package/dist/cli-bundle/chunks/chunk-7YTWXGE3.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-SQPKRA54.js → chunk-A5342JVL.js} +12 -12
- package/dist/cli-bundle/chunks/{chunk-H7EO3QA3.js → chunk-AM2AXVFS.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-LIN2BPJ7.js → chunk-ANKG2JKL.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-YBZW2QQ7.js → chunk-AVGOVJGV.js} +10 -13
- package/dist/cli-bundle/chunks/chunk-AVGOVJGV.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-4GHZR3BA.js → chunk-BACSNVWE.js} +10 -14
- package/dist/cli-bundle/chunks/chunk-BACSNVWE.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-NQL32HQ5.js → chunk-BIRVSIM2.js} +12 -12
- package/dist/cli-bundle/chunks/{chunk-UJUT6AHZ.js → chunk-C72IQIBT.js} +271 -21
- package/dist/cli-bundle/chunks/chunk-C72IQIBT.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-42LOFGJS.js → chunk-CAXUGAAF.js} +108 -9
- package/dist/cli-bundle/chunks/chunk-CAXUGAAF.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-QQL5QSTZ.js → chunk-D5D7VKIC.js} +6 -5
- package/dist/cli-bundle/chunks/chunk-D5D7VKIC.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-C5W2UH56.js → chunk-E7LOIIFP.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-TINUJMWN.js → chunk-EFRHTZO4.js} +109 -10
- package/dist/cli-bundle/chunks/chunk-EFRHTZO4.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-LXO6V66E.js → chunk-ENCVPOID.js} +12 -12
- package/dist/cli-bundle/chunks/{chunk-4CHEG6UK.js → chunk-EQ6N6IDR.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-B5RF3IP7.js → chunk-F2REA7VW.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-B5RF3IP7.js.map → chunk-F2REA7VW.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-6J4K6JLA.js → chunk-FHUI7AXS.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-6J4K6JLA.js.map → chunk-FHUI7AXS.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-6RZXO5M2.js → chunk-FJNJEWU4.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-R3V3YCMH.js → chunk-FKH7K6YP.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-CLD3XNCH.js → chunk-GPOSGWCN.js} +14 -12
- package/dist/cli-bundle/chunks/chunk-GPOSGWCN.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-3EOBJOF4.js → chunk-H37YPWLM.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-XYNT7UFP.js → chunk-I26E6XA7.js} +17 -7
- package/dist/cli-bundle/chunks/chunk-I26E6XA7.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-THDEID2Z.js → chunk-I3UILOUU.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-YPH4ESA2.js → chunk-I4FGL3K2.js} +11 -6
- package/dist/cli-bundle/chunks/chunk-I4FGL3K2.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-HMMMWBK2.js → chunk-JEGFLKSI.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-OKSKJKHX.js → chunk-JN3BT7UY.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-XS3O2TFJ.js → chunk-JVMAOD54.js} +8 -8
- package/dist/cli-bundle/chunks/chunk-JVMAOD54.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-KNGVP5WJ.js → chunk-KDX6VC3P.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-TNPBPNII.js → chunk-KTVXLI54.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-TP4DDY27.js → chunk-LF2VNLEZ.js} +9 -12
- package/dist/cli-bundle/chunks/chunk-LF2VNLEZ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-X7UHMKPE.js → chunk-LU2HE272.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-WAA7UI6M.js → chunk-LU54Z4QI.js} +10 -14
- package/dist/cli-bundle/chunks/chunk-LU54Z4QI.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-MOYM2C3J.js → chunk-MNXJ6YDO.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-WCQZBDDH.js → chunk-NHRZSYAA.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-3A2CMEM7.js → chunk-NJRZIJ4N.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-2OJHLWBZ.js → chunk-NUGAWYEN.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-LQHBENVW.js → chunk-O4L7Z6LB.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-V6EYFTRL.js → chunk-OPYA2HIU.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-KR6R465K.js → chunk-OT6XAMO5.js} +17 -7
- package/dist/cli-bundle/chunks/chunk-OT6XAMO5.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-FY6Z3FYY.js → chunk-P2NVFE4L.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-UEWA73ZZ.js → chunk-PUSOAQCR.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-B2KZGPM2.js → chunk-PW7C262O.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-AVJD6VTA.js → chunk-RE2JQJZJ.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-GNIUOLZ2.js → chunk-RKCJ2JMA.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-5AXMRKN5.js → chunk-RLVI7KDW.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-IMCJBN2Q.js → chunk-RMTI5R76.js} +19 -7
- package/dist/cli-bundle/chunks/chunk-RMTI5R76.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-FHHBD7PN.js → chunk-SAUXUI6U.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-O7HSSFCC.js → chunk-SD6H3RLA.js} +10 -5
- package/dist/cli-bundle/chunks/{chunk-O7HSSFCC.js.map → chunk-SD6H3RLA.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-M2PW7EZU.js → chunk-T7B5VAKD.js} +7 -7
- package/dist/cli-bundle/chunks/chunk-T7B5VAKD.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-YO3THIJF.js → chunk-T7NWFVOA.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-WR5567FH.js → chunk-TLD3UYGY.js} +5 -4
- package/dist/cli-bundle/chunks/chunk-TLD3UYGY.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-HRMHZ4RV.js → chunk-U3Z4OCZC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-SFFVGNHC.js → chunk-VDVVOLR6.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-2IXCHCLM.js → chunk-WCWIDJII.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-LI65XLJR.js → chunk-WQZCEEQN.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-RVPTZKBC.js → chunk-XEOO6K5J.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-TYJJOTUA.js → chunk-YI6W2DBN.js} +54 -8
- package/dist/cli-bundle/chunks/chunk-YI6W2DBN.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-UAQOQ7IE.js → chunk-YSANBZAE.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-LMTOY5HE.js → chunk-YX5LAKFJ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-CKLBZHS7.js → chunk-ZPXDD6RQ.js} +53 -7
- package/dist/cli-bundle/chunks/chunk-ZPXDD6RQ.js.map +7 -0
- package/dist/cli-bundle/chunks/{claim-BJ4QMPJC.js → claim-RV6WYUF7.js} +10 -10
- package/dist/cli-bundle/chunks/{claim-KW743OSW.js → claim-UXFGCF3P.js} +10 -10
- package/dist/cli-bundle/chunks/close-JTTGW7TS.js +13 -0
- package/dist/cli-bundle/chunks/{close-SYHSRZDC.js → close-O4JK2JKD.js} +8 -8
- package/dist/cli-bundle/chunks/{close-many-LAC5VR4G.js → close-many-EQO4TPIE.js} +24 -19
- package/dist/cli-bundle/chunks/close-many-EQO4TPIE.js.map +1 -0
- package/dist/cli-bundle/chunks/{close-many-DBLEYFOY.js → close-many-SRDBV3SI.js} +23 -18
- package/dist/cli-bundle/chunks/close-many-SRDBV3SI.js.map +7 -0
- package/dist/cli-bundle/chunks/{comments-YT2PQ5DD.js → comments-OMB7YE27.js} +10 -10
- package/dist/cli-bundle/chunks/{comments-JEO6HHVM.js → comments-TTZUIB2O.js} +10 -10
- package/dist/cli-bundle/chunks/{config-RZRVS3ZV.js → config-5VPR42A6.js} +10 -11
- package/dist/cli-bundle/chunks/config-5VPR42A6.js.map +1 -0
- package/dist/cli-bundle/chunks/{config-YJSAAADD.js → config-NNLXVGVC.js} +9 -10
- package/dist/cli-bundle/chunks/config-NNLXVGVC.js.map +7 -0
- package/dist/cli-bundle/chunks/{context-ZUH5IOOI.js → context-4N7GYTVQ.js} +16 -18
- package/dist/cli-bundle/chunks/{context-ZUH5IOOI.js.map → context-4N7GYTVQ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{context-LGYEEKAW.js → context-4QK6GRXO.js} +14 -16
- package/dist/cli-bundle/chunks/{context-LGYEEKAW.js.map → context-4QK6GRXO.js.map} +1 -1
- package/dist/cli-bundle/chunks/{contracts-YXJ6NXKH.js → contracts-AOBNEBVT.js} +4 -4
- package/dist/cli-bundle/chunks/{contracts-ZIBXROPE.js → contracts-DXCWXOSP.js} +4 -4
- package/dist/cli-bundle/chunks/{copy-BZALX5MQ.js → copy-5NM3SVJA.js} +7 -7
- package/dist/cli-bundle/chunks/{copy-YPWEIAPD.js → copy-XSYEQTLA.js} +7 -7
- package/dist/cli-bundle/chunks/{create-CF7EVRX7.js → create-FCCAATQV.js} +13 -13
- package/dist/cli-bundle/chunks/create-JAPLFDGJ.js +27 -0
- package/dist/cli-bundle/chunks/{delete-XLZRTRKR.js → delete-5JFP6OG7.js} +7 -7
- package/dist/cli-bundle/chunks/{delete-KR4VBWVE.js → delete-PQXJQXQ7.js} +7 -7
- package/dist/cli-bundle/chunks/{deps-GZMFMTGS.js → deps-S5322EOQ.js} +7 -7
- package/dist/cli-bundle/chunks/{deps-2YTXD3VM.js → deps-XXKBOQUA.js} +7 -7
- package/dist/cli-bundle/chunks/{docs-SLROFEQ4.js → docs-C7CCVWAJ.js} +9 -9
- package/dist/cli-bundle/chunks/{docs-ZHISRR2D.js → docs-DZRPAW5S.js} +9 -9
- package/dist/cli-bundle/chunks/{extension-3C7OOI4F.js → extension-CSHP6FZX.js} +5 -5
- package/dist/cli-bundle/chunks/{extension-XYCUXICD.js → extension-XNNVUVAY.js} +5 -5
- package/dist/cli-bundle/chunks/{files-J4I5IU4O.js → files-OBWYYPKM.js} +9 -9
- package/dist/cli-bundle/chunks/{files-FUWF2FYJ.js → files-UPCNKEIZ.js} +9 -9
- package/dist/cli-bundle/chunks/{gc-34NXSNSN.js → gc-FA2ONELT.js} +13 -5
- package/dist/cli-bundle/chunks/gc-FA2ONELT.js.map +1 -0
- package/dist/cli-bundle/chunks/{gc-SPIIZX3A.js → gc-KXK6KBRN.js} +12 -4
- package/dist/cli-bundle/chunks/gc-KXK6KBRN.js.map +7 -0
- package/dist/cli-bundle/chunks/{get-VITKYP6S.js → get-FLHYTOBA.js} +11 -11
- package/dist/cli-bundle/chunks/{get-SZKNRHMA.js → get-PNTSONGB.js} +11 -11
- package/dist/cli-bundle/chunks/{health-7G3EPM57.js → health-CS5RNTJX.js} +21 -14
- package/dist/cli-bundle/chunks/health-CS5RNTJX.js.map +1 -0
- package/dist/cli-bundle/chunks/{health-4SNTA2TF.js → health-KCRVYIYY.js} +20 -13
- package/dist/cli-bundle/chunks/health-KCRVYIYY.js.map +7 -0
- package/dist/cli-bundle/chunks/history-6624XISO.js +20 -0
- package/dist/cli-bundle/chunks/{history-SDAWYZR3.js → history-COQTPBEU.js} +10 -10
- package/dist/cli-bundle/chunks/{history-compact-POTZGG7K.js → history-compact-66PSRYL3.js} +11 -11
- package/dist/cli-bundle/chunks/{history-compact-DMW536VH.js → history-compact-PVS2A3FS.js} +11 -11
- package/dist/cli-bundle/chunks/{history-redact-EPJ7GENL.js → history-redact-DCXAWGTF.js} +11 -11
- package/dist/cli-bundle/chunks/history-redact-ZRQTI7NB.js +19 -0
- package/dist/cli-bundle/chunks/{history-repair-YNESJRT6.js → history-repair-SEQDFTGW.js} +11 -11
- package/dist/cli-bundle/chunks/{history-repair-IJ7LLBET.js → history-repair-TA3NRIFO.js} +11 -11
- package/dist/cli-bundle/chunks/{init-YHVBTEET.js → init-IQJE3EKJ.js} +9 -9
- package/dist/cli-bundle/chunks/init-ZVE2HMKK.js +17 -0
- package/dist/cli-bundle/chunks/{learnings-T4PF24YN.js → learnings-RJPGH2ME.js} +10 -10
- package/dist/cli-bundle/chunks/{learnings-4YBMIVCZ.js → learnings-XC6EMW5E.js} +10 -10
- package/dist/cli-bundle/chunks/{list-3KEVBOYW.js → list-NJV6WBT4.js} +10 -11
- package/dist/cli-bundle/chunks/list-OO5P472O.js +19 -0
- package/dist/cli-bundle/chunks/{notes-GJKALVZM.js → notes-2KWHADK3.js} +10 -10
- package/dist/cli-bundle/chunks/{notes-FLUCNJSH.js → notes-FNCDMZW2.js} +10 -10
- package/dist/cli-bundle/chunks/{plan-T5MMZLI3.js → plan-CYK2P5PD.js} +13 -13
- package/dist/cli-bundle/chunks/{plan-YYMIL3HV.js → plan-MQO5JTSV.js} +13 -13
- package/dist/cli-bundle/chunks/{register-list-query-I65EZ3HB.js → register-list-query-6RA24SIZ.js} +23 -21
- package/dist/cli-bundle/chunks/register-list-query-6RA24SIZ.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-list-query-OECMHO4G.js → register-list-query-IO3RR5K6.js} +22 -20
- package/dist/cli-bundle/chunks/register-list-query-IO3RR5K6.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-mutation-5GPDEKHR.js → register-mutation-KVFUXCAZ.js} +40 -36
- package/dist/cli-bundle/chunks/{register-mutation-5GPDEKHR.js.map → register-mutation-KVFUXCAZ.js.map} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-2FLXORLR.js → register-mutation-VV2SC2KL.js} +41 -37
- package/dist/cli-bundle/chunks/{register-mutation-2FLXORLR.js.map → register-mutation-VV2SC2KL.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-operations-BNGAUMGK.js → register-operations-DFNVRSJ5.js} +30 -30
- package/dist/cli-bundle/chunks/{register-operations-GQKT35H5.js → register-operations-TAUUTRJ4.js} +30 -30
- package/dist/cli-bundle/chunks/{register-setup-DNDCGZ4O.js → register-setup-GAQZZRUA.js} +20 -19
- package/dist/cli-bundle/chunks/register-setup-GAQZZRUA.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-setup-EJY44FPH.js → register-setup-X2R5CFDV.js} +19 -18
- package/dist/cli-bundle/chunks/{register-setup-EJY44FPH.js.map → register-setup-X2R5CFDV.js.map} +2 -2
- package/dist/cli-bundle/chunks/{restore-DDJGVZIN.js → restore-E3GZKRRK.js} +11 -11
- package/dist/cli-bundle/chunks/restore-F4ALFV4D.js +17 -0
- package/dist/cli-bundle/chunks/{schema-HEGYH6CE.js → schema-3CPFLDAY.js} +77 -21
- package/dist/cli-bundle/chunks/schema-3CPFLDAY.js.map +1 -0
- package/dist/cli-bundle/chunks/{schema-B7NQ6XVP.js → schema-7EHBPNXM.js} +76 -20
- package/dist/cli-bundle/chunks/schema-7EHBPNXM.js.map +7 -0
- package/dist/cli-bundle/chunks/{search-DVVQ4UO2.js → search-2T3NCCUR.js} +104 -16
- package/dist/cli-bundle/chunks/search-2T3NCCUR.js.map +1 -0
- package/dist/cli-bundle/chunks/{search-JNEZJV7H.js → search-OBZVYJJ2.js} +103 -15
- package/dist/cli-bundle/chunks/search-OBZVYJJ2.js.map +7 -0
- package/dist/cli-bundle/chunks/{stats-SYTJRR4Z.js → stats-6LVK4JER.js} +7 -7
- package/dist/cli-bundle/chunks/{stats-7JDIJRDH.js → stats-ULGQACF7.js} +7 -7
- package/dist/cli-bundle/chunks/{telemetry-4HHWD5Y7.js → telemetry-6G27FLCP.js} +4 -4
- package/dist/cli-bundle/chunks/{telemetry-EGWP7ZUX.js → telemetry-HHKRTMZA.js} +4 -4
- package/dist/cli-bundle/chunks/{test-IIELLSZX.js → test-2PP4YBV6.js} +14 -14
- package/dist/cli-bundle/chunks/test-PPOLRIBA.js +32 -0
- package/dist/cli-bundle/chunks/{test-all-7DNCMML7.js → test-all-6Z272JRI.js} +14 -14
- package/dist/cli-bundle/chunks/{test-all-IHTUJRRC.js → test-all-NETGVNM6.js} +14 -14
- package/dist/cli-bundle/chunks/{test-runs-RNKZ37PS.js → test-runs-CRPQVMMG.js} +5 -5
- package/dist/cli-bundle/chunks/{test-runs-5FEMBV3A.js → test-runs-M24WA6TI.js} +5 -5
- package/dist/cli-bundle/chunks/update-MCPCPMHV.js +25 -0
- package/dist/cli-bundle/chunks/update-O7TBOUVQ.js +21 -0
- package/dist/cli-bundle/chunks/{update-many-BSZZZYXY.js → update-many-JSRF5EH5.js} +22 -23
- package/dist/cli-bundle/chunks/{update-many-BSZZZYXY.js.map → update-many-JSRF5EH5.js.map} +1 -1
- package/dist/cli-bundle/chunks/{update-many-BWKJJEBF.js → update-many-Y3HOL7WA.js} +24 -25
- package/dist/cli-bundle/chunks/{update-many-BWKJJEBF.js.map → update-many-Y3HOL7WA.js.map} +1 -1
- package/dist/cli-bundle/chunks/{upgrade-YWI5DJFA.js → upgrade-5RTQVKKE.js} +8 -15
- package/dist/cli-bundle/chunks/upgrade-5RTQVKKE.js.map +7 -0
- package/dist/cli-bundle/chunks/{upgrade-RSE5PC44.js → upgrade-ECB6GH3M.js} +9 -16
- package/dist/cli-bundle/chunks/upgrade-ECB6GH3M.js.map +1 -0
- package/dist/cli-bundle/chunks/{validate-NK3WKB7C.js → validate-J6Q444SD.js} +16 -16
- package/dist/cli-bundle/chunks/{validate-UCEOB7S6.js → validate-MCNMAXVA.js} +16 -16
- package/dist/cli-bundle/main.js +77 -81
- package/dist/cli-bundle/main.js.map +3 -3
- package/dist/core/config/nested-settings.d.ts +0 -2
- package/dist/core/config/nested-settings.js +2 -4
- package/dist/core/config/nested-settings.js.map +1 -1
- package/dist/core/diagnostics/remediation.js +7 -2
- package/dist/core/diagnostics/remediation.js.map +1 -1
- package/dist/core/extensions/extension-types.d.ts +59 -1
- package/dist/core/extensions/extension-types.js +2 -2
- package/dist/core/extensions/extension-types.js.map +1 -1
- package/dist/core/extensions/flag-value-types.d.ts +29 -0
- package/dist/core/extensions/flag-value-types.js +78 -0
- package/dist/core/extensions/flag-value-types.js.map +1 -0
- package/dist/core/extensions/item-field-types.d.ts +22 -0
- package/dist/core/extensions/item-field-types.js +43 -0
- package/dist/core/extensions/item-field-types.js.map +1 -0
- package/dist/core/extensions/item-fields.js +4 -11
- package/dist/core/extensions/item-fields.js.map +1 -1
- package/dist/core/extensions/loader.d.ts +14 -1
- package/dist/core/extensions/loader.js +141 -10
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/fs/fs-utils.js +29 -4
- package/dist/core/fs/fs-utils.js.map +1 -1
- package/dist/core/packages/manifest.d.ts +1 -1
- package/dist/core/packages/manifest.js +12 -2
- package/dist/core/packages/manifest.js.map +1 -1
- package/dist/core/packages/root.d.ts +10 -0
- package/dist/core/packages/root.js +24 -2
- package/dist/core/packages/root.js.map +1 -1
- package/dist/core/schema/runtime-schema.js +3 -6
- package/dist/core/schema/runtime-schema.js.map +1 -1
- package/dist/core/search/background-refresh.d.ts +0 -8
- package/dist/core/search/background-refresh.js +2 -9
- package/dist/core/search/background-refresh.js.map +1 -1
- package/dist/core/search/vector-stores.js +6 -8
- package/dist/core/search/vector-stores.js.map +1 -1
- package/dist/core/sentry/instrument.js +4 -17
- package/dist/core/sentry/instrument.js.map +1 -1
- package/dist/core/store/paths.js +17 -3
- package/dist/core/store/paths.js.map +1 -1
- package/dist/core/telemetry/runtime.d.ts +1 -0
- package/dist/core/telemetry/runtime.js +3 -3
- package/dist/core/telemetry/runtime.js.map +1 -1
- package/dist/mcp/server.js +131 -42
- package/dist/mcp/server.js.map +1 -1
- package/dist/sdk/cli-contracts/commander-types.js +4 -4
- package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +3 -3
- package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
- package/dist/sdk/cli-contracts.js +10 -8
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/dist/sdk/index.d.ts +7 -2
- package/dist/sdk/index.js +3 -3
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/testing.d.ts +55 -1
- package/dist/sdk/testing.js +92 -2
- package/dist/sdk/testing.js.map +1 -1
- package/docs/AGENT_GUIDE.md +3 -1
- package/docs/CLAUDE_CODE_PLUGIN.md +2 -2
- package/docs/COMMANDS.md +6 -4
- package/docs/CONFIGURATION.md +6 -0
- package/docs/EXTENSIONS.md +7 -8
- package/docs/RELEASING.md +17 -0
- package/docs/SDK.md +98 -0
- package/marketplace.json +1 -1
- package/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/README.md +3 -3
- package/plugins/pm-claude/commands/pm-init.md +1 -1
- package/dist/cli-bundle/chunks/activity-5UROHJ3D.js +0 -16
- package/dist/cli-bundle/chunks/chunk-42LOFGJS.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4GHZR3BA.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-CKLBZHS7.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-CLD3XNCH.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-EAOG77HM.js +0 -56
- package/dist/cli-bundle/chunks/chunk-EAOG77HM.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-IMCJBN2Q.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-KR6R465K.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-M2PW7EZU.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-MWRS7Z4P.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-NHR2QXXZ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-QQL5QSTZ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-TINUJMWN.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-TP4DDY27.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-TYJJOTUA.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-UJUT6AHZ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-WAA7UI6M.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-WR5567FH.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-X4IZKYHP.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-XS3O2TFJ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-XSLQSXAH.js +0 -53
- package/dist/cli-bundle/chunks/chunk-XSLQSXAH.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-XYNT7UFP.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-YBZW2QQ7.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-YPH4ESA2.js.map +0 -1
- package/dist/cli-bundle/chunks/close-P4ZBKODL.js +0 -13
- package/dist/cli-bundle/chunks/close-many-DBLEYFOY.js.map +0 -7
- package/dist/cli-bundle/chunks/close-many-LAC5VR4G.js.map +0 -1
- package/dist/cli-bundle/chunks/config-RZRVS3ZV.js.map +0 -1
- package/dist/cli-bundle/chunks/config-YJSAAADD.js.map +0 -7
- package/dist/cli-bundle/chunks/create-4DS2QWQC.js +0 -27
- package/dist/cli-bundle/chunks/gc-34NXSNSN.js.map +0 -1
- package/dist/cli-bundle/chunks/gc-SPIIZX3A.js.map +0 -7
- package/dist/cli-bundle/chunks/health-4SNTA2TF.js.map +0 -7
- package/dist/cli-bundle/chunks/health-7G3EPM57.js.map +0 -1
- package/dist/cli-bundle/chunks/history-YDUEILKP.js +0 -20
- package/dist/cli-bundle/chunks/history-redact-KASLLPE7.js +0 -19
- package/dist/cli-bundle/chunks/init-IGSS4GNH.js +0 -17
- package/dist/cli-bundle/chunks/list-E44O2K64.js +0 -20
- package/dist/cli-bundle/chunks/register-list-query-I65EZ3HB.js.map +0 -1
- package/dist/cli-bundle/chunks/register-list-query-OECMHO4G.js.map +0 -7
- package/dist/cli-bundle/chunks/register-setup-DNDCGZ4O.js.map +0 -1
- package/dist/cli-bundle/chunks/restore-SJSASGZP.js +0 -17
- package/dist/cli-bundle/chunks/schema-B7NQ6XVP.js.map +0 -7
- package/dist/cli-bundle/chunks/schema-HEGYH6CE.js.map +0 -1
- package/dist/cli-bundle/chunks/search-DVVQ4UO2.js.map +0 -1
- package/dist/cli-bundle/chunks/search-JNEZJV7H.js.map +0 -7
- package/dist/cli-bundle/chunks/test-ML5RLWXE.js +0 -32
- package/dist/cli-bundle/chunks/update-6C67X4KS.js +0 -21
- package/dist/cli-bundle/chunks/update-VF26YPT3.js +0 -25
- package/dist/cli-bundle/chunks/upgrade-RSE5PC44.js.map +0 -1
- package/dist/cli-bundle/chunks/upgrade-YWI5DJFA.js.map +0 -7
- /package/dist/cli-bundle/chunks/{activity-5UROHJ3D.js.map → activity-HF3VJYKH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{activity-YVB3QRTE.js.map → activity-RUJATACW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-2PPYFAG5.js.map → append-CWQZBUWV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-AUGT5W6J.js.map → append-E7AJ5RTR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UIIQC5YO.js.map → chunk-23WNCJBA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GPXQBR3H.js.map → chunk-3RHE76G6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GUZBNB3G.js.map → chunk-42IULX44.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HLC3KTLP.js.map → chunk-44JP4PYY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HV5SSZXF.js.map → chunk-4TJWRPIH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UYQ7HXH4.js.map → chunk-5ATRWEZO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WYEXLDDY.js.map → chunk-5MMLINZB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2IF7WLB7.js.map → chunk-6IGTNFE3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UT6WFXW2.js.map → chunk-7CR4GAYN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SQPKRA54.js.map → chunk-A5342JVL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-H7EO3QA3.js.map → chunk-AM2AXVFS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LIN2BPJ7.js.map → chunk-ANKG2JKL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NQL32HQ5.js.map → chunk-BIRVSIM2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-C5W2UH56.js.map → chunk-E7LOIIFP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LXO6V66E.js.map → chunk-ENCVPOID.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4CHEG6UK.js.map → chunk-EQ6N6IDR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6RZXO5M2.js.map → chunk-FJNJEWU4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-R3V3YCMH.js.map → chunk-FKH7K6YP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3EOBJOF4.js.map → chunk-H37YPWLM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-THDEID2Z.js.map → chunk-I3UILOUU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HMMMWBK2.js.map → chunk-JEGFLKSI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OKSKJKHX.js.map → chunk-JN3BT7UY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KNGVP5WJ.js.map → chunk-KDX6VC3P.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TNPBPNII.js.map → chunk-KTVXLI54.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-X7UHMKPE.js.map → chunk-LU2HE272.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MOYM2C3J.js.map → chunk-MNXJ6YDO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WCQZBDDH.js.map → chunk-NHRZSYAA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3A2CMEM7.js.map → chunk-NJRZIJ4N.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2OJHLWBZ.js.map → chunk-NUGAWYEN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LQHBENVW.js.map → chunk-O4L7Z6LB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-V6EYFTRL.js.map → chunk-OPYA2HIU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FY6Z3FYY.js.map → chunk-P2NVFE4L.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UEWA73ZZ.js.map → chunk-PUSOAQCR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-B2KZGPM2.js.map → chunk-PW7C262O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AVJD6VTA.js.map → chunk-RE2JQJZJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GNIUOLZ2.js.map → chunk-RKCJ2JMA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5AXMRKN5.js.map → chunk-RLVI7KDW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FHHBD7PN.js.map → chunk-SAUXUI6U.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YO3THIJF.js.map → chunk-T7NWFVOA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HRMHZ4RV.js.map → chunk-U3Z4OCZC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SFFVGNHC.js.map → chunk-VDVVOLR6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2IXCHCLM.js.map → chunk-WCWIDJII.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LI65XLJR.js.map → chunk-WQZCEEQN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RVPTZKBC.js.map → chunk-XEOO6K5J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UAQOQ7IE.js.map → chunk-YSANBZAE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LMTOY5HE.js.map → chunk-YX5LAKFJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-BJ4QMPJC.js.map → claim-RV6WYUF7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-KW743OSW.js.map → claim-UXFGCF3P.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-P4ZBKODL.js.map → close-JTTGW7TS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-SYHSRZDC.js.map → close-O4JK2JKD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-YT2PQ5DD.js.map → comments-OMB7YE27.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-JEO6HHVM.js.map → comments-TTZUIB2O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{contracts-YXJ6NXKH.js.map → contracts-AOBNEBVT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{contracts-ZIBXROPE.js.map → contracts-DXCWXOSP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-BZALX5MQ.js.map → copy-5NM3SVJA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-YPWEIAPD.js.map → copy-XSYEQTLA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-CF7EVRX7.js.map → create-FCCAATQV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-4DS2QWQC.js.map → create-JAPLFDGJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-XLZRTRKR.js.map → delete-5JFP6OG7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-KR4VBWVE.js.map → delete-PQXJQXQ7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-GZMFMTGS.js.map → deps-S5322EOQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-2YTXD3VM.js.map → deps-XXKBOQUA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-SLROFEQ4.js.map → docs-C7CCVWAJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-ZHISRR2D.js.map → docs-DZRPAW5S.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-3C7OOI4F.js.map → extension-CSHP6FZX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-XYCUXICD.js.map → extension-XNNVUVAY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-J4I5IU4O.js.map → files-OBWYYPKM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-FUWF2FYJ.js.map → files-UPCNKEIZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{get-VITKYP6S.js.map → get-FLHYTOBA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{get-SZKNRHMA.js.map → get-PNTSONGB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-YDUEILKP.js.map → history-6624XISO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-SDAWYZR3.js.map → history-COQTPBEU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-POTZGG7K.js.map → history-compact-66PSRYL3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-DMW536VH.js.map → history-compact-PVS2A3FS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-EPJ7GENL.js.map → history-redact-DCXAWGTF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-KASLLPE7.js.map → history-redact-ZRQTI7NB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-YNESJRT6.js.map → history-repair-SEQDFTGW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-IJ7LLBET.js.map → history-repair-TA3NRIFO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-YHVBTEET.js.map → init-IQJE3EKJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-IGSS4GNH.js.map → init-ZVE2HMKK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-T4PF24YN.js.map → learnings-RJPGH2ME.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-4YBMIVCZ.js.map → learnings-XC6EMW5E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-3KEVBOYW.js.map → list-NJV6WBT4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-E44O2K64.js.map → list-OO5P472O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-GJKALVZM.js.map → notes-2KWHADK3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-FLUCNJSH.js.map → notes-FNCDMZW2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-T5MMZLI3.js.map → plan-CYK2P5PD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-YYMIL3HV.js.map → plan-MQO5JTSV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-operations-BNGAUMGK.js.map → register-operations-DFNVRSJ5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-operations-GQKT35H5.js.map → register-operations-TAUUTRJ4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-DDJGVZIN.js.map → restore-E3GZKRRK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-SJSASGZP.js.map → restore-F4ALFV4D.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{stats-SYTJRR4Z.js.map → stats-6LVK4JER.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{stats-7JDIJRDH.js.map → stats-ULGQACF7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{telemetry-4HHWD5Y7.js.map → telemetry-6G27FLCP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{telemetry-EGWP7ZUX.js.map → telemetry-HHKRTMZA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-IIELLSZX.js.map → test-2PP4YBV6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-ML5RLWXE.js.map → test-PPOLRIBA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-all-7DNCMML7.js.map → test-all-6Z272JRI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-all-IHTUJRRC.js.map → test-all-NETGVNM6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-RNKZ37PS.js.map → test-runs-CRPQVMMG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-5FEMBV3A.js.map → test-runs-M24WA6TI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-VF26YPT3.js.map → update-MCPCPMHV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-6C67X4KS.js.map → update-O7TBOUVQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{validate-NK3WKB7C.js.map → validate-J6Q444SD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{validate-UCEOB7S6.js.map → validate-MCNMAXVA.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
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]="3239db28-c9d2-52f1-91ca-4961e2c36c00")}catch(e){}}();
|
|
3
3
|
import fs from "node:fs/promises";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { pathExists } from "../../../core/fs/fs-utils.js";
|
|
@@ -22,18 +22,10 @@ export function buildStarterExtensionScaffoldFiles(extensionName, commandName, v
|
|
|
22
22
|
manifest_version: SCAFFOLD_MANIFEST_VERSION,
|
|
23
23
|
pm_min_version: SCAFFOLD_PM_MIN_VERSION,
|
|
24
24
|
}, null, 2)}\n`;
|
|
25
|
-
//
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
//
|
|
29
|
-
// (PR #78 review): a bare `import "@unbrained/pm-cli/sdk"` cannot resolve
|
|
30
|
-
// in extension-only mode — there is no package.json with a dep on
|
|
31
|
-
// @unbrained/pm-cli, so the loader's `import(<file-url>)` would raise
|
|
32
|
-
// ERR_MODULE_NOT_FOUND. We therefore emit the typed shape ONLY in package
|
|
33
|
-
// mode (peerDependencies make the import resolvable from the package's
|
|
34
|
-
// own node_modules) and keep the import-free shape in extension-only
|
|
35
|
-
// mode, decorated with a JSDoc @param hint so editors that follow JSDoc
|
|
36
|
-
// still narrow the `api` parameter.
|
|
25
|
+
// Keep scaffolds dependency-light by default: even package mode can be
|
|
26
|
+
// installed before peer dependencies are materialized in the generated root.
|
|
27
|
+
// The JSDoc import preserves editor narrowing without forcing the runtime
|
|
28
|
+
// loader to resolve @unbrained/pm-cli/sdk from a freshly generated scaffold.
|
|
37
29
|
const entrypoint = [
|
|
38
30
|
'/** @param {import("@unbrained/pm-cli/sdk").ExtensionApi} api */',
|
|
39
31
|
"export function activate(api) {",
|
|
@@ -200,4 +192,4 @@ export async function scaffoldExtensionProject(target, vocabulary = "extension")
|
|
|
200
192
|
};
|
|
201
193
|
}
|
|
202
194
|
//# sourceMappingURL=scaffold.js.map
|
|
203
|
-
//# debugId=
|
|
195
|
+
//# debugId=3239db28-c9d2-52f1-91ca-4961e2c36c00
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaffold.js","sources":["cli/commands/extension/scaffold.ts"],"sourceRoot":"/","sourcesContent":["import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { pathExists } from \"../../../core/fs/fs-utils.js\";\nimport { EXIT_CODE } from \"../../../core/shared/constants.js\";\nimport { PmCliError } from \"../../../core/shared/errors.js\";\nimport { normalizeManagedDirectoryName } from \"./shared.js\";\n\n// Safe compatibility floor emitted into scaffolded manifests. Mirrors the\n// first-party package manifests (pm-nf2q): every current 2026.5.x CLI\n// satisfies it, and it models the field for external authors. manifest_version\n// tracks the manifest schema generation (currently 1).\nconst SCAFFOLD_MANIFEST_VERSION = 1;\nconst SCAFFOLD_PM_MIN_VERSION = \"2026.5.0\";\n\ninterface ExtensionScaffoldFileResult {\n path: string;\n status: \"created\" | \"unchanged\";\n}\n\ninterface ExtensionScaffoldResult {\n extension_name: string;\n command_name: string;\n target_path: string;\n created_directory: boolean;\n files: ExtensionScaffoldFileResult[];\n}\n\n\nexport function buildStarterExtensionScaffoldFiles(\n extensionName: string,\n commandName: string,\n vocabulary: \"extension\" | \"package\",\n): Record<string, string> {\n const packageName = `pm-${extensionName}`;\n const manifest = `${JSON.stringify(\n {\n name: extensionName,\n version: \"0.1.0\",\n entry: \"./index.js\",\n capabilities: [\"commands\"],\n manifest_version: SCAFFOLD_MANIFEST_VERSION,\n pm_min_version: SCAFFOLD_PM_MIN_VERSION,\n },\n null,\n 2,\n )}\\n`;\n // pm-fl0c B-1 (2026-05-28): emit the documented `defineExtension({...})`\n // shape so the generated module gets full TypeScript narrowing on the\n // `activate(api)` signature (matches docs/EXTENSIONS.md, docs/SDK.md and\n // docs/examples/starter-extension/index.js). Codex P2 follow-up\n // (PR #78 review): a bare `import \"@unbrained/pm-cli/sdk\"` cannot resolve\n // in extension-only mode — there is no package.json with a dep on\n // @unbrained/pm-cli, so the loader's `import(<file-url>)` would raise\n // ERR_MODULE_NOT_FOUND. We therefore emit the typed shape ONLY in package\n // mode (peerDependencies make the import resolvable from the package's\n // own node_modules) and keep the import-free shape in extension-only\n // mode, decorated with a JSDoc @param hint so editors that follow JSDoc\n // still narrow the `api` parameter.\n const entrypoint = [\n '/** @param {import(\"@unbrained/pm-cli/sdk\").ExtensionApi} api */',\n \"export function activate(api) {\",\n \" api.registerCommand({\",\n ` name: ${JSON.stringify(commandName)},`,\n ' description: \"Starter scaffold command. Replace with your own behavior.\",',\n \" run: async (context) => ({\",\n \" ok: true,\",\n ` source: ${JSON.stringify(extensionName)},`,\n \" command: context.command,\",\n ' message: \"Starter extension scaffold is active.\",',\n \" }),\",\n \" });\",\n \"}\",\n \"\",\n \"export default {\",\n \" activate,\",\n \"};\",\n \"\",\n ].join(\"\\n\");\n if (vocabulary === \"package\") {\n const packageJson = `${JSON.stringify(\n {\n name: packageName,\n version: \"0.1.0\",\n private: true,\n type: \"module\",\n keywords: [\"pm-package\"],\n peerDependencies: {\n \"@unbrained/pm-cli\": \"*\",\n },\n pm: {\n aliases: [extensionName],\n extensions: [\".\"],\n docs: [\"README.md\"],\n examples: [\"README.md\"],\n catalog: {\n display_name: extensionName,\n category: \"workflow\",\n summary: \"Starter pm package scaffold.\",\n tags: [\"starter\"],\n },\n },\n },\n null,\n 2,\n )}\\n`;\n const packageReadme = [\n `# ${packageName}`,\n \"\",\n \"Generated by `pm package init`.\",\n \"\",\n \"## Included Files\",\n \"- `package.json`: package metadata and `pm` resource manifest.\",\n \"- `manifest.json`: extension metadata and capabilities.\",\n \"- `index.js`: starter command registration using the `commands` capability.\",\n \"\",\n \"## Quick Start\",\n \"```bash\",\n \"pm install --project <package-path>\",\n `pm ${commandName}`,\n \"pm package doctor --project --detail summary\",\n \"```\",\n \"\",\n \"## Compatibility Bounds\",\n \"`manifest.json` cannot hold comments, so the version-compatibility fields are documented here:\",\n `- \\`manifest_version\\` (integer): manifest schema generation. Leave at \\`${SCAFFOLD_MANIFEST_VERSION}\\` unless you adopt a newer manifest schema.`,\n `- \\`pm_min_version\\` (string): lowest pm CLI version that may load this package. Scaffolded as \\`${SCAFFOLD_PM_MIN_VERSION}\\`. The loader blocks the package on older CLIs.`,\n \"- `pm_max_version` (string, optional): highest pm CLI version that may load this package. Add it to block CLIs that are newer than the version you have validated against. The loader blocks the package when the CLI exceeds this bound.\",\n \"\",\n \"## Notes\",\n \"- Keep simple starter runtime behavior at the package root so local installs work without dependency bootstrapping.\",\n \"- Move larger runtimes into subdirectories only after adding package dependencies and validating `pm package doctor`.\",\n \"- Add capabilities to the extension manifest only when the entrypoint uses the matching SDK API.\",\n \"- Use `@unbrained/pm-cli/sdk` as the public SDK import for richer package runtimes.\",\n \"\",\n ].join(\"\\n\");\n return {\n \"package.json\": packageJson,\n \"manifest.json\": manifest,\n \"index.js\": entrypoint,\n \"README.md\": packageReadme,\n };\n }\n const readme = [\n `# ${extensionName}`,\n \"\",\n \"Generated by `pm extension init`.\",\n \"\",\n \"## Included Files\",\n \"- `manifest.json`: extension metadata and capabilities.\",\n \"- `index.js`: starter command registration using the `commands` capability.\",\n \"\",\n \"## Quick Start\",\n \"```bash\",\n \"pm extension --install --project <scaffold-path>\",\n `pm ${commandName}`,\n \"pm extension --doctor --project --detail summary\",\n \"```\",\n \"\",\n \"## Compatibility Bounds\",\n \"`manifest.json` cannot hold comments, so the version-compatibility fields are documented here:\",\n `- \\`manifest_version\\` (integer): manifest schema generation. Leave at \\`${SCAFFOLD_MANIFEST_VERSION}\\` unless you adopt a newer manifest schema.`,\n `- \\`pm_min_version\\` (string): lowest pm CLI version that may load this extension. Scaffolded as \\`${SCAFFOLD_PM_MIN_VERSION}\\`. The loader blocks the extension on older CLIs.`,\n \"- `pm_max_version` (string, optional): highest pm CLI version that may load this extension. Add it to block CLIs that are newer than the version you have validated against. The loader blocks the extension when the CLI exceeds this bound.\",\n \"\",\n \"## Notes\",\n \"- This scaffold uses ESM exports so it works in package scopes with `type: module`.\",\n \"- Update `manifest.json` capabilities and `index.js` command behavior as your extension evolves.\",\n \"\",\n ].join(\"\\n\");\n return {\n \"manifest.json\": manifest,\n \"index.js\": entrypoint,\n \"README.md\": readme,\n };\n}\n\nexport async function scaffoldExtensionProject(\n target: string,\n vocabulary: \"extension\" | \"package\" = \"extension\",\n): Promise<ExtensionScaffoldResult> {\n const normalizedTarget = target.trim();\n const targetPath = path.resolve(process.cwd(), normalizedTarget);\n const extensionName = normalizeManagedDirectoryName(path.basename(targetPath));\n const commandName = `${extensionName} ping`;\n const scaffoldFiles = buildStarterExtensionScaffoldFiles(extensionName, commandName, vocabulary);\n\n let createdDirectory = false;\n if (await pathExists(targetPath)) {\n const existingTargetStats = await fs.stat(targetPath);\n if (!existingTargetStats.isDirectory()) {\n throw new PmCliError(\n `Scaffold target \"${targetPath}\" exists and is not a directory.`,\n EXIT_CODE.CONFLICT,\n );\n }\n } else {\n await fs.mkdir(targetPath, { recursive: true });\n createdDirectory = true;\n }\n\n for (const [relativePath, content] of Object.entries(scaffoldFiles)) {\n const absolutePath = path.join(targetPath, relativePath);\n if (!(await pathExists(absolutePath))) {\n continue;\n }\n const existingContent = await fs.readFile(absolutePath, \"utf8\");\n if (existingContent !== content) {\n throw new PmCliError(\n `Scaffold file \"${relativePath}\" already exists with different content in \"${targetPath}\". Choose a new target path or remove conflicting files.`,\n EXIT_CODE.CONFLICT,\n );\n }\n }\n\n const files: ExtensionScaffoldFileResult[] = [];\n for (const [relativePath, content] of Object.entries(scaffoldFiles)) {\n const absolutePath = path.join(targetPath, relativePath);\n if (await pathExists(absolutePath)) {\n files.push({\n path: relativePath,\n status: \"unchanged\",\n });\n continue;\n }\n await fs.mkdir(path.dirname(absolutePath), { recursive: true });\n await fs.writeFile(absolutePath, content, \"utf8\");\n files.push({\n path: relativePath,\n status: \"created\",\n });\n }\n\n return {\n extension_name: extensionName,\n command_name: commandName,\n target_path: targetPath,\n created_directory: createdDirectory,\n files,\n };\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAC;AAE5D,0EAA0E;AAC1E,sEAAsE;AACtE,+EAA+E;AAC/E,uDAAuD;AACvD,MAAM,yBAAyB,GAAG,CAAC,CAAC;AACpC,MAAM,uBAAuB,GAAG,UAAU,CAAC;AAgB3C,MAAM,UAAU,kCAAkC,CAChD,aAAqB,EACrB,WAAmB,EACnB,UAAmC;IAEnC,MAAM,WAAW,GAAG,MAAM,aAAa,EAAE,CAAC;IAC1C,MAAM,QAAQ,GAAG,GAAG,IAAI,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-d9bd-5c8b-bb3c-5615aa081b71"}
|
|
1
|
+
{"version":3,"file":"scaffold.js","sources":["cli/commands/extension/scaffold.ts"],"sourceRoot":"/","sourcesContent":["import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { pathExists } from \"../../../core/fs/fs-utils.js\";\nimport { EXIT_CODE } from \"../../../core/shared/constants.js\";\nimport { PmCliError } from \"../../../core/shared/errors.js\";\nimport { normalizeManagedDirectoryName } from \"./shared.js\";\n\n// Safe compatibility floor emitted into scaffolded manifests. Mirrors the\n// first-party package manifests (pm-nf2q): every current 2026.5.x CLI\n// satisfies it, and it models the field for external authors. manifest_version\n// tracks the manifest schema generation (currently 1).\nconst SCAFFOLD_MANIFEST_VERSION = 1;\nconst SCAFFOLD_PM_MIN_VERSION = \"2026.5.0\";\n\ninterface ExtensionScaffoldFileResult {\n path: string;\n status: \"created\" | \"unchanged\";\n}\n\ninterface ExtensionScaffoldResult {\n extension_name: string;\n command_name: string;\n target_path: string;\n created_directory: boolean;\n files: ExtensionScaffoldFileResult[];\n}\n\n\nexport function buildStarterExtensionScaffoldFiles(\n extensionName: string,\n commandName: string,\n vocabulary: \"extension\" | \"package\",\n): Record<string, string> {\n const packageName = `pm-${extensionName}`;\n const manifest = `${JSON.stringify(\n {\n name: extensionName,\n version: \"0.1.0\",\n entry: \"./index.js\",\n capabilities: [\"commands\"],\n manifest_version: SCAFFOLD_MANIFEST_VERSION,\n pm_min_version: SCAFFOLD_PM_MIN_VERSION,\n },\n null,\n 2,\n )}\\n`;\n // Keep scaffolds dependency-light by default: even package mode can be\n // installed before peer dependencies are materialized in the generated root.\n // The JSDoc import preserves editor narrowing without forcing the runtime\n // loader to resolve @unbrained/pm-cli/sdk from a freshly generated scaffold.\n const entrypoint = [\n '/** @param {import(\"@unbrained/pm-cli/sdk\").ExtensionApi} api */',\n \"export function activate(api) {\",\n \" api.registerCommand({\",\n ` name: ${JSON.stringify(commandName)},`,\n ' description: \"Starter scaffold command. Replace with your own behavior.\",',\n \" run: async (context) => ({\",\n \" ok: true,\",\n ` source: ${JSON.stringify(extensionName)},`,\n \" command: context.command,\",\n ' message: \"Starter extension scaffold is active.\",',\n \" }),\",\n \" });\",\n \"}\",\n \"\",\n \"export default {\",\n \" activate,\",\n \"};\",\n \"\",\n ].join(\"\\n\");\n if (vocabulary === \"package\") {\n const packageJson = `${JSON.stringify(\n {\n name: packageName,\n version: \"0.1.0\",\n private: true,\n type: \"module\",\n keywords: [\"pm-package\"],\n peerDependencies: {\n \"@unbrained/pm-cli\": \"*\",\n },\n pm: {\n aliases: [extensionName],\n extensions: [\".\"],\n docs: [\"README.md\"],\n examples: [\"README.md\"],\n catalog: {\n display_name: extensionName,\n category: \"workflow\",\n summary: \"Starter pm package scaffold.\",\n tags: [\"starter\"],\n },\n },\n },\n null,\n 2,\n )}\\n`;\n const packageReadme = [\n `# ${packageName}`,\n \"\",\n \"Generated by `pm package init`.\",\n \"\",\n \"## Included Files\",\n \"- `package.json`: package metadata and `pm` resource manifest.\",\n \"- `manifest.json`: extension metadata and capabilities.\",\n \"- `index.js`: starter command registration using the `commands` capability.\",\n \"\",\n \"## Quick Start\",\n \"```bash\",\n \"pm install --project <package-path>\",\n `pm ${commandName}`,\n \"pm package doctor --project --detail summary\",\n \"```\",\n \"\",\n \"## Compatibility Bounds\",\n \"`manifest.json` cannot hold comments, so the version-compatibility fields are documented here:\",\n `- \\`manifest_version\\` (integer): manifest schema generation. Leave at \\`${SCAFFOLD_MANIFEST_VERSION}\\` unless you adopt a newer manifest schema.`,\n `- \\`pm_min_version\\` (string): lowest pm CLI version that may load this package. Scaffolded as \\`${SCAFFOLD_PM_MIN_VERSION}\\`. The loader blocks the package on older CLIs.`,\n \"- `pm_max_version` (string, optional): highest pm CLI version that may load this package. Add it to block CLIs that are newer than the version you have validated against. The loader blocks the package when the CLI exceeds this bound.\",\n \"\",\n \"## Notes\",\n \"- Keep simple starter runtime behavior at the package root so local installs work without dependency bootstrapping.\",\n \"- Move larger runtimes into subdirectories only after adding package dependencies and validating `pm package doctor`.\",\n \"- Add capabilities to the extension manifest only when the entrypoint uses the matching SDK API.\",\n \"- Use `@unbrained/pm-cli/sdk` as the public SDK import for richer package runtimes.\",\n \"\",\n ].join(\"\\n\");\n return {\n \"package.json\": packageJson,\n \"manifest.json\": manifest,\n \"index.js\": entrypoint,\n \"README.md\": packageReadme,\n };\n }\n const readme = [\n `# ${extensionName}`,\n \"\",\n \"Generated by `pm extension init`.\",\n \"\",\n \"## Included Files\",\n \"- `manifest.json`: extension metadata and capabilities.\",\n \"- `index.js`: starter command registration using the `commands` capability.\",\n \"\",\n \"## Quick Start\",\n \"```bash\",\n \"pm extension --install --project <scaffold-path>\",\n `pm ${commandName}`,\n \"pm extension --doctor --project --detail summary\",\n \"```\",\n \"\",\n \"## Compatibility Bounds\",\n \"`manifest.json` cannot hold comments, so the version-compatibility fields are documented here:\",\n `- \\`manifest_version\\` (integer): manifest schema generation. Leave at \\`${SCAFFOLD_MANIFEST_VERSION}\\` unless you adopt a newer manifest schema.`,\n `- \\`pm_min_version\\` (string): lowest pm CLI version that may load this extension. Scaffolded as \\`${SCAFFOLD_PM_MIN_VERSION}\\`. The loader blocks the extension on older CLIs.`,\n \"- `pm_max_version` (string, optional): highest pm CLI version that may load this extension. Add it to block CLIs that are newer than the version you have validated against. The loader blocks the extension when the CLI exceeds this bound.\",\n \"\",\n \"## Notes\",\n \"- This scaffold uses ESM exports so it works in package scopes with `type: module`.\",\n \"- Update `manifest.json` capabilities and `index.js` command behavior as your extension evolves.\",\n \"\",\n ].join(\"\\n\");\n return {\n \"manifest.json\": manifest,\n \"index.js\": entrypoint,\n \"README.md\": readme,\n };\n}\n\nexport async function scaffoldExtensionProject(\n target: string,\n vocabulary: \"extension\" | \"package\" = \"extension\",\n): Promise<ExtensionScaffoldResult> {\n const normalizedTarget = target.trim();\n const targetPath = path.resolve(process.cwd(), normalizedTarget);\n const extensionName = normalizeManagedDirectoryName(path.basename(targetPath));\n const commandName = `${extensionName} ping`;\n const scaffoldFiles = buildStarterExtensionScaffoldFiles(extensionName, commandName, vocabulary);\n\n let createdDirectory = false;\n if (await pathExists(targetPath)) {\n const existingTargetStats = await fs.stat(targetPath);\n if (!existingTargetStats.isDirectory()) {\n throw new PmCliError(\n `Scaffold target \"${targetPath}\" exists and is not a directory.`,\n EXIT_CODE.CONFLICT,\n );\n }\n } else {\n await fs.mkdir(targetPath, { recursive: true });\n createdDirectory = true;\n }\n\n for (const [relativePath, content] of Object.entries(scaffoldFiles)) {\n const absolutePath = path.join(targetPath, relativePath);\n if (!(await pathExists(absolutePath))) {\n continue;\n }\n const existingContent = await fs.readFile(absolutePath, \"utf8\");\n if (existingContent !== content) {\n throw new PmCliError(\n `Scaffold file \"${relativePath}\" already exists with different content in \"${targetPath}\". Choose a new target path or remove conflicting files.`,\n EXIT_CODE.CONFLICT,\n );\n }\n }\n\n const files: ExtensionScaffoldFileResult[] = [];\n for (const [relativePath, content] of Object.entries(scaffoldFiles)) {\n const absolutePath = path.join(targetPath, relativePath);\n if (await pathExists(absolutePath)) {\n files.push({\n path: relativePath,\n status: \"unchanged\",\n });\n continue;\n }\n await fs.mkdir(path.dirname(absolutePath), { recursive: true });\n await fs.writeFile(absolutePath, content, \"utf8\");\n files.push({\n path: relativePath,\n status: \"created\",\n });\n }\n\n return {\n extension_name: extensionName,\n command_name: commandName,\n target_path: targetPath,\n created_directory: createdDirectory,\n files,\n };\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAC;AAE5D,0EAA0E;AAC1E,sEAAsE;AACtE,+EAA+E;A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aAAa;QAC7B,YAAY,EAAE,WAAW;QACzB,WAAW,EAAE,UAAU;QACvB,iBAAiB,EAAE,gBAAgB;QACnC,KAAK;KACN,CAAC;AACJ,CAAC","debugId":"3239db28-c9d2-52f1-91ca-4961e2c36c00"}
|
package/dist/cli/commands/gc.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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]="abfb11ce-9272-5c0e-8fae-25ea38f31327")}catch(e){}}();
|
|
3
3
|
import fs from "node:fs/promises";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { runActiveOnIndexHooks, runActiveOnReadHooks, runActiveOnWriteHooks } from "../../core/extensions/index.js";
|
|
@@ -37,6 +37,11 @@ const GC_TARGETS = [
|
|
|
37
37
|
relativePath: "runtime/test-runs",
|
|
38
38
|
kind: "directory",
|
|
39
39
|
},
|
|
40
|
+
{
|
|
41
|
+
scope: "runtime",
|
|
42
|
+
relativePath: "runtime/history-drift-cache.json",
|
|
43
|
+
kind: "file",
|
|
44
|
+
},
|
|
40
45
|
];
|
|
41
46
|
function isErrno(error, code) {
|
|
42
47
|
return typeof error === "object" && error !== null && "code" in error && error.code === code;
|
|
@@ -127,6 +132,9 @@ function buildGcGuidance(params) {
|
|
|
127
132
|
if (searchScopeSelected && searchArtifactsAffected) {
|
|
128
133
|
guidance.push('Search artifacts were removed; run "pm install search-advanced --project" if reindex is unavailable, then "pm reindex --mode keyword" (and "--mode semantic" when semantic search is enabled) before search-heavy workflows.');
|
|
129
134
|
}
|
|
135
|
+
if (params.removed.includes("runtime/history-drift-cache.json")) {
|
|
136
|
+
guidance.push('History drift cache was removed; the next "pm health" run performs a full history-drift re-scan.');
|
|
137
|
+
}
|
|
130
138
|
return guidance;
|
|
131
139
|
}
|
|
132
140
|
export async function runGc(global, options = {}) {
|
|
@@ -194,4 +202,4 @@ export async function runGc(global, options = {}) {
|
|
|
194
202
|
};
|
|
195
203
|
}
|
|
196
204
|
//# sourceMappingURL=gc.js.map
|
|
197
|
-
//# debugId=
|
|
205
|
+
//# debugId=abfb11ce-9272-5c0e-8fae-25ea38f31327
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gc.js","sources":["cli/commands/gc.ts"],"sourceRoot":"/","sourcesContent":["import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { runActiveOnIndexHooks, runActiveOnReadHooks, runActiveOnWriteHooks } from \"../../core/extensions/index.js\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { runLockGc } from \"../../core/lock/lock-gc.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\n\nconst GC_SCOPE_VALUES = [\"index\", \"embeddings\", \"runtime\", \"locks\"] as const;\ntype GcScope = (typeof GC_SCOPE_VALUES)[number];\n\ninterface GcTarget {\n scope: GcScope;\n relativePath: string;\n kind: \"file\" | \"directory\";\n}\n\nconst GC_TARGETS: readonly GcTarget[] = [\n {\n scope: \"index\",\n relativePath: \"index/manifest.json\",\n kind: \"file\",\n },\n {\n scope: \"embeddings\",\n relativePath: \"search/embeddings.jsonl\",\n kind: \"file\",\n },\n {\n scope: \"embeddings\",\n relativePath: \"search/vectorization-status.json\",\n kind: \"file\",\n },\n {\n scope: \"embeddings\",\n relativePath: \"search/lancedb\",\n kind: \"directory\",\n },\n {\n scope: \"runtime\",\n relativePath: \"runtime/test-runs\",\n kind: \"directory\",\n },\n] as const;\n\nexport interface GcCommandOptions {\n dryRun?: boolean;\n scope?: string[];\n}\n\nexport interface GcLocksSummary {\n scanned: number;\n removed: number;\n retained: number;\n}\n\nexport interface GcResult {\n ok: boolean;\n dry_run: boolean;\n scope: GcScope[];\n removed: string[];\n retained: string[];\n warnings: string[];\n guidance: string[];\n /** Present only when the locks scope was selected. Summarizes the stale-lock sweep. */\n locks?: GcLocksSummary;\n generated_at: string;\n}\n\nfunction isErrno(error: unknown, code: string): boolean {\n return typeof error === \"object\" && error !== null && \"code\" in error && (error as { code?: string }).code === code;\n}\n\nasync function removeCacheFile(\n pmRoot: string,\n target: GcTarget,\n dryRun: boolean,\n): Promise<{ removed: boolean; warnings: string[] }> {\n const relativePath = target.relativePath;\n const absolutePath = path.join(pmRoot, relativePath);\n const warnings = await runActiveOnReadHooks({\n path: absolutePath,\n scope: \"project\",\n });\n try {\n const stats = await fs.stat(absolutePath);\n if (target.kind === \"file\" && !stats.isFile()) {\n return {\n removed: false,\n warnings: [...warnings, `not_a_file:${relativePath}`],\n };\n }\n if (target.kind === \"directory\" && !stats.isDirectory()) {\n return {\n removed: false,\n warnings: [...warnings, `not_a_directory:${relativePath}`],\n };\n }\n if (dryRun) {\n return {\n removed: true,\n warnings,\n };\n }\n if (target.kind === \"file\") {\n await fs.unlink(absolutePath);\n } else {\n await fs.rm(absolutePath, { recursive: true, force: true });\n }\n const writeWarnings = await runActiveOnWriteHooks({\n path: absolutePath,\n scope: \"project\",\n op: \"gc:remove\",\n });\n return {\n removed: true,\n warnings: [...warnings, ...writeWarnings],\n };\n } catch (error: unknown) {\n if (isErrno(error, \"ENOENT\")) {\n return {\n removed: false,\n warnings,\n };\n }\n throw error;\n }\n}\n\nfunction parseScopes(raw: string[] | undefined): GcScope[] {\n if (!raw || raw.length === 0) {\n return [...GC_SCOPE_VALUES];\n }\n const tokens = raw\n .flatMap((entry) => entry.split(\",\"))\n .map((entry) => entry.trim().toLowerCase())\n .filter((entry) => entry.length > 0);\n if (tokens.length === 0) {\n throw new PmCliError(`--scope requires at least one value (${GC_SCOPE_VALUES.join(\",\")})`, EXIT_CODE.USAGE);\n }\n const resolved = new Set<GcScope>();\n for (const token of tokens) {\n if (!(GC_SCOPE_VALUES as readonly string[]).includes(token)) {\n throw new PmCliError(\n `Invalid --scope value \"${token}\". Expected one or more of: ${GC_SCOPE_VALUES.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n }\n resolved.add(token as GcScope);\n }\n return GC_SCOPE_VALUES.filter((scope) => resolved.has(scope));\n}\n\nfunction buildGcGuidance(params: {\n dryRun: boolean;\n scopes: GcScope[];\n removed: string[];\n}): string[] {\n const guidance: string[] = [];\n if (params.dryRun) {\n guidance.push(\"Dry-run preview only: no cache artifacts were deleted.\");\n }\n const searchScopeSelected = params.scopes.includes(\"index\") || params.scopes.includes(\"embeddings\");\n const searchArtifactsAffected = params.removed.some(\n (entry) =>\n entry === \"index/manifest.json\" ||\n entry === \"search/embeddings.jsonl\" ||\n entry === \"search/vectorization-status.json\" ||\n entry === \"search/lancedb\",\n );\n if (searchScopeSelected && searchArtifactsAffected) {\n guidance.push(\n 'Search artifacts were removed; run \"pm install search-advanced --project\" if reindex is unavailable, then \"pm reindex --mode keyword\" (and \"--mode semantic\" when semantic search is enabled) before search-heavy workflows.',\n );\n }\n return guidance;\n}\n\nexport async function runGc(global: GlobalOptions, options: GcCommandOptions = {}): Promise<GcResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n\n await readSettings(pmRoot);\n const dryRun = options.dryRun === true;\n const scopes = parseScopes(options.scope);\n const selectedTargets = GC_TARGETS.filter((target) => scopes.includes(target.scope));\n\n const removed: string[] = [];\n const retained: string[] = [];\n const warnings: string[] = [];\n\n for (const target of selectedTargets) {\n const result = await removeCacheFile(pmRoot, target, dryRun);\n if (result.removed) {\n removed.push(target.relativePath);\n } else {\n retained.push(target.relativePath);\n }\n warnings.push(...result.warnings);\n }\n\n // The locks scope is not a path-based GC_TARGET: it sweeps the locks/ directory\n // and removes only locks whose own embedded ttl has expired (crashed-process\n // debris), retaining active and unparseable locks. See core/lock/lock-gc.ts.\n let locksSummary: GcLocksSummary | undefined;\n if (scopes.includes(\"locks\")) {\n const lockResult = await runLockGc(pmRoot, {\n dryRun,\n hooks: {\n onRead: (lockPath) => runActiveOnReadHooks({ path: lockPath, scope: \"project\" }),\n onWrite: (lockPath) => runActiveOnWriteHooks({ path: lockPath, scope: \"project\", op: \"gc:lock_remove\" }),\n },\n });\n removed.push(...lockResult.removed);\n retained.push(...lockResult.retained);\n warnings.push(...lockResult.warnings);\n locksSummary = {\n scanned: lockResult.scanned,\n removed: lockResult.removed.length,\n retained: lockResult.retained.length,\n };\n }\n\n warnings.push(\n ...(await runActiveOnIndexHooks({\n mode: dryRun ? \"gc:dry-run\" : \"gc\",\n total_items: selectedTargets.length,\n })),\n );\n const guidance = buildGcGuidance({\n dryRun,\n scopes,\n removed,\n });\n\n return {\n ok: warnings.length === 0,\n dry_run: dryRun,\n scope: scopes,\n removed,\n retained,\n warnings,\n ...(locksSummary ? { locks: locksSummary } : {}),\n guidance,\n generated_at: nowIso(),\n };\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACpH,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,g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AAG,UAAU,CAAC,OAAO,CAAC,CAAC;QACpC,QAAQ,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;QACtC,QAAQ,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;QACtC,YAAY,GAAG;YACb,OAAO,EAAE,UAAU,CAAC,OAAO;YAC3B,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,MAAM;YAClC,QAAQ,EAAE,UAAU,CAAC,QAAQ,CAAC,MAAM;SACrC,CAAC;IACJ,CAAC;IAED,QAAQ,CAAC,IAAI,CACX,GAAG,CAAC,MAAM,qBAAqB,CAAC;QAC9B,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI;QAClC,WAAW,EAAE,eAAe,CAAC,MAAM;KACpC,CAAC,CAAC,CACJ,CAAC;IACF,MAAM,QAAQ,GAAG,eAAe,CAAC;QAC/B,MAAM;QACN,MAAM;QACN,OAAO;KACR,CAAC,CAAC;IAEH,OAAO;QACL,EAAE,EAAE,QAAQ,CAAC,MAAM,KAAK,CAAC;QACzB,OAAO,EAAE,MAAM;QACf,KAAK,EAAE,MAAM;QACb,OAAO;QACP,QAAQ;QACR,QAAQ;QACR,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAChD,QAAQ;QACR,YAAY,EAAE,MAAM,EAAE;KACvB,CAAC;AACJ,CAAC","debugId":"ddcbdf59-d0c8-5ae8-84e3-c4af1966deb6"}
|
|
1
|
+
{"version":3,"file":"gc.js","sources":["cli/commands/gc.ts"],"sourceRoot":"/","sourcesContent":["import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { runActiveOnIndexHooks, runActiveOnReadHooks, runActiveOnWriteHooks } from \"../../core/extensions/index.js\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { runLockGc } from \"../../core/lock/lock-gc.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\n\nconst GC_SCOPE_VALUES = [\"index\", \"embeddings\", \"runtime\", \"locks\"] as const;\ntype GcScope = (typeof GC_SCOPE_VALUES)[number];\n\ninterface GcTarget {\n scope: GcScope;\n relativePath: string;\n kind: \"file\" | \"directory\";\n}\n\nconst GC_TARGETS: readonly GcTarget[] = [\n {\n scope: \"index\",\n relativePath: \"index/manifest.json\",\n kind: \"file\",\n },\n {\n scope: \"embeddings\",\n relativePath: \"search/embeddings.jsonl\",\n kind: \"file\",\n },\n {\n scope: \"embeddings\",\n relativePath: \"search/vectorization-status.json\",\n kind: \"file\",\n },\n {\n scope: \"embeddings\",\n relativePath: \"search/lancedb\",\n kind: \"directory\",\n },\n {\n scope: \"runtime\",\n relativePath: \"runtime/test-runs\",\n kind: \"directory\",\n },\n {\n scope: \"runtime\",\n relativePath: \"runtime/history-drift-cache.json\",\n kind: \"file\",\n },\n] as const;\n\nexport interface GcCommandOptions {\n dryRun?: boolean;\n scope?: string[];\n}\n\nexport interface GcLocksSummary {\n scanned: number;\n removed: number;\n retained: number;\n}\n\nexport interface GcResult {\n ok: boolean;\n dry_run: boolean;\n scope: GcScope[];\n removed: string[];\n retained: string[];\n warnings: string[];\n guidance: string[];\n /** Present only when the locks scope was selected. Summarizes the stale-lock sweep. */\n locks?: GcLocksSummary;\n generated_at: string;\n}\n\nfunction isErrno(error: unknown, code: string): boolean {\n return typeof error === \"object\" && error !== null && \"code\" in error && (error as { code?: string }).code === code;\n}\n\nasync function removeCacheFile(\n pmRoot: string,\n target: GcTarget,\n dryRun: boolean,\n): Promise<{ removed: boolean; warnings: string[] }> {\n const relativePath = target.relativePath;\n const absolutePath = path.join(pmRoot, relativePath);\n const warnings = await runActiveOnReadHooks({\n path: absolutePath,\n scope: \"project\",\n });\n try {\n const stats = await fs.stat(absolutePath);\n if (target.kind === \"file\" && !stats.isFile()) {\n return {\n removed: false,\n warnings: [...warnings, `not_a_file:${relativePath}`],\n };\n }\n if (target.kind === \"directory\" && !stats.isDirectory()) {\n return {\n removed: false,\n warnings: [...warnings, `not_a_directory:${relativePath}`],\n };\n }\n if (dryRun) {\n return {\n removed: true,\n warnings,\n };\n }\n if (target.kind === \"file\") {\n await fs.unlink(absolutePath);\n } else {\n await fs.rm(absolutePath, { recursive: true, force: true });\n }\n const writeWarnings = await runActiveOnWriteHooks({\n path: absolutePath,\n scope: \"project\",\n op: \"gc:remove\",\n });\n return {\n removed: true,\n warnings: [...warnings, ...writeWarnings],\n };\n } catch (error: unknown) {\n if (isErrno(error, \"ENOENT\")) {\n return {\n removed: false,\n warnings,\n };\n }\n throw error;\n }\n}\n\nfunction parseScopes(raw: string[] | undefined): GcScope[] {\n if (!raw || raw.length === 0) {\n return [...GC_SCOPE_VALUES];\n }\n const tokens = raw\n .flatMap((entry) => entry.split(\",\"))\n .map((entry) => entry.trim().toLowerCase())\n .filter((entry) => entry.length > 0);\n if (tokens.length === 0) {\n throw new PmCliError(`--scope requires at least one value (${GC_SCOPE_VALUES.join(\",\")})`, EXIT_CODE.USAGE);\n }\n const resolved = new Set<GcScope>();\n for (const token of tokens) {\n if (!(GC_SCOPE_VALUES as readonly string[]).includes(token)) {\n throw new PmCliError(\n `Invalid --scope value \"${token}\". Expected one or more of: ${GC_SCOPE_VALUES.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n }\n resolved.add(token as GcScope);\n }\n return GC_SCOPE_VALUES.filter((scope) => resolved.has(scope));\n}\n\nfunction buildGcGuidance(params: {\n dryRun: boolean;\n scopes: GcScope[];\n removed: string[];\n}): string[] {\n const guidance: string[] = [];\n if (params.dryRun) {\n guidance.push(\"Dry-run preview only: no cache artifacts were deleted.\");\n }\n const searchScopeSelected = params.scopes.includes(\"index\") || params.scopes.includes(\"embeddings\");\n const searchArtifactsAffected = params.removed.some(\n (entry) =>\n entry === \"index/manifest.json\" ||\n entry === \"search/embeddings.jsonl\" ||\n entry === \"search/vectorization-status.json\" ||\n entry === \"search/lancedb\",\n );\n if (searchScopeSelected && searchArtifactsAffected) {\n guidance.push(\n 'Search artifacts were removed; run \"pm install search-advanced --project\" if reindex is unavailable, then \"pm reindex --mode keyword\" (and \"--mode semantic\" when semantic search is enabled) before search-heavy workflows.',\n );\n }\n if (params.removed.includes(\"runtime/history-drift-cache.json\")) {\n guidance.push('History drift cache was removed; the next \"pm health\" run performs a full history-drift re-scan.');\n }\n return guidance;\n}\n\nexport async function runGc(global: GlobalOptions, options: GcCommandOptions = {}): Promise<GcResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n\n await readSettings(pmRoot);\n const dryRun = options.dryRun === true;\n const scopes = parseScopes(options.scope);\n const selectedTargets = GC_TARGETS.filter((target) => scopes.includes(target.scope));\n\n const removed: string[] = [];\n const retained: string[] = [];\n const warnings: string[] = [];\n\n for (const target of selectedTargets) {\n const result = await removeCacheFile(pmRoot, target, dryRun);\n if (result.removed) {\n removed.push(target.relativePath);\n } else {\n retained.push(target.relativePath);\n }\n warnings.push(...result.warnings);\n }\n\n // The locks scope is not a path-based GC_TARGET: it sweeps the locks/ directory\n // and removes only locks whose own embedded ttl has expired (crashed-process\n // debris), retaining active and unparseable locks. See core/lock/lock-gc.ts.\n let locksSummary: GcLocksSummary | undefined;\n if (scopes.includes(\"locks\")) {\n const lockResult = await runLockGc(pmRoot, {\n dryRun,\n hooks: {\n onRead: (lockPath) => runActiveOnReadHooks({ path: lockPath, scope: \"project\" }),\n onWrite: (lockPath) => runActiveOnWriteHooks({ path: lockPath, scope: \"project\", op: \"gc:lock_remove\" }),\n },\n });\n removed.push(...lockResult.removed);\n retained.push(...lockResult.retained);\n warnings.push(...lockResult.warnings);\n locksSummary = {\n scanned: lockResult.scanned,\n removed: lockResult.removed.length,\n retained: lockResult.retained.length,\n };\n }\n\n warnings.push(\n ...(await runActiveOnIndexHooks({\n mode: dryRun ? \"gc:dry-run\" : \"gc\",\n total_items: selectedTargets.length,\n })),\n );\n const guidance = buildGcGuidance({\n dryRun,\n scopes,\n removed,\n });\n\n return {\n ok: warnings.length === 0,\n dry_run: dryRun,\n scope: scopes,\n removed,\n retained,\n warnings,\n ...(locksSummary ? { locks: locksSummary } : {}),\n guidance,\n generated_at: nowIso(),\n };\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACpH,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,OAAO,CAAU,CAAC;AAS7E,MAAM,UAAU,GAAwB;IACtC;QACE,KAAK,EAAE,OAAO;QACd,YAAY,EAAE,qBAAqB;QACnC,IAAI,EAAE,MAAM;KACb;IACD;QACE,KAAK,EAAE,YAAY;QACnB,YAAY,EAAE,yBAAyB;QACvC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CAAC,MAAM;YAClC,QAAQ,EAAE,UAAU,CAAC,QAAQ,CAAC,MAAM;SACrC,CAAC;IACJ,CAAC;IAED,QAAQ,CAAC,IAAI,CACX,GAAG,CAAC,MAAM,qBAAqB,CAAC;QAC9B,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI;QAClC,WAAW,EAAE,eAAe,CAAC,MAAM;KACpC,CAAC,CAAC,CACJ,CAAC;IACF,MAAM,QAAQ,GAAG,eAAe,CAAC;QAC/B,MAAM;QACN,MAAM;QACN,OAAO;KACR,CAAC,CAAC;IAEH,OAAO;QACL,EAAE,EAAE,QAAQ,CAAC,MAAM,KAAK,CAAC;QACzB,OAAO,EAAE,MAAM;QACf,KAAK,EAAE,MAAM;QACb,OAAO;QACP,QAAQ;QACR,QAAQ;QACR,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAChD,QAAQ;QACR,YAAY,EAAE,MAAM,EAAE;KACvB,CAAC;AACJ,CAAC","debugId":"abfb11ce-9272-5c0e-8fae-25ea38f31327"}
|
|
@@ -1,5 +1,5 @@
|
|
|
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]="8fd98976-c64b-5a5e-acc8-91761a188267")}catch(e){}}();
|
|
3
3
|
import fs from "node:fs/promises";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { resolveItemTypeRegistry } from "../../core/item/type-registry.js";
|
|
@@ -21,6 +21,7 @@ import { toNonEmptyStringOrUndefined } from "../../core/shared/primitives.js";
|
|
|
21
21
|
import { nowIso } from "../../core/shared/time.js";
|
|
22
22
|
import { parseItemDocument } from "../../core/item/item-format.js";
|
|
23
23
|
import { listAllFrontMatter, listAllFrontMatterWithBody } from "../../core/store/item-store.js";
|
|
24
|
+
import { TELEMETRY_SCHEMA_VERSION } from "../../core/telemetry/runtime.js";
|
|
24
25
|
import { getItemFormatFromPath, getSettingsPath, ITEM_FILE_EXTENSIONS, resolveGlobalPmRoot, resolvePmRoot, } from "../../core/store/paths.js";
|
|
25
26
|
import { readSettingsWithMetadata } from "../../core/store/settings.js";
|
|
26
27
|
import { buildRemediationMap } from "../../core/diagnostics/remediation.js";
|
|
@@ -953,6 +954,13 @@ async function buildTelemetryCheck(settings, options) {
|
|
|
953
954
|
warnings.push("telemetry_endpoint_probe_failed");
|
|
954
955
|
}
|
|
955
956
|
}
|
|
957
|
+
const parsedMaxSchemaVersion = Number.parseInt(endpointProbe?.max_schema_version ?? "", 10);
|
|
958
|
+
if (endpointProbe &&
|
|
959
|
+
endpointProbe.ok &&
|
|
960
|
+
Number.isInteger(parsedMaxSchemaVersion) &&
|
|
961
|
+
parsedMaxSchemaVersion > TELEMETRY_SCHEMA_VERSION) {
|
|
962
|
+
warnings.push(`telemetry_schema_version_behind:${parsedMaxSchemaVersion}`);
|
|
963
|
+
}
|
|
956
964
|
return {
|
|
957
965
|
check: {
|
|
958
966
|
name: "telemetry",
|
|
@@ -1296,4 +1304,4 @@ export async function runHealth(global, options = {}) {
|
|
|
1296
1304
|
return options.brief === true ? applyBriefHealthProjection(result) : result;
|
|
1297
1305
|
}
|
|
1298
1306
|
//# sourceMappingURL=health.js.map
|
|
1299
|
-
//# debugId=
|
|
1307
|
+
//# debugId=8fd98976-c64b-5a5e-acc8-91761a188267
|