@unbrained/pm-cli 2026.6.5 → 2026.6.6
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/CHANGELOG.md +40 -0
- package/CONTRIBUTING.md +1 -0
- package/README.md +12 -4
- package/dist/cli/commands/completion.js +21 -7
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/contracts.js +5 -3
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/commands/gc.d.ts +8 -1
- package/dist/cli/commands/gc.js +26 -3
- package/dist/cli/commands/gc.js.map +1 -1
- package/dist/cli/commands/health.js +15 -2
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/history.d.ts +4 -1
- package/dist/cli/commands/history.js +12 -24
- package/dist/cli/commands/history.js.map +1 -1
- package/dist/cli/commands/index.d.ts +1 -0
- package/dist/cli/commands/index.js +3 -2
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/stats.d.ts +8 -1
- package/dist/cli/commands/stats.js +18 -17
- package/dist/cli/commands/stats.js.map +1 -1
- package/dist/cli/commands/telemetry.d.ts +8 -0
- package/dist/cli/commands/telemetry.js +253 -0
- package/dist/cli/commands/telemetry.js.map +1 -0
- package/dist/cli/help-content.js +11 -2
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/register-list-query.js +7 -4
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-operations.js +29 -6
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli-bundle/chunks/activity-CVXTCHYY.js +16 -0
- package/dist/cli-bundle/chunks/{activity-3RWRRNOW.js → activity-JM6DTDND.js} +11 -11
- package/dist/cli-bundle/chunks/{aggregate-J35K7WZB.js → aggregate-GI7WSZPH.js} +10 -10
- package/dist/cli-bundle/chunks/{aggregate-OOAGKWRG.js → aggregate-VNAHUNNF.js} +10 -10
- package/dist/cli-bundle/chunks/{append-5JE3YGXU.js → append-7H5N64R2.js} +8 -8
- package/dist/cli-bundle/chunks/{append-PNN6UIBZ.js → append-WMKRXKCE.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-D5X7N6FI.js → chunk-23YFZ3IG.js} +12 -12
- package/dist/cli-bundle/chunks/{chunk-FVXM3GKS.js → chunk-2HVRUSQA.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-V3JQ4IPL.js → chunk-2RSPZI5H.js} +102 -22
- package/dist/cli-bundle/chunks/chunk-2RSPZI5H.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-SZQCER6S.js → chunk-2VBQ6ZXS.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-A6PEXMYN.js → chunk-2VVCGBNV.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-UOVLWB47.js → chunk-3BWOVLTH.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-5IRA6IYD.js → chunk-3FI4SEFT.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-3OH4DAEB.js → chunk-3LB74A67.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-GFWHHMVV.js → chunk-3VAM3NNM.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-4QCR4QW3.js → chunk-4LL6TK5B.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-TBQVUNVH.js → chunk-52MAOQ6J.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-5KB4X7YY.js → chunk-5FDATVEZ.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-4LTBNUYT.js → chunk-5SFCOO6B.js} +76 -7
- package/dist/cli-bundle/chunks/{chunk-4LTBNUYT.js.map → chunk-5SFCOO6B.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-GCAVRLGE.js → chunk-6ER6DXH5.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-26KTVXJW.js → chunk-6P6GGMOG.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-MISYRLEP.js → chunk-77GFDHGF.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-HPH6X4ZZ.js → chunk-AO442XLN.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-ORTLYVA4.js → chunk-AY43SBIN.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-D3WUNETC.js → chunk-BQHUILZS.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-KCMIYKTA.js → chunk-E5FJNAZA.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-OIQIXTNB.js → chunk-ECCMVXGM.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-5PAOPUZX.js → chunk-FRAUKRU2.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-JQI2HE55.js → chunk-GCOQW437.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-CWT53EYT.js → chunk-GGYWB3Y2.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-ATBVS6WW.js → chunk-GU2ZJ2VV.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-ASQM3IF5.js → chunk-GXSUPCBV.js} +5 -4
- package/dist/cli-bundle/chunks/{chunk-SSFMJCPF.js → chunk-HZGUAH22.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-GPGAYASV.js → chunk-I2HSTRJF.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-RQAWLSUU.js → chunk-I6BNFU5X.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-OUF3ARDX.js → chunk-IJGCZSIQ.js} +12 -12
- package/dist/cli-bundle/chunks/chunk-IOR7LGF4.js +1491 -0
- package/dist/cli-bundle/chunks/chunk-IOR7LGF4.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-XX5LRINW.js → chunk-KAG77BY3.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-BNL6S7QH.js → chunk-KJ33AOCY.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-4PJQSECJ.js → chunk-KJE2FOS4.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-GNHVV4SY.js → chunk-KWU6HG75.js} +37 -14
- package/dist/cli-bundle/chunks/chunk-KWU6HG75.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-KBG47ZOY.js → chunk-LB3RUL2N.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-HZOS2UG5.js → chunk-LCM63IXU.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-VGO2T3TY.js → chunk-ME2YH6FN.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-ZRVSMOMR.js → chunk-MITFDD35.js} +12 -12
- package/dist/cli-bundle/chunks/{chunk-Y2AKE2HS.js → chunk-N7ACFE26.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-AXXKLVTW.js → chunk-NUZ5HKR4.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-KK6YPGH3.js → chunk-OVQCEJPG.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-B3N4TKNL.js → chunk-OZ7NSQHL.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-TK633IVD.js → chunk-PDDFYW4X.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-DFIZGAI5.js → chunk-PIU6RSL3.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-O5IBJE6S.js → chunk-PO3GSVFV.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WIKR7KFL.js → chunk-PRJCELV4.js} +108 -21
- package/dist/cli-bundle/chunks/chunk-PRJCELV4.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-ZQ4F6EC4.js → chunk-PROOHX4K.js} +38 -15
- package/dist/cli-bundle/chunks/chunk-PROOHX4K.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-N5YF3VFN.js → chunk-Q7SPNHLW.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-RANZIID5.js → chunk-QO7EBBOM.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-LDJK7SHN.js → chunk-R6UFP2GE.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-CCUFLH4J.js → chunk-RWPSOIEE.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-UFCG3SWR.js → chunk-RZN6VURO.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-SKJWX3QB.js +1501 -0
- package/dist/cli-bundle/chunks/chunk-SKJWX3QB.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-KA24HME7.js → chunk-T3LC5LKB.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NQP3ECKF.js → chunk-TCD3R2PF.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-EHXPIKKP.js → chunk-TPH5XEVD.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-SRVKTWPR.js → chunk-U5SXYXSY.js} +75 -6
- package/dist/cli-bundle/chunks/{chunk-SRVKTWPR.js.map → chunk-U5SXYXSY.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-T2ORWB6D.js → chunk-UBOPJT3S.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-S3CV7JGJ.js → chunk-UM2GBHS4.js} +5 -4
- package/dist/cli-bundle/chunks/{chunk-G5BACLYH.js → chunk-W7XABV4H.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-K47WAYQV.js → chunk-WKY2IBOQ.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-7K24QB23.js → chunk-WOPXVEZP.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-DFUSXJDE.js → chunk-WSMOSYRD.js} +12 -12
- package/dist/cli-bundle/chunks/{chunk-CJDQB2ED.js → chunk-XLTD2HN3.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-TQ3ZK6VD.js → chunk-XSJCLN2R.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-XG7RJYHV.js → chunk-XTGLRY2Y.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-JB4RGL4V.js → chunk-YL2DJGYS.js} +7 -7
- package/dist/cli-bundle/chunks/{claim-AZLP7YFO.js → claim-4DBF6RVG.js} +10 -10
- package/dist/cli-bundle/chunks/{claim-ZFA7HKU4.js → claim-X2P4IB7J.js} +10 -10
- package/dist/cli-bundle/chunks/close-3HDWDA3L.js +13 -0
- package/dist/cli-bundle/chunks/{close-65DFYAVS.js → close-PTYFA45H.js} +8 -8
- package/dist/cli-bundle/chunks/{close-many-UKZSQGM7.js → close-many-7CGIDPTJ.js} +15 -15
- package/dist/cli-bundle/chunks/{close-many-AKPZNSGI.js → close-many-ERFO6LHR.js} +15 -15
- package/dist/cli-bundle/chunks/{comments-CJWXQI7X.js → comments-OONGABK5.js} +10 -10
- package/dist/cli-bundle/chunks/{comments-AGBNSJJH.js → comments-QKBYCWKD.js} +10 -10
- package/dist/cli-bundle/chunks/{config-DDPYIA6J.js → config-6FXCQKIF.js} +8 -8
- package/dist/cli-bundle/chunks/{config-5ON3ADRH.js → config-U4RZ4CQB.js} +8 -8
- package/dist/cli-bundle/chunks/{context-E6U3DWVM.js → context-FYYJGFWS.js} +13 -13
- package/dist/cli-bundle/chunks/{context-ZOJEN5VT.js → context-YMJ3Z2HQ.js} +13 -13
- package/dist/cli-bundle/chunks/{contracts-LCSX5R53.js → contracts-QDB6OMLQ.js} +10 -6
- package/dist/cli-bundle/chunks/contracts-QDB6OMLQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{contracts-CXSFM45B.js → contracts-RFSPGVVJ.js} +9 -5
- package/dist/cli-bundle/chunks/{contracts-LCSX5R53.js.map → contracts-RFSPGVVJ.js.map} +7 -1
- package/dist/cli-bundle/chunks/{create-WYFKN2U4.js → create-I5L4EYYZ.js} +13 -13
- package/dist/cli-bundle/chunks/create-JTZNCTQC.js +27 -0
- package/dist/cli-bundle/chunks/{delete-ZXWC56WO.js → delete-7HPGI4GZ.js} +7 -7
- package/dist/cli-bundle/chunks/{delete-RONNH4F4.js → delete-VXUPH5RS.js} +7 -7
- package/dist/cli-bundle/chunks/{deps-WII3O4HB.js → deps-JSRRWC3Z.js} +7 -7
- package/dist/cli-bundle/chunks/{deps-EHXIFOZR.js → deps-SCZIFK2Z.js} +7 -7
- package/dist/cli-bundle/chunks/{docs-PDREIMLS.js → docs-GJK6K4VP.js} +9 -9
- package/dist/cli-bundle/chunks/{docs-JMVCFNHH.js → docs-WW4N3MBM.js} +9 -9
- package/dist/cli-bundle/chunks/{extension-G6UXSM5S.js → extension-J7IBMFTD.js} +4 -4
- package/dist/cli-bundle/chunks/{extension-B4ROVWJD.js → extension-VDY2U33M.js} +4 -4
- package/dist/cli-bundle/chunks/{files-2PN7UM2D.js → files-ISZJGILQ.js} +9 -9
- package/dist/cli-bundle/chunks/{files-MXYS5W4M.js → files-WKOD326U.js} +9 -9
- package/dist/cli-bundle/chunks/gc-JDVJ6OQ2.js +362 -0
- package/dist/cli-bundle/chunks/gc-JDVJ6OQ2.js.map +1 -0
- package/dist/cli-bundle/chunks/gc-ULPVWMTN.js +372 -0
- package/dist/cli-bundle/chunks/gc-ULPVWMTN.js.map +7 -0
- package/dist/cli-bundle/chunks/{get-WXMLRG7M.js → get-RV37HT3G.js} +10 -10
- package/dist/cli-bundle/chunks/{get-CINFEUIY.js → get-WXU6WI5P.js} +10 -10
- package/dist/cli-bundle/chunks/{health-IT5DBPRJ.js → health-6L6EH4WR.js} +26 -13
- package/dist/cli-bundle/chunks/health-6L6EH4WR.js.map +7 -0
- package/dist/cli-bundle/chunks/{health-5VPOJQ53.js → health-LOI2HHKB.js} +27 -14
- package/dist/cli-bundle/chunks/health-LOI2HHKB.js.map +1 -0
- package/dist/cli-bundle/chunks/history-2BA3T5AE.js +20 -0
- package/dist/cli-bundle/chunks/{history-FLZIP7PM.js → history-PKN67D5O.js} +10 -10
- package/dist/cli-bundle/chunks/history-redact-JBZNXHGR.js +19 -0
- package/dist/cli-bundle/chunks/{history-redact-SSZBAD76.js → history-redact-V4FOJGS7.js} +11 -11
- package/dist/cli-bundle/chunks/{history-repair-KC5ZOJRZ.js → history-repair-HIBCBIKK.js} +11 -11
- package/dist/cli-bundle/chunks/{history-repair-X7CO5JJZ.js → history-repair-SDMHR7JT.js} +11 -11
- package/dist/cli-bundle/chunks/init-HIVSNX3O.js +16 -0
- package/dist/cli-bundle/chunks/{init-6MRFVOLH.js → init-P56QYWJF.js} +8 -8
- package/dist/cli-bundle/chunks/{learnings-DCX55BNX.js → learnings-GDFRG5J7.js} +10 -10
- package/dist/cli-bundle/chunks/{learnings-A3CLB5CO.js → learnings-MIXSESLK.js} +10 -10
- package/dist/cli-bundle/chunks/{list-DBRECOG4.js → list-FGOWQMSM.js} +10 -10
- package/dist/cli-bundle/chunks/list-MUSQNMTD.js +20 -0
- package/dist/cli-bundle/chunks/{notes-42LIC3UE.js → notes-4XVSH2AZ.js} +10 -10
- package/dist/cli-bundle/chunks/{notes-P5O3VMQ3.js → notes-5UK3GEH2.js} +10 -10
- package/dist/cli-bundle/chunks/{plan-IGTE3WOJ.js → plan-DUMBV3QB.js} +13 -13
- package/dist/cli-bundle/chunks/{plan-HDQXEUKD.js → plan-SLMODHWX.js} +13 -13
- package/dist/cli-bundle/chunks/{register-list-query-EMNSIUO4.js → register-list-query-POCFZ5JW.js} +24 -22
- package/dist/cli-bundle/chunks/{register-list-query-EMNSIUO4.js.map → register-list-query-POCFZ5JW.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-list-query-AG3XKXWL.js → register-list-query-WST76HSQ.js} +23 -21
- package/dist/cli-bundle/chunks/{register-list-query-AG3XKXWL.js.map → register-list-query-WST76HSQ.js.map} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-M3YS6XDO.js → register-mutation-N5GSUZJV.js} +30 -30
- package/dist/cli-bundle/chunks/{register-mutation-RSMT6DPK.js → register-mutation-OA675SOU.js} +30 -30
- package/dist/cli-bundle/chunks/{register-operations-KYUOOOOD.js → register-operations-GNHBE5I3.js} +47 -34
- package/dist/cli-bundle/chunks/register-operations-GNHBE5I3.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-operations-Q54JQZUN.js → register-operations-N3PMHXH5.js} +46 -33
- package/dist/cli-bundle/chunks/{register-operations-Q54JQZUN.js.map → register-operations-N3PMHXH5.js.map} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-DI6P7X75.js → register-setup-JIMPKJKV.js} +15 -15
- package/dist/cli-bundle/chunks/{register-setup-YJKIQRKA.js → register-setup-ZHJI2DI3.js} +15 -15
- package/dist/cli-bundle/chunks/restore-D4RGNX33.js +17 -0
- package/dist/cli-bundle/chunks/{restore-2XVTBLKQ.js → restore-PBL6T5TW.js} +11 -11
- package/dist/cli-bundle/chunks/{schema-V6BX65Q2.js → schema-2NOO6NGB.js} +8 -8
- package/dist/cli-bundle/chunks/{schema-LVXZWFGY.js → schema-EBI4NLUO.js} +8 -8
- package/dist/cli-bundle/chunks/{search-C7NPB7G7.js → search-JPUQTVCY.js} +10 -10
- package/dist/cli-bundle/chunks/{search-5A3BMFA7.js → search-OA6JX27A.js} +10 -10
- package/dist/cli-bundle/chunks/stats-CV54BAWY.js +202 -0
- package/dist/cli-bundle/chunks/stats-CV54BAWY.js.map +1 -0
- package/dist/cli-bundle/chunks/stats-XYB6KTFG.js +212 -0
- package/dist/cli-bundle/chunks/stats-XYB6KTFG.js.map +7 -0
- package/dist/cli-bundle/chunks/telemetry-LMJ7PFUO.js +251 -0
- package/dist/cli-bundle/chunks/telemetry-LMJ7PFUO.js.map +7 -0
- package/dist/cli-bundle/chunks/telemetry-NCMEPJNR.js +248 -0
- package/dist/cli-bundle/chunks/telemetry-NCMEPJNR.js.map +1 -0
- package/dist/cli-bundle/chunks/{test-RJ4ZF35X.js → test-MXX3E5JL.js} +13 -13
- package/dist/cli-bundle/chunks/{test-OFYONO3C.js → test-WBROAJIE.js} +13 -13
- package/dist/cli-bundle/chunks/{test-all-OJE6CIO7.js → test-all-N6NSRDTV.js} +13 -13
- package/dist/cli-bundle/chunks/{test-all-EEMKNTGU.js → test-all-NTOZ7C3M.js} +13 -13
- package/dist/cli-bundle/chunks/{test-runs-IPOPFOAF.js → test-runs-V6A7LPWZ.js} +5 -5
- package/dist/cli-bundle/chunks/{test-runs-L2M7WKH7.js → test-runs-WMVTQU3Y.js} +5 -5
- package/dist/cli-bundle/chunks/update-OSV3NAQB.js +25 -0
- package/dist/cli-bundle/chunks/update-YRXSUGYQ.js +21 -0
- package/dist/cli-bundle/chunks/{update-many-DYWGW57M.js → update-many-EM6OXYGO.js} +22 -22
- package/dist/cli-bundle/chunks/{update-many-322CCH2L.js → update-many-KGGEYABR.js} +22 -22
- package/dist/cli-bundle/chunks/{upgrade-2U727SAM.js → upgrade-BLI7XBAJ.js} +4 -4
- package/dist/cli-bundle/chunks/{upgrade-3W3RVSNM.js → upgrade-LXPOQKFV.js} +4 -4
- package/dist/cli-bundle/chunks/{validate-ZFVWPEEN.js → validate-AGOAUOVW.js} +15 -15
- package/dist/cli-bundle/chunks/{validate-GZ24NYHO.js → validate-L5J6A7YO.js} +15 -15
- package/dist/cli-bundle/main.js +42 -1451
- package/dist/cli-bundle/main.js.map +4 -4
- package/dist/core/history/history-diff.d.ts +47 -0
- package/dist/core/history/history-diff.js +152 -0
- package/dist/core/history/history-diff.js.map +1 -0
- package/dist/core/history/history-storage-stats.d.ts +31 -0
- package/dist/core/history/history-storage-stats.js +101 -0
- package/dist/core/history/history-storage-stats.js.map +1 -0
- package/dist/core/lock/lock-gc.d.ts +46 -0
- package/dist/core/lock/lock-gc.js +194 -0
- package/dist/core/lock/lock-gc.js.map +1 -0
- package/dist/core/shared/serial-queue.d.ts +12 -0
- package/dist/core/shared/serial-queue.js +43 -0
- package/dist/core/shared/serial-queue.js.map +1 -0
- package/dist/core/store/settings.d.ts +19 -1
- package/dist/core/store/settings.js +92 -7
- package/dist/core/store/settings.js.map +1 -1
- package/dist/core/telemetry/observability.js +3 -3
- package/dist/core/telemetry/observability.js.map +1 -1
- package/dist/core/telemetry/runtime.js +16 -4
- package/dist/core/telemetry/runtime.js.map +1 -1
- package/dist/mcp/server.d.ts +1 -0
- package/dist/mcp/server.js +155 -37
- package/dist/mcp/server.js.map +1 -1
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +2 -2
- package/dist/sdk/cli-contracts/enum-contracts.js +4 -2
- package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +10 -7
- package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
- package/dist/sdk/cli-contracts.d.ts +23 -0
- package/dist/sdk/cli-contracts.js +41 -7
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/docs/AGENT_GUIDE.md +1 -1
- package/docs/ARCHITECTURE.md +11 -1
- package/docs/CLAUDE_CODE_PLUGIN.md +2 -2
- package/docs/COMMANDS.md +33 -2
- package/docs/CONFIGURATION.md +9 -1
- package/docs/EXTENSIONS.md +7 -0
- package/docs/EXTENSION_AUTHOR_CONTRACTS.md +73 -0
- package/docs/ONBOARDING.md +165 -0
- package/docs/QUICKSTART.md +1 -1
- package/docs/README.md +12 -4
- package/docs/RELEASING.md +36 -1
- package/docs/TESTING.md +19 -1
- package/package.json +5 -2
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/README.md +7 -4
- package/plugins/pm-claude/agents/pm-coordinator.md +1 -1
- package/plugins/pm-claude/commands/pm-init.md +1 -1
- package/dist/cli-bundle/chunks/activity-P5BUMWP3.js +0 -16
- package/dist/cli-bundle/chunks/chunk-GNHVV4SY.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-V3JQ4IPL.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-WIKR7KFL.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-ZQ4F6EC4.js.map +0 -7
- package/dist/cli-bundle/chunks/close-RMHQ3KWH.js +0 -13
- package/dist/cli-bundle/chunks/contracts-CXSFM45B.js.map +0 -7
- package/dist/cli-bundle/chunks/create-ATONSAZW.js +0 -27
- package/dist/cli-bundle/chunks/gc-GT552UJH.js +0 -178
- package/dist/cli-bundle/chunks/gc-GT552UJH.js.map +0 -1
- package/dist/cli-bundle/chunks/gc-QNBRJG6H.js +0 -181
- package/dist/cli-bundle/chunks/gc-QNBRJG6H.js.map +0 -7
- package/dist/cli-bundle/chunks/health-5VPOJQ53.js.map +0 -1
- package/dist/cli-bundle/chunks/health-IT5DBPRJ.js.map +0 -7
- package/dist/cli-bundle/chunks/history-6FC4H6HI.js +0 -20
- package/dist/cli-bundle/chunks/history-redact-XKYEZDBL.js +0 -19
- package/dist/cli-bundle/chunks/init-KHX3FEEM.js +0 -16
- package/dist/cli-bundle/chunks/list-53LZ2AEO.js +0 -20
- package/dist/cli-bundle/chunks/register-operations-KYUOOOOD.js.map +0 -1
- package/dist/cli-bundle/chunks/restore-JL5QIH7H.js +0 -17
- package/dist/cli-bundle/chunks/stats-FNLYVXTB.js +0 -120
- package/dist/cli-bundle/chunks/stats-FNLYVXTB.js.map +0 -1
- package/dist/cli-bundle/chunks/stats-Y2CBTZSL.js +0 -123
- package/dist/cli-bundle/chunks/stats-Y2CBTZSL.js.map +0 -7
- package/dist/cli-bundle/chunks/update-6YEHPVXH.js +0 -25
- package/dist/cli-bundle/chunks/update-PYLVHMRD.js +0 -21
- /package/dist/cli-bundle/chunks/{activity-P5BUMWP3.js.map → activity-CVXTCHYY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{activity-3RWRRNOW.js.map → activity-JM6DTDND.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{aggregate-J35K7WZB.js.map → aggregate-GI7WSZPH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{aggregate-OOAGKWRG.js.map → aggregate-VNAHUNNF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-5JE3YGXU.js.map → append-7H5N64R2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-PNN6UIBZ.js.map → append-WMKRXKCE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-D5X7N6FI.js.map → chunk-23YFZ3IG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FVXM3GKS.js.map → chunk-2HVRUSQA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SZQCER6S.js.map → chunk-2VBQ6ZXS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-A6PEXMYN.js.map → chunk-2VVCGBNV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UOVLWB47.js.map → chunk-3BWOVLTH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5IRA6IYD.js.map → chunk-3FI4SEFT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3OH4DAEB.js.map → chunk-3LB74A67.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GFWHHMVV.js.map → chunk-3VAM3NNM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4QCR4QW3.js.map → chunk-4LL6TK5B.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TBQVUNVH.js.map → chunk-52MAOQ6J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5KB4X7YY.js.map → chunk-5FDATVEZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GCAVRLGE.js.map → chunk-6ER6DXH5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-26KTVXJW.js.map → chunk-6P6GGMOG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MISYRLEP.js.map → chunk-77GFDHGF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HPH6X4ZZ.js.map → chunk-AO442XLN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ORTLYVA4.js.map → chunk-AY43SBIN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-D3WUNETC.js.map → chunk-BQHUILZS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KCMIYKTA.js.map → chunk-E5FJNAZA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OIQIXTNB.js.map → chunk-ECCMVXGM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5PAOPUZX.js.map → chunk-FRAUKRU2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JQI2HE55.js.map → chunk-GCOQW437.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CWT53EYT.js.map → chunk-GGYWB3Y2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ATBVS6WW.js.map → chunk-GU2ZJ2VV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ASQM3IF5.js.map → chunk-GXSUPCBV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SSFMJCPF.js.map → chunk-HZGUAH22.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GPGAYASV.js.map → chunk-I2HSTRJF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RQAWLSUU.js.map → chunk-I6BNFU5X.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OUF3ARDX.js.map → chunk-IJGCZSIQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XX5LRINW.js.map → chunk-KAG77BY3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BNL6S7QH.js.map → chunk-KJ33AOCY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4PJQSECJ.js.map → chunk-KJE2FOS4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KBG47ZOY.js.map → chunk-LB3RUL2N.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HZOS2UG5.js.map → chunk-LCM63IXU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VGO2T3TY.js.map → chunk-ME2YH6FN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZRVSMOMR.js.map → chunk-MITFDD35.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Y2AKE2HS.js.map → chunk-N7ACFE26.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AXXKLVTW.js.map → chunk-NUZ5HKR4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KK6YPGH3.js.map → chunk-OVQCEJPG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-B3N4TKNL.js.map → chunk-OZ7NSQHL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TK633IVD.js.map → chunk-PDDFYW4X.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DFIZGAI5.js.map → chunk-PIU6RSL3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-O5IBJE6S.js.map → chunk-PO3GSVFV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-N5YF3VFN.js.map → chunk-Q7SPNHLW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RANZIID5.js.map → chunk-QO7EBBOM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LDJK7SHN.js.map → chunk-R6UFP2GE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CCUFLH4J.js.map → chunk-RWPSOIEE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UFCG3SWR.js.map → chunk-RZN6VURO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KA24HME7.js.map → chunk-T3LC5LKB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NQP3ECKF.js.map → chunk-TCD3R2PF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EHXPIKKP.js.map → chunk-TPH5XEVD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-T2ORWB6D.js.map → chunk-UBOPJT3S.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-S3CV7JGJ.js.map → chunk-UM2GBHS4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-G5BACLYH.js.map → chunk-W7XABV4H.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-K47WAYQV.js.map → chunk-WKY2IBOQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7K24QB23.js.map → chunk-WOPXVEZP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DFUSXJDE.js.map → chunk-WSMOSYRD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CJDQB2ED.js.map → chunk-XLTD2HN3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TQ3ZK6VD.js.map → chunk-XSJCLN2R.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XG7RJYHV.js.map → chunk-XTGLRY2Y.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JB4RGL4V.js.map → chunk-YL2DJGYS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-AZLP7YFO.js.map → claim-4DBF6RVG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-ZFA7HKU4.js.map → claim-X2P4IB7J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-RMHQ3KWH.js.map → close-3HDWDA3L.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-65DFYAVS.js.map → close-PTYFA45H.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-UKZSQGM7.js.map → close-many-7CGIDPTJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-AKPZNSGI.js.map → close-many-ERFO6LHR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-CJWXQI7X.js.map → comments-OONGABK5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-AGBNSJJH.js.map → comments-QKBYCWKD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{config-DDPYIA6J.js.map → config-6FXCQKIF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{config-5ON3ADRH.js.map → config-U4RZ4CQB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-E6U3DWVM.js.map → context-FYYJGFWS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-ZOJEN5VT.js.map → context-YMJ3Z2HQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-WYFKN2U4.js.map → create-I5L4EYYZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-ATONSAZW.js.map → create-JTZNCTQC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-ZXWC56WO.js.map → delete-7HPGI4GZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-RONNH4F4.js.map → delete-VXUPH5RS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-WII3O4HB.js.map → deps-JSRRWC3Z.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-EHXIFOZR.js.map → deps-SCZIFK2Z.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-PDREIMLS.js.map → docs-GJK6K4VP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-JMVCFNHH.js.map → docs-WW4N3MBM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-G6UXSM5S.js.map → extension-J7IBMFTD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-B4ROVWJD.js.map → extension-VDY2U33M.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-2PN7UM2D.js.map → files-ISZJGILQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-MXYS5W4M.js.map → files-WKOD326U.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{get-WXMLRG7M.js.map → get-RV37HT3G.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{get-CINFEUIY.js.map → get-WXU6WI5P.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-6FC4H6HI.js.map → history-2BA3T5AE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-FLZIP7PM.js.map → history-PKN67D5O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-XKYEZDBL.js.map → history-redact-JBZNXHGR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-SSZBAD76.js.map → history-redact-V4FOJGS7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-KC5ZOJRZ.js.map → history-repair-HIBCBIKK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-X7CO5JJZ.js.map → history-repair-SDMHR7JT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-KHX3FEEM.js.map → init-HIVSNX3O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-6MRFVOLH.js.map → init-P56QYWJF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-DCX55BNX.js.map → learnings-GDFRG5J7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-A3CLB5CO.js.map → learnings-MIXSESLK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-DBRECOG4.js.map → list-FGOWQMSM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-53LZ2AEO.js.map → list-MUSQNMTD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-42LIC3UE.js.map → notes-4XVSH2AZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-P5O3VMQ3.js.map → notes-5UK3GEH2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-IGTE3WOJ.js.map → plan-DUMBV3QB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-HDQXEUKD.js.map → plan-SLMODHWX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-mutation-M3YS6XDO.js.map → register-mutation-N5GSUZJV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-mutation-RSMT6DPK.js.map → register-mutation-OA675SOU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-setup-DI6P7X75.js.map → register-setup-JIMPKJKV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-setup-YJKIQRKA.js.map → register-setup-ZHJI2DI3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-JL5QIH7H.js.map → restore-D4RGNX33.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-2XVTBLKQ.js.map → restore-PBL6T5TW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-V6BX65Q2.js.map → schema-2NOO6NGB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-LVXZWFGY.js.map → schema-EBI4NLUO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-C7NPB7G7.js.map → search-JPUQTVCY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-5A3BMFA7.js.map → search-OA6JX27A.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-RJ4ZF35X.js.map → test-MXX3E5JL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-OFYONO3C.js.map → test-WBROAJIE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-all-OJE6CIO7.js.map → test-all-N6NSRDTV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-all-EEMKNTGU.js.map → test-all-NTOZ7C3M.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-IPOPFOAF.js.map → test-runs-V6A7LPWZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-L2M7WKH7.js.map → test-runs-WMVTQU3Y.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-6YEHPVXH.js.map → update-OSV3NAQB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-PYLVHMRD.js.map → update-YRXSUGYQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-DYWGW57M.js.map → update-many-EM6OXYGO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-322CCH2L.js.map → update-many-KGGEYABR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{upgrade-2U727SAM.js.map → upgrade-BLI7XBAJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{upgrade-3W3RVSNM.js.map → upgrade-LXPOQKFV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{validate-ZFVWPEEN.js.map → validate-AGOAUOVW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{validate-GZ24NYHO.js.map → validate-L5J6A7YO.js.map} +0 -0
|
@@ -11,37 +11,37 @@ import {
|
|
|
11
11
|
resolveEmbeddingProviders,
|
|
12
12
|
resolveSettingsWithSemanticRuntimeDefaults,
|
|
13
13
|
resolveVectorStores
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-3FI4SEFT.js";
|
|
15
15
|
import {
|
|
16
16
|
collectRuntimeFilterValues,
|
|
17
17
|
matchesRuntimeFilters,
|
|
18
18
|
parseStatusFilterCsv
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-I6BNFU5X.js";
|
|
20
20
|
import {
|
|
21
21
|
parseLimit,
|
|
22
22
|
parsePriority,
|
|
23
23
|
parseType
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-WKY2IBOQ.js";
|
|
25
25
|
import "./chunk-EAOG77HM.js";
|
|
26
26
|
import {
|
|
27
27
|
collectRegisteredItemFieldNames,
|
|
28
28
|
listAllDocumentCandidatesCached,
|
|
29
29
|
listAllFrontMatter,
|
|
30
30
|
toItemRecord
|
|
31
|
-
} from "./chunk-
|
|
32
|
-
import "./chunk-
|
|
31
|
+
} from "./chunk-XTGLRY2Y.js";
|
|
32
|
+
import "./chunk-T3LC5LKB.js";
|
|
33
33
|
import {
|
|
34
34
|
isTerminalStatus,
|
|
35
35
|
parseItemDocument
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-AO442XLN.js";
|
|
37
37
|
import {
|
|
38
38
|
resolveItemTypeRegistry
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-KJE2FOS4.js";
|
|
40
40
|
import {
|
|
41
41
|
compareTimestampStrings,
|
|
42
42
|
nowIso,
|
|
43
43
|
resolveIsoOrRelative
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-QO7EBBOM.js";
|
|
45
45
|
import {
|
|
46
46
|
EXIT_CODE,
|
|
47
47
|
PmCliError,
|
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
resolveRuntimeStatusRegistry,
|
|
58
58
|
runActiveOnReadHooks,
|
|
59
59
|
toNonEmptyStringOrUndefined
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-U5SXYXSY.js";
|
|
61
61
|
|
|
62
62
|
// dist/cli/commands/search.js
|
|
63
63
|
import fs from "node:fs/promises";
|
|
@@ -1141,4 +1141,4 @@ export {
|
|
|
1141
1141
|
resolveSearchTuning,
|
|
1142
1142
|
runSearch
|
|
1143
1143
|
};
|
|
1144
|
-
//# sourceMappingURL=search-
|
|
1144
|
+
//# sourceMappingURL=search-OA6JX27A.js.map
|
|
@@ -0,0 +1,202 @@
|
|
|
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]="39b4bc2e-0797-52cf-9728-a0d97705462f")}catch(e){}}();
|
|
3
|
+
import {
|
|
4
|
+
enforceHistoryStreamPolicyForItems,
|
|
5
|
+
listAllFrontMatterLight
|
|
6
|
+
} from "./chunk-GGYWB3Y2.js";
|
|
7
|
+
import "./chunk-HZGUAH22.js";
|
|
8
|
+
import "./chunk-LB3RUL2N.js";
|
|
9
|
+
import {
|
|
10
|
+
resolveItemTypeRegistry
|
|
11
|
+
} from "./chunk-2VBQ6ZXS.js";
|
|
12
|
+
import {
|
|
13
|
+
nowIso
|
|
14
|
+
} from "./chunk-TCD3R2PF.js";
|
|
15
|
+
import {
|
|
16
|
+
EXIT_CODE,
|
|
17
|
+
PmCliError,
|
|
18
|
+
getActiveExtensionRegistrations,
|
|
19
|
+
getSettingsPath,
|
|
20
|
+
pathExists,
|
|
21
|
+
readSettings,
|
|
22
|
+
resolvePmRoot,
|
|
23
|
+
resolveRuntimeStatusRegistry,
|
|
24
|
+
runActiveOnReadHooks
|
|
25
|
+
} from "./chunk-5SFCOO6B.js";
|
|
26
|
+
|
|
27
|
+
// dist/cli/commands/stats.js
|
|
28
|
+
import fs from "node:fs/promises";
|
|
29
|
+
import path from "node:path";
|
|
30
|
+
|
|
31
|
+
// dist/core/history/history-storage-stats.js
|
|
32
|
+
function parseStreamStat(id, raw) {
|
|
33
|
+
const bytes = Buffer.byteLength(raw, "utf8");
|
|
34
|
+
let lines = 0;
|
|
35
|
+
let oldestTs = null;
|
|
36
|
+
let newestTs = null;
|
|
37
|
+
let oldestMs = Number.POSITIVE_INFINITY;
|
|
38
|
+
let newestMs = Number.NEGATIVE_INFINITY;
|
|
39
|
+
for (const rawLine of raw.split(/\r?\n/)) {
|
|
40
|
+
const trimmed = rawLine.trim();
|
|
41
|
+
if (trimmed === "") {
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
lines += 1;
|
|
45
|
+
let parsed;
|
|
46
|
+
try {
|
|
47
|
+
parsed = JSON.parse(trimmed);
|
|
48
|
+
} catch {
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
if (parsed === null || typeof parsed !== "object" || !("ts" in parsed) || typeof parsed["ts"] !== "string") {
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
const ts = parsed["ts"];
|
|
55
|
+
const ms = Date.parse(ts);
|
|
56
|
+
if (Number.isNaN(ms)) {
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
if (ms < oldestMs || ms === oldestMs && oldestTs !== null && ts < oldestTs) {
|
|
60
|
+
oldestMs = ms;
|
|
61
|
+
oldestTs = ts;
|
|
62
|
+
}
|
|
63
|
+
if (ms > newestMs || ms === newestMs && newestTs !== null && ts > newestTs) {
|
|
64
|
+
newestMs = ms;
|
|
65
|
+
newestTs = ts;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return { id, bytes, lines, oldest_ts: oldestTs, newest_ts: newestTs };
|
|
69
|
+
}
|
|
70
|
+
function computeHistoryStorageStats(streams, options) {
|
|
71
|
+
const rawTopN = options?.topN ?? 5;
|
|
72
|
+
const topN = Math.max(0, Math.floor(rawTopN));
|
|
73
|
+
const stats = streams.map(({ id, raw }) => parseStreamStat(id, raw));
|
|
74
|
+
let totalLines = 0;
|
|
75
|
+
let totalBytes = 0;
|
|
76
|
+
let oldestEntry = null;
|
|
77
|
+
let newestEntry = null;
|
|
78
|
+
let globalOldestMs = Number.POSITIVE_INFINITY;
|
|
79
|
+
let globalNewestMs = Number.NEGATIVE_INFINITY;
|
|
80
|
+
for (const stat of stats) {
|
|
81
|
+
totalLines += stat.lines;
|
|
82
|
+
totalBytes += stat.bytes;
|
|
83
|
+
if (stat.oldest_ts !== null) {
|
|
84
|
+
const ms = Date.parse(stat.oldest_ts);
|
|
85
|
+
if (ms < globalOldestMs || ms === globalOldestMs && oldestEntry !== null && stat.id < oldestEntry.id) {
|
|
86
|
+
globalOldestMs = ms;
|
|
87
|
+
oldestEntry = { id: stat.id, ts: stat.oldest_ts };
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (stat.newest_ts !== null) {
|
|
91
|
+
const ms = Date.parse(stat.newest_ts);
|
|
92
|
+
if (ms > globalNewestMs || ms === globalNewestMs && newestEntry !== null && stat.id < newestEntry.id) {
|
|
93
|
+
globalNewestMs = ms;
|
|
94
|
+
newestEntry = { id: stat.id, ts: stat.newest_ts };
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
const largestByBytes = topN === 0 ? [] : [...stats].sort((a, b) => b.bytes - a.bytes || a.id.localeCompare(b.id)).slice(0, topN);
|
|
99
|
+
const deepestByLines = topN === 0 ? [] : [...stats].sort((a, b) => b.lines - a.lines || a.id.localeCompare(b.id)).slice(0, topN);
|
|
100
|
+
return {
|
|
101
|
+
total_streams: streams.length,
|
|
102
|
+
total_lines: totalLines,
|
|
103
|
+
total_bytes: totalBytes,
|
|
104
|
+
largest_by_bytes: largestByBytes,
|
|
105
|
+
deepest_by_lines: deepestByLines,
|
|
106
|
+
oldest_entry: oldestEntry,
|
|
107
|
+
newest_entry: newestEntry
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// dist/cli/commands/stats.js
|
|
112
|
+
function zeroByType(itemTypes) {
|
|
113
|
+
return itemTypes.reduce((acc, value) => {
|
|
114
|
+
acc[value] = 0;
|
|
115
|
+
return acc;
|
|
116
|
+
}, {});
|
|
117
|
+
}
|
|
118
|
+
function zeroByStatus(statuses) {
|
|
119
|
+
return statuses.reduce((acc, value) => {
|
|
120
|
+
acc[value] = 0;
|
|
121
|
+
return acc;
|
|
122
|
+
}, {});
|
|
123
|
+
}
|
|
124
|
+
function countNonEmptyLines(raw) {
|
|
125
|
+
if (raw.trim().length === 0) {
|
|
126
|
+
return 0;
|
|
127
|
+
}
|
|
128
|
+
return raw.split(/\r?\n/u).filter((line) => line.trim().length > 0).length;
|
|
129
|
+
}
|
|
130
|
+
async function readHistoryStreamContents(pmRoot) {
|
|
131
|
+
const historyDir = path.join(pmRoot, "history");
|
|
132
|
+
if (!await pathExists(historyDir)) {
|
|
133
|
+
return [];
|
|
134
|
+
}
|
|
135
|
+
await runActiveOnReadHooks({
|
|
136
|
+
path: historyDir,
|
|
137
|
+
scope: "project"
|
|
138
|
+
});
|
|
139
|
+
const historyFiles = (await fs.readdir(historyDir)).filter((entry) => entry.endsWith(".jsonl")).sort((a, b) => a.localeCompare(b));
|
|
140
|
+
const streams = [];
|
|
141
|
+
for (const file of historyFiles) {
|
|
142
|
+
const historyPath = path.join(historyDir, file);
|
|
143
|
+
const raw = await fs.readFile(historyPath, "utf8");
|
|
144
|
+
await runActiveOnReadHooks({
|
|
145
|
+
path: historyPath,
|
|
146
|
+
scope: "project"
|
|
147
|
+
});
|
|
148
|
+
streams.push({ id: file.slice(0, -".jsonl".length), raw });
|
|
149
|
+
}
|
|
150
|
+
return streams;
|
|
151
|
+
}
|
|
152
|
+
async function runStats(global, options = {}) {
|
|
153
|
+
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
154
|
+
if (!await pathExists(getSettingsPath(pmRoot))) {
|
|
155
|
+
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
156
|
+
}
|
|
157
|
+
const settings = await readSettings(pmRoot);
|
|
158
|
+
const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
|
|
159
|
+
const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);
|
|
160
|
+
const items = await listAllFrontMatterLight(pmRoot, settings.item_format, typeRegistry.type_to_folder, void 0, settings.schema);
|
|
161
|
+
await enforceHistoryStreamPolicyForItems({
|
|
162
|
+
pmRoot,
|
|
163
|
+
settings,
|
|
164
|
+
itemIds: items.map((item) => item.id),
|
|
165
|
+
commandLabel: "stats"
|
|
166
|
+
});
|
|
167
|
+
const byType = zeroByType(typeRegistry.types);
|
|
168
|
+
const byStatus = zeroByStatus(statusRegistry.definitions.map((definition) => definition.id));
|
|
169
|
+
for (const item of items) {
|
|
170
|
+
if (byType[item.type] === void 0) {
|
|
171
|
+
byType[item.type] = 0;
|
|
172
|
+
}
|
|
173
|
+
byType[item.type] += 1;
|
|
174
|
+
if (byStatus[item.status] === void 0) {
|
|
175
|
+
byStatus[item.status] = 0;
|
|
176
|
+
}
|
|
177
|
+
byStatus[item.status] += 1;
|
|
178
|
+
}
|
|
179
|
+
const streams = await readHistoryStreamContents(pmRoot);
|
|
180
|
+
let historyEntries = 0;
|
|
181
|
+
for (const stream of streams) {
|
|
182
|
+
historyEntries += countNonEmptyLines(stream.raw);
|
|
183
|
+
}
|
|
184
|
+
const storage = options.storage ? computeHistoryStorageStats(streams) : void 0;
|
|
185
|
+
return {
|
|
186
|
+
totals: {
|
|
187
|
+
items: items.length,
|
|
188
|
+
history_streams: streams.length,
|
|
189
|
+
history_entries: historyEntries
|
|
190
|
+
},
|
|
191
|
+
by_type: byType,
|
|
192
|
+
by_status: byStatus,
|
|
193
|
+
...storage ? { storage } : {},
|
|
194
|
+
generated_at: nowIso()
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
export {
|
|
198
|
+
runStats
|
|
199
|
+
};
|
|
200
|
+
//# sourceMappingURL=stats-CV54BAWY.js.map
|
|
201
|
+
|
|
202
|
+
//# debugId=39b4bc2e-0797-52cf-9728-a0d97705462f
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../cli/commands/stats.ts","../../../../../../../../core/history/history-storage-stats.ts"],"sourcesContent":["import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { getActiveExtensionRegistrations, runActiveOnReadHooks } from \"../../core/extensions/index.js\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { enforceHistoryStreamPolicyForItems } from \"../../core/history/history-stream-policy.js\";\nimport { computeHistoryStorageStats, type HistoryStorageStats } from \"../../core/history/history-storage-stats.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { resolveRuntimeStatusRegistry } from \"../../core/schema/runtime-schema.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 { listAllFrontMatterLight } from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport type { ItemStatus, ItemType } from \"../../types/index.js\";\n\nexport interface StatsCommandOptions {\n /** Include aggregate per-stream history storage metrics (sizes, depth, oldest/newest). */\n storage?: boolean;\n}\n\nexport interface StatsResult {\n totals: {\n items: number;\n history_streams: number;\n history_entries: number;\n };\n by_type: Record<ItemType, number>;\n by_status: Record<ItemStatus, number>;\n /** Present only with --storage: aggregate history-stream metrics for compaction/planning. */\n storage?: HistoryStorageStats;\n generated_at: string;\n}\n\nfunction zeroByType(itemTypes: string[]): Record<ItemType, number> {\n return itemTypes.reduce(\n (acc, value) => {\n acc[value] = 0;\n return acc;\n },\n {} as Record<ItemType, number>,\n );\n}\n\nfunction zeroByStatus(statuses: string[]): Record<ItemStatus, number> {\n return statuses.reduce(\n (acc, value) => {\n acc[value] = 0;\n return acc;\n },\n {} as Record<ItemStatus, number>,\n );\n}\n\nfunction countNonEmptyLines(raw: string): number {\n if (raw.trim().length === 0) {\n return 0;\n }\n return raw\n .split(/\\r?\\n/u)\n .filter((line) => line.trim().length > 0)\n .length;\n}\n\nasync function readHistoryStreamContents(pmRoot: string): Promise<Array<{ id: string; raw: string }>> {\n const historyDir = path.join(pmRoot, \"history\");\n if (!(await pathExists(historyDir))) {\n return [];\n }\n\n await runActiveOnReadHooks({\n path: historyDir,\n scope: \"project\",\n });\n const historyFiles = (await fs.readdir(historyDir))\n .filter((entry) => entry.endsWith(\".jsonl\"))\n .sort((a, b) => a.localeCompare(b));\n\n const streams: Array<{ id: string; raw: string }> = [];\n for (const file of historyFiles) {\n const historyPath = path.join(historyDir, file);\n const raw = await fs.readFile(historyPath, \"utf8\");\n await runActiveOnReadHooks({\n path: historyPath,\n scope: \"project\",\n });\n streams.push({ id: file.slice(0, -\".jsonl\".length), raw });\n }\n\n return streams;\n}\n\nexport async function runStats(global: GlobalOptions, options: StatsCommandOptions = {}): Promise<StatsResult> {\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 const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const items = await listAllFrontMatterLight(pmRoot, settings.item_format, typeRegistry.type_to_folder, undefined, settings.schema);\n await enforceHistoryStreamPolicyForItems({\n pmRoot,\n settings,\n itemIds: items.map((item) => item.id),\n commandLabel: \"stats\",\n });\n\n const byType = zeroByType(typeRegistry.types);\n const byStatus = zeroByStatus(statusRegistry.definitions.map((definition) => definition.id));\n for (const item of items) {\n if (byType[item.type] === undefined) {\n byType[item.type] = 0;\n }\n byType[item.type] += 1;\n if (byStatus[item.status] === undefined) {\n byStatus[item.status] = 0;\n }\n byStatus[item.status] += 1;\n }\n\n const streams = await readHistoryStreamContents(pmRoot);\n let historyEntries = 0;\n for (const stream of streams) {\n historyEntries += countNonEmptyLines(stream.raw);\n }\n const storage = options.storage ? computeHistoryStorageStats(streams) : undefined;\n\n return {\n totals: {\n items: items.length,\n history_streams: streams.length,\n history_entries: historyEntries,\n },\n by_type: byType,\n by_status: byStatus,\n ...(storage ? { storage } : {}),\n generated_at: nowIso(),\n };\n}\n","/**\n * Pure aggregate metrics for history streams (JSONL files).\n * No filesystem access — callers read raw stream contents and pass them in.\n * This module has no Node imports; Buffer is available as a global.\n */\n\nexport interface HistoryStreamStat {\n id: string;\n bytes: number;\n lines: number; // non-empty JSONL entry count\n oldest_ts: string | null; // min parseable ts in this stream, else null\n newest_ts: string | null; // max parseable ts in this stream, else null\n}\n\nexport interface HistoryStorageEntryRef {\n id: string;\n ts: string;\n}\n\nexport interface HistoryStorageStats {\n total_streams: number;\n total_lines: number;\n total_bytes: number;\n largest_by_bytes: HistoryStreamStat[]; // top-N desc by bytes, tie-break id asc\n deepest_by_lines: HistoryStreamStat[]; // top-N desc by lines, tie-break id asc\n oldest_entry: HistoryStorageEntryRef | null; // global min ts across all streams\n newest_entry: HistoryStorageEntryRef | null; // global max ts across all streams\n}\n\nfunction parseStreamStat(id: string, raw: string): HistoryStreamStat {\n const bytes = Buffer.byteLength(raw, \"utf8\");\n\n let lines = 0;\n let oldestTs: string | null = null;\n let newestTs: string | null = null;\n let oldestMs = Number.POSITIVE_INFINITY;\n let newestMs = Number.NEGATIVE_INFINITY;\n\n for (const rawLine of raw.split(/\\r?\\n/)) {\n const trimmed = rawLine.trim();\n if (trimmed === \"\") {\n continue;\n }\n lines += 1;\n\n let parsed: unknown;\n try {\n parsed = JSON.parse(trimmed);\n } catch {\n continue;\n }\n\n if (\n parsed === null ||\n typeof parsed !== \"object\" ||\n !(\"ts\" in (parsed as object)) ||\n typeof (parsed as Record<string, unknown>)[\"ts\"] !== \"string\"\n ) {\n continue;\n }\n\n const ts = (parsed as Record<string, unknown>)[\"ts\"] as string;\n const ms = Date.parse(ts);\n if (Number.isNaN(ms)) {\n continue;\n }\n\n if (ms < oldestMs || (ms === oldestMs && oldestTs !== null && ts < oldestTs)) {\n oldestMs = ms;\n oldestTs = ts;\n }\n if (ms > newestMs || (ms === newestMs && newestTs !== null && ts > newestTs)) {\n newestMs = ms;\n newestTs = ts;\n }\n }\n\n return { id, bytes, lines, oldest_ts: oldestTs, newest_ts: newestTs };\n}\n\nexport function computeHistoryStorageStats(\n streams: Array<{ id: string; raw: string }>,\n options?: { topN?: number },\n): HistoryStorageStats {\n const rawTopN = options?.topN ?? 5;\n const topN = Math.max(0, Math.floor(rawTopN));\n\n const stats: HistoryStreamStat[] = streams.map(({ id, raw }) => parseStreamStat(id, raw));\n\n let totalLines = 0;\n let totalBytes = 0;\n let oldestEntry: HistoryStorageEntryRef | null = null;\n let newestEntry: HistoryStorageEntryRef | null = null;\n let globalOldestMs = Number.POSITIVE_INFINITY;\n let globalNewestMs = Number.NEGATIVE_INFINITY;\n\n for (const stat of stats) {\n totalLines += stat.lines;\n totalBytes += stat.bytes;\n\n if (stat.oldest_ts !== null) {\n const ms = Date.parse(stat.oldest_ts);\n if (\n ms < globalOldestMs ||\n (ms === globalOldestMs && oldestEntry !== null && stat.id < oldestEntry.id)\n ) {\n globalOldestMs = ms;\n oldestEntry = { id: stat.id, ts: stat.oldest_ts };\n }\n }\n\n if (stat.newest_ts !== null) {\n const ms = Date.parse(stat.newest_ts);\n if (\n ms > globalNewestMs ||\n (ms === globalNewestMs && newestEntry !== null && stat.id < newestEntry.id)\n ) {\n globalNewestMs = ms;\n newestEntry = { id: stat.id, ts: stat.newest_ts };\n }\n }\n }\n\n const largestByBytes =\n topN === 0\n ? []\n : [...stats]\n .sort((a, b) => b.bytes - a.bytes || a.id.localeCompare(b.id))\n .slice(0, topN);\n\n const deepestByLines =\n topN === 0\n ? []\n : [...stats]\n .sort((a, b) => b.lines - a.lines || a.id.localeCompare(b.id))\n .slice(0, topN);\n\n return {\n total_streams: streams.length,\n total_lines: totalLines,\n total_bytes: totalBytes,\n largest_by_bytes: largestByBytes,\n deepest_by_lines: deepestByLines,\n oldest_entry: oldestEntry,\n newest_entry: newestEntry,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;;;AC4BjB,SAAS,gBAAgB,IAAY,KAAW;AAC9C,QAAM,QAAQ,OAAO,WAAW,KAAK,MAAM;AAE3C,MAAI,QAAQ;AACZ,MAAI,WAA0B;AAC9B,MAAI,WAA0B;AAC9B,MAAI,WAAW,OAAO;AACtB,MAAI,WAAW,OAAO;AAEtB,aAAW,WAAW,IAAI,MAAM,OAAO,GAAG;AACxC,UAAM,UAAU,QAAQ,KAAI;AAC5B,QAAI,YAAY,IAAI;AAClB;IACF;AACA,aAAS;AAET,QAAI;AACJ,QAAI;AACF,eAAS,KAAK,MAAM,OAAO;IAC7B,QAAQ;AACN;IACF;AAEA,QACE,WAAW,QACX,OAAO,WAAW,YAClB,EAAE,QAAS,WACX,OAAQ,OAAmC,IAAI,MAAM,UACrD;AACA;IACF;AAEA,UAAM,KAAM,OAAmC,IAAI;AACnD,UAAM,KAAK,KAAK,MAAM,EAAE;AACxB,QAAI,OAAO,MAAM,EAAE,GAAG;AACpB;IACF;AAEA,QAAI,KAAK,YAAa,OAAO,YAAY,aAAa,QAAQ,KAAK,UAAW;AAC5E,iBAAW;AACX,iBAAW;IACb;AACA,QAAI,KAAK,YAAa,OAAO,YAAY,aAAa,QAAQ,KAAK,UAAW;AAC5E,iBAAW;AACX,iBAAW;IACb;EACF;AAEA,SAAO,EAAE,IAAI,OAAO,OAAO,WAAW,UAAU,WAAW,SAAQ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@@ -0,0 +1,212 @@
|
|
|
1
|
+
import {
|
|
2
|
+
enforceHistoryStreamPolicyForItems,
|
|
3
|
+
listAllFrontMatterLight
|
|
4
|
+
} from "./chunk-XTGLRY2Y.js";
|
|
5
|
+
import "./chunk-T3LC5LKB.js";
|
|
6
|
+
import "./chunk-AO442XLN.js";
|
|
7
|
+
import {
|
|
8
|
+
resolveItemTypeRegistry
|
|
9
|
+
} from "./chunk-KJE2FOS4.js";
|
|
10
|
+
import {
|
|
11
|
+
nowIso
|
|
12
|
+
} from "./chunk-QO7EBBOM.js";
|
|
13
|
+
import {
|
|
14
|
+
EXIT_CODE,
|
|
15
|
+
PmCliError,
|
|
16
|
+
getActiveExtensionRegistrations,
|
|
17
|
+
getSettingsPath,
|
|
18
|
+
pathExists,
|
|
19
|
+
readSettings,
|
|
20
|
+
resolvePmRoot,
|
|
21
|
+
resolveRuntimeStatusRegistry,
|
|
22
|
+
runActiveOnReadHooks
|
|
23
|
+
} from "./chunk-U5SXYXSY.js";
|
|
24
|
+
|
|
25
|
+
// dist/cli/commands/stats.js
|
|
26
|
+
import fs from "node:fs/promises";
|
|
27
|
+
import path from "node:path";
|
|
28
|
+
|
|
29
|
+
// dist/core/history/history-storage-stats.js
|
|
30
|
+
!(function() {
|
|
31
|
+
try {
|
|
32
|
+
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
33
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "006b5d42-0ff6-57af-a598-4ca069ec316e");
|
|
34
|
+
} catch (e2) {
|
|
35
|
+
}
|
|
36
|
+
})();
|
|
37
|
+
function parseStreamStat(id, raw) {
|
|
38
|
+
const bytes = Buffer.byteLength(raw, "utf8");
|
|
39
|
+
let lines = 0;
|
|
40
|
+
let oldestTs = null;
|
|
41
|
+
let newestTs = null;
|
|
42
|
+
let oldestMs = Number.POSITIVE_INFINITY;
|
|
43
|
+
let newestMs = Number.NEGATIVE_INFINITY;
|
|
44
|
+
for (const rawLine of raw.split(/\r?\n/)) {
|
|
45
|
+
const trimmed = rawLine.trim();
|
|
46
|
+
if (trimmed === "") {
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
lines += 1;
|
|
50
|
+
let parsed;
|
|
51
|
+
try {
|
|
52
|
+
parsed = JSON.parse(trimmed);
|
|
53
|
+
} catch {
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
if (parsed === null || typeof parsed !== "object" || !("ts" in parsed) || typeof parsed["ts"] !== "string") {
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
const ts = parsed["ts"];
|
|
60
|
+
const ms = Date.parse(ts);
|
|
61
|
+
if (Number.isNaN(ms)) {
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
if (ms < oldestMs || ms === oldestMs && oldestTs !== null && ts < oldestTs) {
|
|
65
|
+
oldestMs = ms;
|
|
66
|
+
oldestTs = ts;
|
|
67
|
+
}
|
|
68
|
+
if (ms > newestMs || ms === newestMs && newestTs !== null && ts > newestTs) {
|
|
69
|
+
newestMs = ms;
|
|
70
|
+
newestTs = ts;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return { id, bytes, lines, oldest_ts: oldestTs, newest_ts: newestTs };
|
|
74
|
+
}
|
|
75
|
+
function computeHistoryStorageStats(streams, options) {
|
|
76
|
+
const rawTopN = options?.topN ?? 5;
|
|
77
|
+
const topN = Math.max(0, Math.floor(rawTopN));
|
|
78
|
+
const stats = streams.map(({ id, raw }) => parseStreamStat(id, raw));
|
|
79
|
+
let totalLines = 0;
|
|
80
|
+
let totalBytes = 0;
|
|
81
|
+
let oldestEntry = null;
|
|
82
|
+
let newestEntry = null;
|
|
83
|
+
let globalOldestMs = Number.POSITIVE_INFINITY;
|
|
84
|
+
let globalNewestMs = Number.NEGATIVE_INFINITY;
|
|
85
|
+
for (const stat of stats) {
|
|
86
|
+
totalLines += stat.lines;
|
|
87
|
+
totalBytes += stat.bytes;
|
|
88
|
+
if (stat.oldest_ts !== null) {
|
|
89
|
+
const ms = Date.parse(stat.oldest_ts);
|
|
90
|
+
if (ms < globalOldestMs || ms === globalOldestMs && oldestEntry !== null && stat.id < oldestEntry.id) {
|
|
91
|
+
globalOldestMs = ms;
|
|
92
|
+
oldestEntry = { id: stat.id, ts: stat.oldest_ts };
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
if (stat.newest_ts !== null) {
|
|
96
|
+
const ms = Date.parse(stat.newest_ts);
|
|
97
|
+
if (ms > globalNewestMs || ms === globalNewestMs && newestEntry !== null && stat.id < newestEntry.id) {
|
|
98
|
+
globalNewestMs = ms;
|
|
99
|
+
newestEntry = { id: stat.id, ts: stat.newest_ts };
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
const largestByBytes = topN === 0 ? [] : [...stats].sort((a, b) => b.bytes - a.bytes || a.id.localeCompare(b.id)).slice(0, topN);
|
|
104
|
+
const deepestByLines = topN === 0 ? [] : [...stats].sort((a, b) => b.lines - a.lines || a.id.localeCompare(b.id)).slice(0, topN);
|
|
105
|
+
return {
|
|
106
|
+
total_streams: streams.length,
|
|
107
|
+
total_lines: totalLines,
|
|
108
|
+
total_bytes: totalBytes,
|
|
109
|
+
largest_by_bytes: largestByBytes,
|
|
110
|
+
deepest_by_lines: deepestByLines,
|
|
111
|
+
oldest_entry: oldestEntry,
|
|
112
|
+
newest_entry: newestEntry
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// dist/cli/commands/stats.js
|
|
117
|
+
!(function() {
|
|
118
|
+
try {
|
|
119
|
+
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
120
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "02809425-3f94-5445-91ea-bdc968f9f64b");
|
|
121
|
+
} catch (e2) {
|
|
122
|
+
}
|
|
123
|
+
})();
|
|
124
|
+
function zeroByType(itemTypes) {
|
|
125
|
+
return itemTypes.reduce((acc, value) => {
|
|
126
|
+
acc[value] = 0;
|
|
127
|
+
return acc;
|
|
128
|
+
}, {});
|
|
129
|
+
}
|
|
130
|
+
function zeroByStatus(statuses) {
|
|
131
|
+
return statuses.reduce((acc, value) => {
|
|
132
|
+
acc[value] = 0;
|
|
133
|
+
return acc;
|
|
134
|
+
}, {});
|
|
135
|
+
}
|
|
136
|
+
function countNonEmptyLines(raw) {
|
|
137
|
+
if (raw.trim().length === 0) {
|
|
138
|
+
return 0;
|
|
139
|
+
}
|
|
140
|
+
return raw.split(/\r?\n/u).filter((line) => line.trim().length > 0).length;
|
|
141
|
+
}
|
|
142
|
+
async function readHistoryStreamContents(pmRoot) {
|
|
143
|
+
const historyDir = path.join(pmRoot, "history");
|
|
144
|
+
if (!await pathExists(historyDir)) {
|
|
145
|
+
return [];
|
|
146
|
+
}
|
|
147
|
+
await runActiveOnReadHooks({
|
|
148
|
+
path: historyDir,
|
|
149
|
+
scope: "project"
|
|
150
|
+
});
|
|
151
|
+
const historyFiles = (await fs.readdir(historyDir)).filter((entry) => entry.endsWith(".jsonl")).sort((a, b) => a.localeCompare(b));
|
|
152
|
+
const streams = [];
|
|
153
|
+
for (const file of historyFiles) {
|
|
154
|
+
const historyPath = path.join(historyDir, file);
|
|
155
|
+
const raw = await fs.readFile(historyPath, "utf8");
|
|
156
|
+
await runActiveOnReadHooks({
|
|
157
|
+
path: historyPath,
|
|
158
|
+
scope: "project"
|
|
159
|
+
});
|
|
160
|
+
streams.push({ id: file.slice(0, -".jsonl".length), raw });
|
|
161
|
+
}
|
|
162
|
+
return streams;
|
|
163
|
+
}
|
|
164
|
+
async function runStats(global2, options = {}) {
|
|
165
|
+
const pmRoot = resolvePmRoot(process.cwd(), global2.path);
|
|
166
|
+
if (!await pathExists(getSettingsPath(pmRoot))) {
|
|
167
|
+
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
168
|
+
}
|
|
169
|
+
const settings = await readSettings(pmRoot);
|
|
170
|
+
const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
|
|
171
|
+
const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);
|
|
172
|
+
const items = await listAllFrontMatterLight(pmRoot, settings.item_format, typeRegistry.type_to_folder, void 0, settings.schema);
|
|
173
|
+
await enforceHistoryStreamPolicyForItems({
|
|
174
|
+
pmRoot,
|
|
175
|
+
settings,
|
|
176
|
+
itemIds: items.map((item) => item.id),
|
|
177
|
+
commandLabel: "stats"
|
|
178
|
+
});
|
|
179
|
+
const byType = zeroByType(typeRegistry.types);
|
|
180
|
+
const byStatus = zeroByStatus(statusRegistry.definitions.map((definition) => definition.id));
|
|
181
|
+
for (const item of items) {
|
|
182
|
+
if (byType[item.type] === void 0) {
|
|
183
|
+
byType[item.type] = 0;
|
|
184
|
+
}
|
|
185
|
+
byType[item.type] += 1;
|
|
186
|
+
if (byStatus[item.status] === void 0) {
|
|
187
|
+
byStatus[item.status] = 0;
|
|
188
|
+
}
|
|
189
|
+
byStatus[item.status] += 1;
|
|
190
|
+
}
|
|
191
|
+
const streams = await readHistoryStreamContents(pmRoot);
|
|
192
|
+
let historyEntries = 0;
|
|
193
|
+
for (const stream of streams) {
|
|
194
|
+
historyEntries += countNonEmptyLines(stream.raw);
|
|
195
|
+
}
|
|
196
|
+
const storage = options.storage ? computeHistoryStorageStats(streams) : void 0;
|
|
197
|
+
return {
|
|
198
|
+
totals: {
|
|
199
|
+
items: items.length,
|
|
200
|
+
history_streams: streams.length,
|
|
201
|
+
history_entries: historyEntries
|
|
202
|
+
},
|
|
203
|
+
by_type: byType,
|
|
204
|
+
by_status: byStatus,
|
|
205
|
+
...storage ? { storage } : {},
|
|
206
|
+
generated_at: nowIso()
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
export {
|
|
210
|
+
runStats
|
|
211
|
+
};
|
|
212
|
+
//# sourceMappingURL=stats-XYB6KTFG.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../../cli/commands/stats.ts", "../../../../../../../../core/history/history-storage-stats.ts"],
|
|
4
|
+
"sourcesContent": ["import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { getActiveExtensionRegistrations, runActiveOnReadHooks } from \"../../core/extensions/index.js\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { enforceHistoryStreamPolicyForItems } from \"../../core/history/history-stream-policy.js\";\nimport { computeHistoryStorageStats, type HistoryStorageStats } from \"../../core/history/history-storage-stats.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { resolveRuntimeStatusRegistry } from \"../../core/schema/runtime-schema.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 { listAllFrontMatterLight } from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport type { ItemStatus, ItemType } from \"../../types/index.js\";\n\nexport interface StatsCommandOptions {\n /** Include aggregate per-stream history storage metrics (sizes, depth, oldest/newest). */\n storage?: boolean;\n}\n\nexport interface StatsResult {\n totals: {\n items: number;\n history_streams: number;\n history_entries: number;\n };\n by_type: Record<ItemType, number>;\n by_status: Record<ItemStatus, number>;\n /** Present only with --storage: aggregate history-stream metrics for compaction/planning. */\n storage?: HistoryStorageStats;\n generated_at: string;\n}\n\nfunction zeroByType(itemTypes: string[]): Record<ItemType, number> {\n return itemTypes.reduce(\n (acc, value) => {\n acc[value] = 0;\n return acc;\n },\n {} as Record<ItemType, number>,\n );\n}\n\nfunction zeroByStatus(statuses: string[]): Record<ItemStatus, number> {\n return statuses.reduce(\n (acc, value) => {\n acc[value] = 0;\n return acc;\n },\n {} as Record<ItemStatus, number>,\n );\n}\n\nfunction countNonEmptyLines(raw: string): number {\n if (raw.trim().length === 0) {\n return 0;\n }\n return raw\n .split(/\\r?\\n/u)\n .filter((line) => line.trim().length > 0)\n .length;\n}\n\nasync function readHistoryStreamContents(pmRoot: string): Promise<Array<{ id: string; raw: string }>> {\n const historyDir = path.join(pmRoot, \"history\");\n if (!(await pathExists(historyDir))) {\n return [];\n }\n\n await runActiveOnReadHooks({\n path: historyDir,\n scope: \"project\",\n });\n const historyFiles = (await fs.readdir(historyDir))\n .filter((entry) => entry.endsWith(\".jsonl\"))\n .sort((a, b) => a.localeCompare(b));\n\n const streams: Array<{ id: string; raw: string }> = [];\n for (const file of historyFiles) {\n const historyPath = path.join(historyDir, file);\n const raw = await fs.readFile(historyPath, \"utf8\");\n await runActiveOnReadHooks({\n path: historyPath,\n scope: \"project\",\n });\n streams.push({ id: file.slice(0, -\".jsonl\".length), raw });\n }\n\n return streams;\n}\n\nexport async function runStats(global: GlobalOptions, options: StatsCommandOptions = {}): Promise<StatsResult> {\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 const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const items = await listAllFrontMatterLight(pmRoot, settings.item_format, typeRegistry.type_to_folder, undefined, settings.schema);\n await enforceHistoryStreamPolicyForItems({\n pmRoot,\n settings,\n itemIds: items.map((item) => item.id),\n commandLabel: \"stats\",\n });\n\n const byType = zeroByType(typeRegistry.types);\n const byStatus = zeroByStatus(statusRegistry.definitions.map((definition) => definition.id));\n for (const item of items) {\n if (byType[item.type] === undefined) {\n byType[item.type] = 0;\n }\n byType[item.type] += 1;\n if (byStatus[item.status] === undefined) {\n byStatus[item.status] = 0;\n }\n byStatus[item.status] += 1;\n }\n\n const streams = await readHistoryStreamContents(pmRoot);\n let historyEntries = 0;\n for (const stream of streams) {\n historyEntries += countNonEmptyLines(stream.raw);\n }\n const storage = options.storage ? computeHistoryStorageStats(streams) : undefined;\n\n return {\n totals: {\n items: items.length,\n history_streams: streams.length,\n history_entries: historyEntries,\n },\n by_type: byType,\n by_status: byStatus,\n ...(storage ? { storage } : {}),\n generated_at: nowIso(),\n };\n}\n", "/**\n * Pure aggregate metrics for history streams (JSONL files).\n * No filesystem access — callers read raw stream contents and pass them in.\n * This module has no Node imports; Buffer is available as a global.\n */\n\nexport interface HistoryStreamStat {\n id: string;\n bytes: number;\n lines: number; // non-empty JSONL entry count\n oldest_ts: string | null; // min parseable ts in this stream, else null\n newest_ts: string | null; // max parseable ts in this stream, else null\n}\n\nexport interface HistoryStorageEntryRef {\n id: string;\n ts: string;\n}\n\nexport interface HistoryStorageStats {\n total_streams: number;\n total_lines: number;\n total_bytes: number;\n largest_by_bytes: HistoryStreamStat[]; // top-N desc by bytes, tie-break id asc\n deepest_by_lines: HistoryStreamStat[]; // top-N desc by lines, tie-break id asc\n oldest_entry: HistoryStorageEntryRef | null; // global min ts across all streams\n newest_entry: HistoryStorageEntryRef | null; // global max ts across all streams\n}\n\nfunction parseStreamStat(id: string, raw: string): HistoryStreamStat {\n const bytes = Buffer.byteLength(raw, \"utf8\");\n\n let lines = 0;\n let oldestTs: string | null = null;\n let newestTs: string | null = null;\n let oldestMs = Number.POSITIVE_INFINITY;\n let newestMs = Number.NEGATIVE_INFINITY;\n\n for (const rawLine of raw.split(/\\r?\\n/)) {\n const trimmed = rawLine.trim();\n if (trimmed === \"\") {\n continue;\n }\n lines += 1;\n\n let parsed: unknown;\n try {\n parsed = JSON.parse(trimmed);\n } catch {\n continue;\n }\n\n if (\n parsed === null ||\n typeof parsed !== \"object\" ||\n !(\"ts\" in (parsed as object)) ||\n typeof (parsed as Record<string, unknown>)[\"ts\"] !== \"string\"\n ) {\n continue;\n }\n\n const ts = (parsed as Record<string, unknown>)[\"ts\"] as string;\n const ms = Date.parse(ts);\n if (Number.isNaN(ms)) {\n continue;\n }\n\n if (ms < oldestMs || (ms === oldestMs && oldestTs !== null && ts < oldestTs)) {\n oldestMs = ms;\n oldestTs = ts;\n }\n if (ms > newestMs || (ms === newestMs && newestTs !== null && ts > newestTs)) {\n newestMs = ms;\n newestTs = ts;\n }\n }\n\n return { id, bytes, lines, oldest_ts: oldestTs, newest_ts: newestTs };\n}\n\nexport function computeHistoryStorageStats(\n streams: Array<{ id: string; raw: string }>,\n options?: { topN?: number },\n): HistoryStorageStats {\n const rawTopN = options?.topN ?? 5;\n const topN = Math.max(0, Math.floor(rawTopN));\n\n const stats: HistoryStreamStat[] = streams.map(({ id, raw }) => parseStreamStat(id, raw));\n\n let totalLines = 0;\n let totalBytes = 0;\n let oldestEntry: HistoryStorageEntryRef | null = null;\n let newestEntry: HistoryStorageEntryRef | null = null;\n let globalOldestMs = Number.POSITIVE_INFINITY;\n let globalNewestMs = Number.NEGATIVE_INFINITY;\n\n for (const stat of stats) {\n totalLines += stat.lines;\n totalBytes += stat.bytes;\n\n if (stat.oldest_ts !== null) {\n const ms = Date.parse(stat.oldest_ts);\n if (\n ms < globalOldestMs ||\n (ms === globalOldestMs && oldestEntry !== null && stat.id < oldestEntry.id)\n ) {\n globalOldestMs = ms;\n oldestEntry = { id: stat.id, ts: stat.oldest_ts };\n }\n }\n\n if (stat.newest_ts !== null) {\n const ms = Date.parse(stat.newest_ts);\n if (\n ms > globalNewestMs ||\n (ms === globalNewestMs && newestEntry !== null && stat.id < newestEntry.id)\n ) {\n globalNewestMs = ms;\n newestEntry = { id: stat.id, ts: stat.newest_ts };\n }\n }\n }\n\n const largestByBytes =\n topN === 0\n ? []\n : [...stats]\n .sort((a, b) => b.bytes - a.bytes || a.id.localeCompare(b.id))\n .slice(0, topN);\n\n const deepestByLines =\n topN === 0\n ? []\n : [...stats]\n .sort((a, b) => b.lines - a.lines || a.id.localeCompare(b.id))\n .slice(0, topN);\n\n return {\n total_streams: streams.length,\n total_lines: totalLines,\n total_bytes: totalBytes,\n largest_by_bytes: largestByBytes,\n deepest_by_lines: deepestByLines,\n oldest_entry: oldestEntry,\n newest_entry: newestEntry,\n };\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;;;;;;;;;;AC4BjB,SAAS,gBAAgB,IAAY,KAAW;AAC9C,QAAM,QAAQ,OAAO,WAAW,KAAK,MAAM;AAE3C,MAAI,QAAQ;AACZ,MAAI,WAA0B;AAC9B,MAAI,WAA0B;AAC9B,MAAI,WAAW,OAAO;AACtB,MAAI,WAAW,OAAO;AAEtB,aAAW,WAAW,IAAI,MAAM,OAAO,GAAG;AACxC,UAAM,UAAU,QAAQ,KAAI;AAC5B,QAAI,YAAY,IAAI;AAClB;IACF;AACA,aAAS;AAET,QAAI;AACJ,QAAI;AACF,eAAS,KAAK,MAAM,OAAO;IAC7B,QAAQ;AACN;IACF;AAEA,QACE,WAAW,QACX,OAAO,WAAW,YAClB,EAAE,QAAS,WACX,OAAQ,OAAmC,IAAI,MAAM,UACrD;AACA;IACF;AAEA,UAAM,KAAM,OAAmC,IAAI;AACnD,UAAM,KAAK,KAAK,MAAM,EAAE;AACxB,QAAI,OAAO,MAAM,EAAE,GAAG;AACpB;IACF;AAEA,QAAI,KAAK,YAAa,OAAO,YAAY,aAAa,QAAQ,KAAK,UAAW;AAC5E,iBAAW;AACX,iBAAW;IACb;AACA,QAAI,KAAK,YAAa,OAAO,YAAY,aAAa,QAAQ,KAAK,UAAW;AAC5E,iBAAW;AACX,iBAAW;IACb;EACF;AAEA,SAAO,EAAE,IAAI,OAAO,OAAO,WAAW,UAAU,WAAW,S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