@unbrained/pm-cli 2026.7.13 → 2026.7.14
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 +2 -2
- package/CHANGELOG.md +28 -0
- package/dist/cli/commands/aggregate.d.ts +1 -1
- package/dist/cli/commands/aggregate.js +18 -6
- package/dist/cli/commands/aggregate.js.map +1 -1
- package/dist/cli/commands/context.d.ts +16 -1
- package/dist/cli/commands/context.js +98 -16
- package/dist/cli/commands/context.js.map +1 -1
- package/dist/cli/commands/create.d.ts +1 -1
- package/dist/cli/commands/create.js +11 -7
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/deps.d.ts +6 -96
- package/dist/cli/commands/deps.js +4 -214
- package/dist/cli/commands/deps.js.map +1 -1
- package/dist/cli/commands/docs.d.ts +2 -44
- package/dist/cli/commands/docs.js +8 -13
- package/dist/cli/commands/docs.js.map +1 -1
- package/dist/cli/commands/files.d.ts +6 -134
- package/dist/cli/commands/files.js +4 -294
- package/dist/cli/commands/files.js.map +1 -1
- package/dist/cli/commands/get.js +15 -2
- package/dist/cli/commands/get.js.map +1 -1
- package/dist/cli/commands/list.js +5 -6
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/next.d.ts +3 -1
- package/dist/cli/commands/next.js +77 -20
- package/dist/cli/commands/next.js.map +1 -1
- package/dist/cli/commands/update-many.js +6 -3
- package/dist/cli/commands/update-many.js.map +1 -1
- package/dist/cli/commands/update.js +14 -7
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/validate.d.ts +1 -1
- package/dist/cli/commands/validate.js +32 -35
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/main.d.ts +2 -14
- package/dist/cli/main.js +27 -8
- package/dist/cli/main.js.map +1 -1
- package/dist/cli-bundle/chunks/append-DYQWQK2J.js +11 -0
- package/dist/cli-bundle/chunks/{append-2FS6MVG7.js → append-PVZJDM6J.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-J2WAWP4U.js → chunk-2FNWQXZ2.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-YFGYDZRP.js → chunk-2GA3NK35.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-XFEIASAC.js → chunk-2QIQGYPW.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3WCGYH5Q.js → chunk-3CMRNVTO.js} +7 -7
- package/dist/cli-bundle/chunks/chunk-3HKUXVKV.js +9 -0
- package/dist/cli-bundle/chunks/{chunk-VDAZPPRU.js → chunk-3I3LRT2G.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3P3RFJIQ.js → chunk-3TL7WOEF.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4SHJ5JS3.js → chunk-44LNIULG.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-QFOAWBOB.js → chunk-4DY4KPQI.js} +11 -10
- package/dist/cli-bundle/chunks/{chunk-QFOAWBOB.js.map → chunk-4DY4KPQI.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-BVCF4ULV.js → chunk-4RXTMU57.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-XMI2TRY5.js → chunk-4WREH7RT.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-JYUGUXFW.js → chunk-5CT5BW6E.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-NA5SBIB4.js → chunk-5URI7TPJ.js} +44 -44
- package/dist/cli-bundle/chunks/chunk-5URI7TPJ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-QGH6WL6L.js → chunk-655STMGA.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-DGKBWCMA.js → chunk-6IIVBC56.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-SRQLQUO6.js → chunk-6MHSBDGD.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-SRQLQUO6.js.map → chunk-6MHSBDGD.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-D4GPNYYP.js → chunk-6OTZMORS.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-JVRVXO6M.js → chunk-6PKA3SJQ.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-2PR4ZTRO.js → chunk-6TTOHMTB.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-2PR4ZTRO.js.map → chunk-6TTOHMTB.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-6X5MZ5R2.js +9 -0
- package/dist/cli-bundle/chunks/chunk-76UBY2EE.js +5 -0
- package/dist/cli-bundle/chunks/{chunk-ZS2KPCJN.js → chunk-7QDSYUMF.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-Z7TFPIJ6.js → chunk-7TQMR6LK.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-AHA4POA6.js → chunk-ABRCOSDC.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-XY3CC3EM.js → chunk-AFWZRL7M.js} +59 -53
- package/dist/cli-bundle/chunks/chunk-AFWZRL7M.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-KQJVTQVK.js → chunk-ANSJHDOZ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-OMT4NO7T.js → chunk-B5DZYTT3.js} +113 -24
- package/dist/cli-bundle/chunks/chunk-B5DZYTT3.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-B7SWOIP6.js +5 -0
- package/dist/cli-bundle/chunks/{chunk-D2LXG7WX.js → chunk-BN62TO2S.js} +5 -5
- package/dist/cli-bundle/chunks/chunk-BN62TO2S.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ZTSV7P2T.js → chunk-BPD26E3P.js} +357 -42
- package/dist/cli-bundle/chunks/chunk-BPD26E3P.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-RKGFUC4O.js → chunk-CDJYP7OQ.js} +36 -14
- package/dist/cli-bundle/chunks/chunk-CDJYP7OQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-VLFLRFJP.js → chunk-CIOZ376P.js} +20 -13
- package/dist/cli-bundle/chunks/chunk-CIOZ376P.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-HXTCZSAI.js → chunk-DBZVUJTK.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-2QNOWOIB.js → chunk-DO5RGJXT.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-MKONZ4UO.js → chunk-DRNJPEPQ.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-XDT2PSXA.js → chunk-DVOLZJ3C.js} +12 -11
- package/dist/cli-bundle/chunks/{chunk-XDT2PSXA.js.map → chunk-DVOLZJ3C.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-H36FXA7B.js → chunk-DYEX6NFH.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-G3IB5GTD.js → chunk-E2WC6S4P.js} +15 -11
- package/dist/cli-bundle/chunks/chunk-E2WC6S4P.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-GAJ7U7B4.js → chunk-ERL2YFJ2.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-FPEYOFEF.js → chunk-F7PSHRNO.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-UH7OLT6F.js → chunk-FDSBDNYE.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-DGJF32JF.js → chunk-FIGXOCEQ.js} +66 -21
- package/dist/cli-bundle/chunks/chunk-FIGXOCEQ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-RQAY7C5T.js → chunk-FJZDA6MS.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-B4TVNGRX.js → chunk-FO7GMJKG.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-FRQ63VPB.js +5 -0
- package/dist/cli-bundle/chunks/{chunk-UTYNQ2WH.js → chunk-FS6UM5WH.js} +48 -27
- package/dist/cli-bundle/chunks/chunk-FS6UM5WH.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-U252II47.js → chunk-FTQLW4JD.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-TNGLCRKS.js → chunk-GSEADLRH.js} +1821 -1809
- package/dist/cli-bundle/chunks/chunk-GSEADLRH.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-TGG7YGMC.js → chunk-GXXC7QSK.js} +53 -47
- package/dist/cli-bundle/chunks/chunk-GXXC7QSK.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-AGD4VZXH.js → chunk-H2QBAKLQ.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-CJVQ4XIG.js → chunk-HAMLIWAF.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-56DX6QYG.js → chunk-HL7V2PHX.js} +19 -13
- package/dist/cli-bundle/chunks/chunk-HL7V2PHX.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-7QOIQTPB.js → chunk-HLHSQ5CA.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-AHC7J6XD.js → chunk-IA3YFTXT.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-5ZCVF4WF.js → chunk-IAPHYPRL.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-OCSQWIOW.js → chunk-IFZA4VB5.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-6O2HJENY.js → chunk-IGED7NH2.js} +61 -48
- package/dist/cli-bundle/chunks/chunk-IGED7NH2.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-RPCCQDG2.js → chunk-ILLUE5DI.js} +36 -14
- package/dist/cli-bundle/chunks/chunk-ILLUE5DI.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-4WMFM77X.js → chunk-J4NZOP3I.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-57JVERX3.js → chunk-JAF4TUQ7.js} +4 -4
- package/dist/cli-bundle/chunks/chunk-JAF4TUQ7.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-MTNKSSSO.js → chunk-JL7WZ4O2.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-AZ52LTCY.js → chunk-K7WNZ7KD.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-2OLSXXIV.js → chunk-KADLSPIU.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-RQKORMM4.js → chunk-KB726FMH.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-WKSFBBZT.js → chunk-L24HCJFC.js} +114 -25
- package/dist/cli-bundle/chunks/chunk-L24HCJFC.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-LDO24J5I.js → chunk-LWTIRS3Y.js} +365 -43
- package/dist/cli-bundle/chunks/chunk-LWTIRS3Y.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-TZTQ4TVV.js → chunk-M6ASXYCU.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-WDDOAU7Z.js → chunk-M7EWN4TF.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-327DSGW2.js → chunk-MD6ULIPJ.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-OKDBHOON.js → chunk-MKL4CP2I.js} +61 -48
- package/dist/cli-bundle/chunks/chunk-MKL4CP2I.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-M52DG2QJ.js → chunk-MQZ3PLCF.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-GQ2CQNGI.js → chunk-N3CMP4NI.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-J7SBFUZC.js → chunk-NAQYVWSQ.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-U2GMYP3L.js → chunk-NKW36AMT.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-5WEYOVZ7.js → chunk-OBDLEQG5.js} +19 -12
- package/dist/cli-bundle/chunks/chunk-OBDLEQG5.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-VL4LYTJN.js → chunk-OI4S4KCI.js} +18 -12
- package/dist/cli-bundle/chunks/chunk-OI4S4KCI.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-FCVVMAEX.js → chunk-P6MYFH6K.js} +60 -22
- package/dist/cli-bundle/chunks/chunk-P6MYFH6K.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-FTQQAPRX.js → chunk-PHKP3AGR.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-WVUXNIYO.js → chunk-Q37E63AM.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-JVXV7ANV.js → chunk-Q7E6OYZK.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WVUYATII.js → chunk-QABYZYLU.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-QRRUGIJN.js → chunk-QASRVKUQ.js} +45 -45
- package/dist/cli-bundle/chunks/chunk-QASRVKUQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-L4262MFB.js → chunk-QK2ZN6UL.js} +14 -5
- package/dist/cli-bundle/chunks/{chunk-L4262MFB.js.map → chunk-QK2ZN6UL.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-7TQPV7HR.js → chunk-QSPARJWF.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-GTKILM6F.js → chunk-QZ7LT3XE.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-L3VKY6R6.js → chunk-RA5AIAMP.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-BJS27ALI.js → chunk-RGXD5JJR.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-TSEPW2P6.js → chunk-RMF3IOYQ.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-QXYKH56X.js → chunk-T4BRCB6Z.js} +1894 -1875
- package/dist/cli-bundle/chunks/chunk-T4BRCB6Z.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-TGGTXC52.js → chunk-TH7U4KLY.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-LP4UATP6.js → chunk-TWLDBKQU.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-OTZ3C2NE.js → chunk-TZ2PSLLT.js} +49 -28
- package/dist/cli-bundle/chunks/chunk-TZ2PSLLT.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-UK222BHQ.js → chunk-TZRTLMWM.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-6E6S2X6S.js → chunk-UB2QYSTO.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-S6CXUSYC.js → chunk-UGTVWL3E.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-BNS6QHTZ.js → chunk-UJ4HJYWL.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-BYVOEJPQ.js → chunk-UKUIIBDW.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-SGDBVR7X.js → chunk-UVBA6F5A.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-DZRZMBBF.js → chunk-VJTAEIPC.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-74PWVJON.js → chunk-W6HZ55JO.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-HR2MQAO5.js → chunk-WD6MSYMP.js} +13 -4
- package/dist/cli-bundle/chunks/{chunk-HR2MQAO5.js.map → chunk-WD6MSYMP.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-P7IFURWH.js → chunk-WPAWZW7S.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-36LEOWSX.js → chunk-WQUEHPZB.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-FCKJF7G2.js → chunk-WRKB56FC.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-KR5EHAN4.js → chunk-X3GYR4P2.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-J567OZJY.js → chunk-X6BVXQ52.js} +16 -12
- package/dist/cli-bundle/chunks/chunk-X6BVXQ52.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-Y72FV7RM.js +178 -0
- package/dist/cli-bundle/chunks/chunk-Y72FV7RM.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-OWW2KXOV.js → chunk-YQYG2V23.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-G2SCT7BC.js → chunk-YVKE5ZDM.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-QHIN4UTF.js → chunk-ZAYYDNB3.js} +4 -4
- package/dist/cli-bundle/chunks/chunk-ZHBI2AP7.js +9 -0
- package/dist/cli-bundle/chunks/chunk-ZNP64HOW.js +175 -0
- package/dist/cli-bundle/chunks/chunk-ZNP64HOW.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-GNVBUNJQ.js → chunk-ZTRBSABY.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-PY32KGQU.js → chunk-ZUKSZVBW.js} +5 -5
- package/dist/cli-bundle/chunks/{close-CU56F47E.js → close-LZECOMHO.js} +5 -5
- package/dist/cli-bundle/chunks/close-RI4JQQHU.js +12 -0
- package/dist/cli-bundle/chunks/close-many-LY2XJ52M.js +21 -0
- package/dist/cli-bundle/chunks/{close-many-ZQ2WP67J.js → close-many-ZHI6A5TN.js} +12 -12
- package/dist/cli-bundle/chunks/comments-35M273DN.js +13 -0
- package/dist/cli-bundle/chunks/{comments-UDUMKXL6.js → comments-AJWRTFZ5.js} +7 -7
- package/dist/cli-bundle/chunks/{copy-VFHECFBV.js → copy-GMXYKBXT.js} +4 -4
- package/dist/cli-bundle/chunks/copy-NPYM7M7U.js +9 -0
- package/dist/cli-bundle/chunks/create-F53OBTOU.js +27 -0
- package/dist/cli-bundle/chunks/{create-CE2X3SGF.js → create-HU4Q7RJX.js} +11 -9
- package/dist/cli-bundle/chunks/{delete-2JXQCHHT.js → delete-GSDZLTRC.js} +4 -4
- package/dist/cli-bundle/chunks/delete-ODRWJWAM.js +10 -0
- package/dist/cli-bundle/chunks/deps-U57I7EAK.js +16 -0
- package/dist/cli-bundle/chunks/{deps-FPXNLO6C.js → deps-WWB7P2GT.js} +7 -4
- package/dist/cli-bundle/chunks/docs-G7N4E2JO.js +14 -0
- package/dist/cli-bundle/chunks/{docs-AMAR4OHU.js → docs-MQIY2ZQS.js} +7 -7
- package/dist/cli-bundle/chunks/files-TBZD7V6H.js +18 -0
- package/dist/cli-bundle/chunks/{files-JFHN7DYM.js → files-TTY6N2AV.js} +7 -7
- package/dist/cli-bundle/chunks/focus-U5TRVCRS.js +10 -0
- package/dist/cli-bundle/chunks/{focus-QFN2RRZ7.js → focus-XT6YVFFX.js} +5 -5
- package/dist/cli-bundle/chunks/{history-compact-G34XMABV.js → history-compact-KKVUWB4V.js} +8 -8
- package/dist/cli-bundle/chunks/{history-compact-SAHT5D46.js → history-compact-M7GHYVFN.js} +8 -8
- package/dist/cli-bundle/chunks/{history-redact-IFJDNKLZ.js → history-redact-3DVZOILD.js} +6 -6
- package/dist/cli-bundle/chunks/history-redact-JIHZLHDP.js +16 -0
- package/dist/cli-bundle/chunks/{history-repair-NXLQTCVN.js → history-repair-ITDUMK4N.js} +8 -8
- package/dist/cli-bundle/chunks/history-repair-NAFCHLH7.js +18 -0
- package/dist/cli-bundle/chunks/{learnings-5CZKAMBS.js → learnings-FGO3NSFW.js} +7 -7
- package/dist/cli-bundle/chunks/learnings-SONGPSHI.js +13 -0
- package/dist/cli-bundle/chunks/notes-BSD53H2W.js +13 -0
- package/dist/cli-bundle/chunks/{notes-POMK37UI.js → notes-NQ6RXVW6.js} +7 -7
- package/dist/cli-bundle/chunks/{plan-YBNYNT3A.js → plan-2NNEO46V.js} +10 -10
- package/dist/cli-bundle/chunks/plan-AWLYGBNV.js +24 -0
- package/dist/cli-bundle/chunks/{profile-JNKSU6EQ.js → profile-AAQUU6T3.js} +9 -9
- package/dist/cli-bundle/chunks/{profile-A2WPVG6I.js → profile-U725ATWZ.js} +9 -9
- package/dist/cli-bundle/chunks/{register-list-query-UG4ZA5AU.js → register-list-query-BUWCYHBT.js} +14 -13
- package/dist/cli-bundle/chunks/{register-list-query-UG4ZA5AU.js.map → register-list-query-BUWCYHBT.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-list-query-KJULL4W3.js → register-list-query-KTZ6AGE7.js} +16 -15
- package/dist/cli-bundle/chunks/{register-list-query-KJULL4W3.js.map → register-list-query-KTZ6AGE7.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-mutation-3OXYXBKH.js → register-mutation-4FMGJJF7.js} +29 -29
- package/dist/cli-bundle/chunks/{register-mutation-WK265BM7.js → register-mutation-UELYYOR7.js} +29 -29
- package/dist/cli-bundle/chunks/{register-operations-C5SQH3FJ.js → register-operations-ISUX6LY5.js} +33 -29
- package/dist/cli-bundle/chunks/{register-operations-C5SQH3FJ.js.map → register-operations-ISUX6LY5.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-operations-FH3PBHYN.js → register-operations-JVW24J2Y.js} +35 -31
- package/dist/cli-bundle/chunks/{register-operations-FH3PBHYN.js.map → register-operations-JVW24J2Y.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-setup-CCK7CJVR.js → register-setup-5XNGKJ22.js} +15 -15
- package/dist/cli-bundle/chunks/{register-setup-CPZBGSOJ.js → register-setup-ZTNY6S7R.js} +15 -15
- package/dist/cli-bundle/chunks/restore-66GLMHIX.js +14 -0
- package/dist/cli-bundle/chunks/{restore-IVS5XGYR.js → restore-B3BAB6X2.js} +6 -6
- package/dist/cli-bundle/chunks/{schema-P2MF23JO.js → schema-LZNUYHDB.js} +6 -6
- package/dist/cli-bundle/chunks/schema-LZNUYHDB.js.map +7 -0
- package/dist/cli-bundle/chunks/{schema-R3U2REY4.js → schema-U7IM2DXV.js} +6 -6
- package/dist/cli-bundle/chunks/schema-U7IM2DXV.js.map +1 -0
- package/dist/cli-bundle/chunks/update-2XGHIVQ2.js +21 -0
- package/dist/cli-bundle/chunks/update-2XGHIVQ2.js.map +7 -0
- package/dist/cli-bundle/chunks/{update-YBIQESMH.js → update-Q3UCILNR.js} +12 -12
- package/dist/cli-bundle/chunks/update-Q3UCILNR.js.map +1 -0
- package/dist/cli-bundle/chunks/{update-many-F3CIV5SQ.js → update-many-75K57FS3.js} +19 -19
- package/dist/cli-bundle/chunks/update-many-75K57FS3.js.map +1 -0
- package/dist/cli-bundle/chunks/update-many-U42YA445.js +30 -0
- package/dist/cli-bundle/chunks/update-many-U42YA445.js.map +7 -0
- package/dist/cli-bundle/main.js +39 -16
- package/dist/cli-bundle/main.js.map +2 -2
- package/dist/cli-bundle/sdk-runtime.js +56 -53
- package/dist/cli-bundle/sdk-testing.js +6 -6
- package/dist/cli-bundle/sdk.js +115 -55
- package/dist/cli-bundle/sdk.js.map +2 -2
- package/dist/core/extensions/command-hook-context.d.ts +40 -0
- package/dist/core/extensions/command-hook-context.js +14 -0
- package/dist/core/extensions/command-hook-context.js.map +1 -0
- package/dist/core/extensions/index.d.ts +1 -0
- package/dist/core/extensions/index.js +4 -3
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/item/parse.d.ts +2 -0
- package/dist/core/item/parse.js +11 -2
- package/dist/core/item/parse.js.map +1 -1
- package/dist/core/store/paths.d.ts +2 -0
- package/dist/core/store/paths.js +10 -2
- package/dist/core/store/paths.js.map +1 -1
- package/dist/mcp/tool-definitions.js +12 -2
- package/dist/mcp/tool-definitions.js.map +1 -1
- package/dist/sdk/context-packing.d.ts +114 -0
- package/dist/sdk/context-packing.js +219 -0
- package/dist/sdk/context-packing.js.map +1 -0
- package/dist/sdk/context-relevance.d.ts +1 -1
- package/dist/sdk/context-relevance.js +4 -2
- package/dist/sdk/context-relevance.js.map +1 -1
- package/dist/sdk/context-usage.d.ts +79 -0
- package/dist/sdk/context-usage.js +193 -0
- package/dist/sdk/context-usage.js.map +1 -0
- package/dist/sdk/dependencies.d.ts +145 -0
- package/dist/sdk/dependencies.js +327 -0
- package/dist/sdk/dependencies.js.map +1 -0
- package/dist/sdk/docs.d.ts +48 -0
- package/dist/sdk/docs.js +15 -0
- package/dist/sdk/docs.js.map +1 -0
- package/dist/sdk/files.d.ts +135 -0
- package/dist/sdk/files.js +320 -0
- package/dist/sdk/files.js.map +1 -0
- package/dist/sdk/index.d.ts +6 -0
- package/dist/sdk/index.js +8 -2
- package/dist/sdk/index.js.map +1 -1
- package/dist/{cli/commands → sdk}/linked-artifacts.d.ts +11 -5
- package/dist/{cli/commands → sdk}/linked-artifacts.js +49 -25
- package/dist/sdk/linked-artifacts.js.map +1 -0
- package/dist/sdk/runtime.d.ts +4 -4
- package/dist/sdk/runtime.js +7 -4
- package/dist/sdk/runtime.js.map +1 -1
- package/dist/sdk/workspace.js +3 -2
- package/dist/sdk/workspace.js.map +1 -1
- package/docs/AGENT_GUIDE.md +1 -1
- package/docs/CONFIGURATION.md +1 -0
- package/docs/PR_REVIEW_LOOP.md +21 -11
- package/docs/SDK.md +94 -0
- package/marketplace.json +2 -2
- package/package.json +1 -1
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/dist/cli/commands/linked-artifacts.js.map +0 -1
- package/dist/cli-bundle/chunks/append-CTKFDEAX.js +0 -11
- package/dist/cli-bundle/chunks/chunk-56DX6QYG.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-57JVERX3.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5WEYOVZ7.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-6O2HJENY.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-CCAGZCZK.js +0 -17
- package/dist/cli-bundle/chunks/chunk-CCAGZCZK.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-D2LXG7WX.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-DGJF32JF.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-FCVVMAEX.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-FUOK7JZ6.js +0 -14
- package/dist/cli-bundle/chunks/chunk-FUOK7JZ6.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-G3IB5GTD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-J567OZJY.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-LDO24J5I.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-NA5SBIB4.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-OKDBHOON.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-OMT4NO7T.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-OTZ3C2NE.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-QRRUGIJN.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-QXYKH56X.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-RKGFUC4O.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-RPCCQDG2.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-TGG7YGMC.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-TNGLCRKS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-UTYNQ2WH.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-VL4LYTJN.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-VLFLRFJP.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-WKSFBBZT.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-XY3CC3EM.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-ZTSV7P2T.js.map +0 -1
- package/dist/cli-bundle/chunks/close-BWM7FTF4.js +0 -12
- package/dist/cli-bundle/chunks/close-many-AUHTVFUQ.js +0 -21
- package/dist/cli-bundle/chunks/comments-7D5VPBZI.js +0 -13
- package/dist/cli-bundle/chunks/copy-QJ6ZVWZV.js +0 -9
- package/dist/cli-bundle/chunks/create-FGMTTYOI.js +0 -25
- package/dist/cli-bundle/chunks/delete-L2GMMMPR.js +0 -10
- package/dist/cli-bundle/chunks/deps-KTFI4RWD.js +0 -13
- package/dist/cli-bundle/chunks/docs-VNURA275.js +0 -14
- package/dist/cli-bundle/chunks/files-UNFPZLTG.js +0 -18
- package/dist/cli-bundle/chunks/focus-MI2UHBP4.js +0 -10
- package/dist/cli-bundle/chunks/history-redact-VAHGBUHI.js +0 -16
- package/dist/cli-bundle/chunks/history-repair-DDYQXR43.js +0 -18
- package/dist/cli-bundle/chunks/learnings-VWJEKHEO.js +0 -13
- package/dist/cli-bundle/chunks/notes-NGVJJJQO.js +0 -13
- package/dist/cli-bundle/chunks/plan-U6SQJUFI.js +0 -24
- package/dist/cli-bundle/chunks/restore-AX6ZMGHZ.js +0 -14
- package/dist/cli-bundle/chunks/update-XYHF3YZF.js +0 -21
- package/dist/cli-bundle/chunks/update-many-5HKVHFUL.js +0 -30
- /package/dist/cli-bundle/chunks/{append-CTKFDEAX.js.map → append-DYQWQK2J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-2FS6MVG7.js.map → append-PVZJDM6J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-J2WAWP4U.js.map → chunk-2FNWQXZ2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YFGYDZRP.js.map → chunk-2GA3NK35.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XFEIASAC.js.map → chunk-2QIQGYPW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3WCGYH5Q.js.map → chunk-3CMRNVTO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-BWM7FTF4.js.map → chunk-3HKUXVKV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VDAZPPRU.js.map → chunk-3I3LRT2G.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3P3RFJIQ.js.map → chunk-3TL7WOEF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4SHJ5JS3.js.map → chunk-44LNIULG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BVCF4ULV.js.map → chunk-4RXTMU57.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XMI2TRY5.js.map → chunk-4WREH7RT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JYUGUXFW.js.map → chunk-5CT5BW6E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QGH6WL6L.js.map → chunk-655STMGA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DGKBWCMA.js.map → chunk-6IIVBC56.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-D4GPNYYP.js.map → chunk-6OTZMORS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JVRVXO6M.js.map → chunk-6PKA3SJQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-AUHTVFUQ.js.map → chunk-6X5MZ5R2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-CU56F47E.js.map → chunk-76UBY2EE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZS2KPCJN.js.map → chunk-7QDSYUMF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Z7TFPIJ6.js.map → chunk-7TQMR6LK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AHA4POA6.js.map → chunk-ABRCOSDC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KQJVTQVK.js.map → chunk-ANSJHDOZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-ZQ2WP67J.js.map → chunk-B7SWOIP6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HXTCZSAI.js.map → chunk-DBZVUJTK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2QNOWOIB.js.map → chunk-DO5RGJXT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MKONZ4UO.js.map → chunk-DRNJPEPQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-H36FXA7B.js.map → chunk-DYEX6NFH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GAJ7U7B4.js.map → chunk-ERL2YFJ2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FPEYOFEF.js.map → chunk-F7PSHRNO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UH7OLT6F.js.map → chunk-FDSBDNYE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RQAY7C5T.js.map → chunk-FJZDA6MS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-B4TVNGRX.js.map → chunk-FO7GMJKG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-UDUMKXL6.js.map → chunk-FRQ63VPB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-U252II47.js.map → chunk-FTQLW4JD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AGD4VZXH.js.map → chunk-H2QBAKLQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CJVQ4XIG.js.map → chunk-HAMLIWAF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7QOIQTPB.js.map → chunk-HLHSQ5CA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AHC7J6XD.js.map → chunk-IA3YFTXT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5ZCVF4WF.js.map → chunk-IAPHYPRL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OCSQWIOW.js.map → chunk-IFZA4VB5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4WMFM77X.js.map → chunk-J4NZOP3I.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MTNKSSSO.js.map → chunk-JL7WZ4O2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AZ52LTCY.js.map → chunk-K7WNZ7KD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2OLSXXIV.js.map → chunk-KADLSPIU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RQKORMM4.js.map → chunk-KB726FMH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TZTQ4TVV.js.map → chunk-M6ASXYCU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WDDOAU7Z.js.map → chunk-M7EWN4TF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-327DSGW2.js.map → chunk-MD6ULIPJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-M52DG2QJ.js.map → chunk-MQZ3PLCF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GQ2CQNGI.js.map → chunk-N3CMP4NI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-J7SBFUZC.js.map → chunk-NAQYVWSQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-U2GMYP3L.js.map → chunk-NKW36AMT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FTQQAPRX.js.map → chunk-PHKP3AGR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WVUXNIYO.js.map → chunk-Q37E63AM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JVXV7ANV.js.map → chunk-Q7E6OYZK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WVUYATII.js.map → chunk-QABYZYLU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7TQPV7HR.js.map → chunk-QSPARJWF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GTKILM6F.js.map → chunk-QZ7LT3XE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-L3VKY6R6.js.map → chunk-RA5AIAMP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BJS27ALI.js.map → chunk-RGXD5JJR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TSEPW2P6.js.map → chunk-RMF3IOYQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TGGTXC52.js.map → chunk-TH7U4KLY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LP4UATP6.js.map → chunk-TWLDBKQU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UK222BHQ.js.map → chunk-TZRTLMWM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6E6S2X6S.js.map → chunk-UB2QYSTO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-S6CXUSYC.js.map → chunk-UGTVWL3E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BNS6QHTZ.js.map → chunk-UJ4HJYWL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BYVOEJPQ.js.map → chunk-UKUIIBDW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SGDBVR7X.js.map → chunk-UVBA6F5A.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DZRZMBBF.js.map → chunk-VJTAEIPC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-74PWVJON.js.map → chunk-W6HZ55JO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-P7IFURWH.js.map → chunk-WPAWZW7S.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-36LEOWSX.js.map → chunk-WQUEHPZB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FCKJF7G2.js.map → chunk-WRKB56FC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KR5EHAN4.js.map → chunk-X3GYR4P2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OWW2KXOV.js.map → chunk-YQYG2V23.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-G2SCT7BC.js.map → chunk-YVKE5ZDM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QHIN4UTF.js.map → chunk-ZAYYDNB3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-7D5VPBZI.js.map → chunk-ZHBI2AP7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GNVBUNJQ.js.map → chunk-ZTRBSABY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-PY32KGQU.js.map → chunk-ZUKSZVBW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-VFHECFBV.js.map → close-LZECOMHO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-QJ6ZVWZV.js.map → close-RI4JQQHU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-FGMTTYOI.js.map → close-many-LY2XJ52M.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-CE2X3SGF.js.map → close-many-ZHI6A5TN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-L2GMMMPR.js.map → comments-35M273DN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-2JXQCHHT.js.map → comments-AJWRTFZ5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-FPXNLO6C.js.map → copy-GMXYKBXT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-KTFI4RWD.js.map → copy-NPYM7M7U.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-VNURA275.js.map → create-F53OBTOU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-AMAR4OHU.js.map → create-HU4Q7RJX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-JFHN7DYM.js.map → delete-GSDZLTRC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-UNFPZLTG.js.map → delete-ODRWJWAM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-MI2UHBP4.js.map → deps-U57I7EAK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-QFN2RRZ7.js.map → deps-WWB7P2GT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-SAHT5D46.js.map → docs-G7N4E2JO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-G34XMABV.js.map → docs-MQIY2ZQS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-VAHGBUHI.js.map → files-TBZD7V6H.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-IFJDNKLZ.js.map → files-TTY6N2AV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-DDYQXR43.js.map → focus-U5TRVCRS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-NXLQTCVN.js.map → focus-XT6YVFFX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-5CZKAMBS.js.map → history-compact-KKVUWB4V.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-VWJEKHEO.js.map → history-compact-M7GHYVFN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-POMK37UI.js.map → history-redact-3DVZOILD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-NGVJJJQO.js.map → history-redact-JIHZLHDP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-YBNYNT3A.js.map → history-repair-ITDUMK4N.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-U6SQJUFI.js.map → history-repair-NAFCHLH7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{profile-JNKSU6EQ.js.map → learnings-FGO3NSFW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{profile-A2WPVG6I.js.map → learnings-SONGPSHI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-AX6ZMGHZ.js.map → notes-BSD53H2W.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-IVS5XGYR.js.map → notes-NQ6RXVW6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-R3U2REY4.js.map → plan-2NNEO46V.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-P2MF23JO.js.map → plan-AWLYGBNV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-YBIQESMH.js.map → profile-AAQUU6T3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-XYHF3YZF.js.map → profile-U725ATWZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-mutation-3OXYXBKH.js.map → register-mutation-4FMGJJF7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-mutation-WK265BM7.js.map → register-mutation-UELYYOR7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-setup-CCK7CJVR.js.map → register-setup-5XNGKJ22.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-setup-CPZBGSOJ.js.map → register-setup-ZTNY6S7R.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-5HKVHFUL.js.map → restore-66GLMHIX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-F3CIV5SQ.js.map → restore-B3BAB6X2.js.map} +0 -0
|
@@ -1,300 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module cli/commands/files
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Re-exports the public SDK file-link primitive for CLI presentation wiring.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!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]="
|
|
8
|
-
|
|
9
|
-
import path from "node:path";
|
|
10
|
-
import { pathExists } from "../../core/fs/fs-utils.js";
|
|
11
|
-
import { getActiveExtensionRegistrations } from "../../core/extensions/index.js";
|
|
12
|
-
import { resolveItemTypeRegistry } from "../../core/item/type-registry.js";
|
|
13
|
-
import { EXIT_CODE } from "../../core/shared/constants.js";
|
|
14
|
-
import { PmCliError } from "../../core/shared/errors.js";
|
|
15
|
-
import { locateItem, mutateItem, readLocatedItem, } from "../../core/store/item-store.js";
|
|
16
|
-
import { getSettingsPath, resolvePmRoot } from "../../core/store/paths.js";
|
|
17
|
-
import { readSettings } from "../../core/store/settings.js";
|
|
18
|
-
import { resolveAuthor } from "../../core/shared/author.js";
|
|
19
|
-
import { isPathWithinDirectory } from "../../core/fs/path-utils.js";
|
|
20
|
-
import { dedupeLinkedArtifacts, normalizeLinkedPath, renameArtifactsResultKey, runLinkedArtifacts, sortLinkedArtifacts, } from "./linked-artifacts.js";
|
|
21
|
-
function normalizeCandidatePathForOutput(value) {
|
|
22
|
-
return normalizeLinkedPath(path.normalize(value));
|
|
23
|
-
}
|
|
24
|
-
async function realpathForContainment(inputPath) {
|
|
25
|
-
try {
|
|
26
|
-
return await fs.realpath(inputPath);
|
|
27
|
-
}
|
|
28
|
-
catch {
|
|
29
|
-
return path.resolve(inputPath);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
function linkedFileResolvedKey(linkedFile, projectRoot) {
|
|
33
|
-
const resolvedPath = path.isAbsolute(linkedFile.path)
|
|
34
|
-
? path.resolve(linkedFile.path)
|
|
35
|
-
: path.resolve(projectRoot, linkedFile.path);
|
|
36
|
-
return `${normalizeCandidatePathForOutput(resolvedPath)}::${linkedFile.scope}`;
|
|
37
|
-
}
|
|
38
|
-
function collectTextReferences(value, fieldPath, references) {
|
|
39
|
-
if (typeof value === "string") {
|
|
40
|
-
const trimmed = value.trim();
|
|
41
|
-
if (trimmed.length > 0) {
|
|
42
|
-
references.push({ field: fieldPath, value: trimmed });
|
|
43
|
-
}
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
if (Array.isArray(value)) {
|
|
47
|
-
value.forEach((entry, index) => collectTextReferences(entry, `${fieldPath}[${index}]`, references));
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
if (typeof value === "object" && value !== null) {
|
|
51
|
-
for (const [key, nested] of Object.entries(value)) {
|
|
52
|
-
/* c8 ignore next -- root-level object traversal always carries a non-empty field path in current callers. */
|
|
53
|
-
collectTextReferences(nested, fieldPath ? `${fieldPath}.${key}` : key, references);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
function collectItemTextReferences(document) {
|
|
58
|
-
const references = [];
|
|
59
|
-
collectTextReferences(document.metadata, "metadata", references);
|
|
60
|
-
collectTextReferences(document.body, "body", references);
|
|
61
|
-
return references;
|
|
62
|
-
}
|
|
63
|
-
function cleanupPathToken(value) {
|
|
64
|
-
let next = value.trim();
|
|
65
|
-
next = next.replace(/^[`"'<([{]+/u, "");
|
|
66
|
-
next = next.replace(/[`"'>)\]},;!?]+$/u, "");
|
|
67
|
-
next = next.replace(/[.]+$/u, "");
|
|
68
|
-
next = next.replace(/:(?:\d+)(?::\d+)?$/u, "");
|
|
69
|
-
next = next.replace(/[.]+$/u, "");
|
|
70
|
-
return next;
|
|
71
|
-
}
|
|
72
|
-
function extractRawPathReferences(references) {
|
|
73
|
-
const rawReferences = [];
|
|
74
|
-
const absolutePattern = /(?:[A-Za-z]:[\\/]|\/)[^\s"'`<>()[\]{},;]+/gu;
|
|
75
|
-
const relativePattern = /(?:\.{1,2}[\\/])?(?:(?:[A-Za-z0-9_.@-]+[\\/])+[A-Za-z0-9_.@-]+|[A-Za-z0-9_.@-]+\.[A-Za-z0-9][A-Za-z0-9._-]*)/gu;
|
|
76
|
-
for (const reference of references) {
|
|
77
|
-
const seenInField = new Set();
|
|
78
|
-
for (const pattern of [absolutePattern, relativePattern]) {
|
|
79
|
-
pattern.lastIndex = 0;
|
|
80
|
-
for (const match of reference.value.matchAll(pattern)) {
|
|
81
|
-
/* c8 ignore next -- RegExp match arrays always expose capture [0]. */
|
|
82
|
-
const token = cleanupPathToken(match[0] ?? "");
|
|
83
|
-
if (!token || seenInField.has(token)) {
|
|
84
|
-
continue;
|
|
85
|
-
}
|
|
86
|
-
seenInField.add(token);
|
|
87
|
-
rawReferences.push({ field: reference.field, value: token });
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
return rawReferences;
|
|
92
|
-
}
|
|
93
|
-
async function resolveDiscoveredFile(rawPath, projectRoot) {
|
|
94
|
-
const absolutePath = path.isAbsolute(rawPath)
|
|
95
|
-
? path.resolve(rawPath)
|
|
96
|
-
: path.resolve(projectRoot, rawPath);
|
|
97
|
-
let stats;
|
|
98
|
-
try {
|
|
99
|
-
stats = await fs.stat(absolutePath);
|
|
100
|
-
}
|
|
101
|
-
catch {
|
|
102
|
-
return undefined;
|
|
103
|
-
}
|
|
104
|
-
if (!stats.isFile()) {
|
|
105
|
-
return undefined;
|
|
106
|
-
}
|
|
107
|
-
const [canonicalProjectRoot, canonicalAbsolutePath] = await Promise.all([
|
|
108
|
-
realpathForContainment(projectRoot),
|
|
109
|
-
realpathForContainment(absolutePath),
|
|
110
|
-
]);
|
|
111
|
-
if (isPathWithinDirectory(canonicalProjectRoot, canonicalAbsolutePath)) {
|
|
112
|
-
const relativePath = path.relative(canonicalProjectRoot, canonicalAbsolutePath);
|
|
113
|
-
if (!relativePath ||
|
|
114
|
-
relativePath.startsWith("..") ||
|
|
115
|
-
path.isAbsolute(relativePath)) {
|
|
116
|
-
return undefined;
|
|
117
|
-
}
|
|
118
|
-
return {
|
|
119
|
-
path: normalizeCandidatePathForOutput(relativePath),
|
|
120
|
-
scope: "project",
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
return {
|
|
124
|
-
path: normalizeCandidatePathForOutput(absolutePath),
|
|
125
|
-
scope: "global",
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
async function discoverReferencedFiles(document, projectRoot) {
|
|
129
|
-
const existingResolvedKeys = new Set((document.metadata.files ?? []).map((entry) => linkedFileResolvedKey(entry, projectRoot)));
|
|
130
|
-
const grouped = new Map();
|
|
131
|
-
const rawReferences = extractRawPathReferences(collectItemTextReferences(document));
|
|
132
|
-
for (const reference of rawReferences) {
|
|
133
|
-
const resolved = await resolveDiscoveredFile(reference.value, projectRoot);
|
|
134
|
-
if (!resolved) {
|
|
135
|
-
continue;
|
|
136
|
-
}
|
|
137
|
-
const key = linkedFileResolvedKey(resolved, projectRoot);
|
|
138
|
-
const existing = grouped.get(key) ?? {
|
|
139
|
-
path: resolved.path,
|
|
140
|
-
scope: resolved.scope,
|
|
141
|
-
sourceFields: new Set(),
|
|
142
|
-
originalPaths: new Set(),
|
|
143
|
-
sourceCount: 0,
|
|
144
|
-
};
|
|
145
|
-
existing.sourceFields.add(reference.field);
|
|
146
|
-
existing.originalPaths.add(reference.value);
|
|
147
|
-
existing.sourceCount += 1;
|
|
148
|
-
grouped.set(key, existing);
|
|
149
|
-
}
|
|
150
|
-
return [...grouped.entries()]
|
|
151
|
-
.map(([key, entry]) => ({
|
|
152
|
-
path: entry.path,
|
|
153
|
-
scope: entry.scope,
|
|
154
|
-
status: existingResolvedKeys.has(key)
|
|
155
|
-
? "already_linked"
|
|
156
|
-
: "addable",
|
|
157
|
-
source_count: entry.sourceCount,
|
|
158
|
-
source_fields: [...entry.sourceFields].sort((left, right) => left.localeCompare(right)),
|
|
159
|
-
original_paths: [...entry.originalPaths].sort((left, right) => left.localeCompare(right)),
|
|
160
|
-
}))
|
|
161
|
-
.sort((left, right) => {
|
|
162
|
-
const byStatus = left.status.localeCompare(right.status);
|
|
163
|
-
if (byStatus !== 0)
|
|
164
|
-
return byStatus;
|
|
165
|
-
const byPath = left.path.localeCompare(right.path);
|
|
166
|
-
if (byPath !== 0)
|
|
167
|
-
return byPath;
|
|
168
|
-
/* c8 ignore next -- path+status collisions are uncommon in deterministic fixtures. */
|
|
169
|
-
return left.scope.localeCompare(right.scope);
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
/** Public contract for test only, shared by SDK and presentation-layer consumers. */
|
|
173
|
-
export const _testOnly = {
|
|
174
|
-
normalizeCandidatePathForOutput,
|
|
175
|
-
realpathForContainment,
|
|
176
|
-
linkedFileResolvedKey,
|
|
177
|
-
collectTextReferences,
|
|
178
|
-
collectItemTextReferences,
|
|
179
|
-
cleanupPathToken,
|
|
180
|
-
extractRawPathReferences,
|
|
181
|
-
resolveDiscoveredFile,
|
|
182
|
-
discoverReferencedFiles,
|
|
183
|
-
};
|
|
184
|
-
/** Implements run files for the public runtime surface of this module. */
|
|
185
|
-
export async function runFiles(id, options, global) {
|
|
186
|
-
const result = await runLinkedArtifacts(id, options, global, {
|
|
187
|
-
metadataKey: "files",
|
|
188
|
-
op: "files_add",
|
|
189
|
-
bareNoun: "file",
|
|
190
|
-
supportsAppendStable: true,
|
|
191
|
-
});
|
|
192
|
-
return renameArtifactsResultKey(result, "files");
|
|
193
|
-
}
|
|
194
|
-
/** Implements run files discover for the public runtime surface of this module. */
|
|
195
|
-
export async function runFilesDiscover(id, options, global) {
|
|
196
|
-
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
197
|
-
if (!(await pathExists(getSettingsPath(pmRoot)))) {
|
|
198
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
199
|
-
}
|
|
200
|
-
const settings = await readSettings(pmRoot);
|
|
201
|
-
const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
|
|
202
|
-
const located = await locateItem(pmRoot, id, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);
|
|
203
|
-
/* c8 ignore next -- not-found behavior is validated by CLI integration coverage. */
|
|
204
|
-
if (!located) {
|
|
205
|
-
throw new PmCliError(`Item ${id} not found`, EXIT_CODE.NOT_FOUND);
|
|
206
|
-
}
|
|
207
|
-
const loaded = await readLocatedItem(located, { schema: settings.schema });
|
|
208
|
-
const candidates = await discoverReferencedFiles(loaded.document, process.cwd());
|
|
209
|
-
const addableCandidates = candidates.filter((candidate) => candidate.status === "addable");
|
|
210
|
-
const skippedExisting = candidates.filter((candidate) => candidate.status === "already_linked");
|
|
211
|
-
const requestedApply = options.apply === true;
|
|
212
|
-
const note = options.note?.trim() || "discovered from item text";
|
|
213
|
-
if (!requestedApply || addableCandidates.length === 0) {
|
|
214
|
-
const files = loaded.document.metadata.files ?? [];
|
|
215
|
-
return {
|
|
216
|
-
id: located.id,
|
|
217
|
-
files,
|
|
218
|
-
changed: false,
|
|
219
|
-
apply: requestedApply,
|
|
220
|
-
count: files.length,
|
|
221
|
-
candidate_count: candidates.length,
|
|
222
|
-
addable_count: addableCandidates.length,
|
|
223
|
-
added_count: 0,
|
|
224
|
-
skipped_existing_count: skippedExisting.length,
|
|
225
|
-
candidates,
|
|
226
|
-
added: [],
|
|
227
|
-
skipped_existing: skippedExisting,
|
|
228
|
-
};
|
|
229
|
-
}
|
|
230
|
-
const author = resolveAuthor(options.author, settings.author_default);
|
|
231
|
-
const discoveredAdds = addableCandidates.map((candidate) => ({
|
|
232
|
-
path: candidate.path,
|
|
233
|
-
scope: candidate.scope,
|
|
234
|
-
note,
|
|
235
|
-
}));
|
|
236
|
-
const result = await mutateItem({
|
|
237
|
-
pmRoot,
|
|
238
|
-
settings,
|
|
239
|
-
id,
|
|
240
|
-
op: "files_discover",
|
|
241
|
-
author,
|
|
242
|
-
message: options.message ?? "Discover referenced file links",
|
|
243
|
-
force: options.force,
|
|
244
|
-
mutate(document) {
|
|
245
|
-
const next = [...(document.metadata.files ?? [])];
|
|
246
|
-
const existingResolvedKeys = new Set(next.map((entry) => linkedFileResolvedKey(entry, process.cwd())));
|
|
247
|
-
const appliedAdds = [];
|
|
248
|
-
for (const add of discoveredAdds) {
|
|
249
|
-
const resolvedKey = linkedFileResolvedKey(add, process.cwd());
|
|
250
|
-
/* c8 ignore next -- duplicate-key race paths are exercised in broader CLI race tests. */
|
|
251
|
-
if (existingResolvedKeys.has(resolvedKey)) {
|
|
252
|
-
continue;
|
|
253
|
-
}
|
|
254
|
-
next.push(add);
|
|
255
|
-
existingResolvedKeys.add(resolvedKey);
|
|
256
|
-
appliedAdds.push(add);
|
|
257
|
-
}
|
|
258
|
-
const deduped = dedupeLinkedArtifacts(next);
|
|
259
|
-
/* c8 ignore next -- appendStable branch is covered through runFiles command contract tests. */
|
|
260
|
-
const normalized = options.appendStable
|
|
261
|
-
? deduped
|
|
262
|
-
: sortLinkedArtifacts(deduped);
|
|
263
|
-
if (normalized.length > 0) {
|
|
264
|
-
document.metadata.files = normalized;
|
|
265
|
-
}
|
|
266
|
-
else {
|
|
267
|
-
delete document.metadata.files;
|
|
268
|
-
}
|
|
269
|
-
return {
|
|
270
|
-
/* c8 ignore next -- no-op mutation responses may emit empty changedFields for skipped discover batches. */
|
|
271
|
-
changedFields: appliedAdds.length > 0 ? ["files"] : [],
|
|
272
|
-
/* c8 ignore next -- warning emission is exercised by race-aware integration tests. */
|
|
273
|
-
warnings: appliedAdds.length !== discoveredAdds.length
|
|
274
|
-
? [
|
|
275
|
-
`files_discover_skipped_existing:${discoveredAdds.length - appliedAdds.length}`,
|
|
276
|
-
]
|
|
277
|
-
: [],
|
|
278
|
-
};
|
|
279
|
-
},
|
|
280
|
-
});
|
|
281
|
-
const files = result.item.files ?? [];
|
|
282
|
-
const addedResolvedKeys = new Set(discoveredAdds.map((entry) => linkedFileResolvedKey(entry, process.cwd())));
|
|
283
|
-
const added = files.filter((entry) => addedResolvedKeys.has(linkedFileResolvedKey(entry, process.cwd())));
|
|
284
|
-
return {
|
|
285
|
-
id: result.item.id,
|
|
286
|
-
files,
|
|
287
|
-
changed: added.length > 0,
|
|
288
|
-
apply: true,
|
|
289
|
-
count: files.length,
|
|
290
|
-
candidate_count: candidates.length,
|
|
291
|
-
addable_count: addableCandidates.length,
|
|
292
|
-
added_count: added.length,
|
|
293
|
-
skipped_existing_count: skippedExisting.length,
|
|
294
|
-
candidates,
|
|
295
|
-
added,
|
|
296
|
-
skipped_existing: skippedExisting,
|
|
297
|
-
};
|
|
298
|
-
}
|
|
7
|
+
!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]="358bc01c-a706-559c-8c34-214a1610d8b5")}catch(e){}}();
|
|
8
|
+
export * from "../../sdk/files.js";
|
|
299
9
|
//# sourceMappingURL=files.js.map
|
|
300
|
-
//# debugId=
|
|
10
|
+
//# debugId=358bc01c-a706-559c-8c34-214a1610d8b5
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.js","sources":["cli/commands/files.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module cli/commands/files\n *\n * Implements the pm files command surface and its agent-facing runtime behavior.\n */\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { getActiveExtensionRegistrations } from \"../../core/extensions/index.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.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 {\n locateItem,\n mutateItem,\n readLocatedItem,\n} from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport { resolveAuthor } from \"../../core/shared/author.js\";\nimport { isPathWithinDirectory } from \"../../core/fs/path-utils.js\";\nimport type { ItemDocument, LinkedFile, LinkScope } from \"../../types/index.js\";\nimport {\n dedupeLinkedArtifacts,\n normalizeLinkedPath,\n renameArtifactsResultKey,\n runLinkedArtifacts,\n sortLinkedArtifacts,\n type LinkedArtifactResult,\n type LinkedPathValidation,\n} from \"./linked-artifacts.js\";\n\n/** Documents the files command options payload exchanged by command, SDK, and package integrations. */\nexport interface FilesCommandOptions {\n /** Value that configures or reports add for this contract. */\n add?: string[];\n /** Value that configures or reports add glob for this contract. */\n addGlob?: string[];\n /** Value that configures or reports remove for this contract. */\n remove?: string[];\n /** Value that configures or reports migrate for this contract. */\n migrate?: string[];\n /** GH-170 (pm-pfnx): standalone note applied to every --add/--add-glob link in this invocation. */\n note?: string;\n /** Value that configures or reports list for this contract. */\n list?: boolean;\n /** Value that configures or reports append stable for this contract. */\n appendStable?: boolean;\n /** Value that configures or reports validate paths for this contract. */\n validatePaths?: boolean;\n /** Value that configures or reports author for this contract. */\n author?: string;\n /** Human-readable explanation suitable for logs and agent-facing output. */\n message?: string;\n /** Value that configures or reports force for this contract. */\n force?: boolean;\n}\n\n/** Documents the files discover options payload exchanged by command, SDK, and package integrations. */\nexport interface FilesDiscoverOptions {\n /** Value that configures or reports apply for this contract. */\n apply?: boolean;\n /** Value that configures or reports append stable for this contract. */\n appendStable?: boolean;\n /** Value that configures or reports note for this contract. */\n note?: string;\n /** Value that configures or reports author for this contract. */\n author?: string;\n /** Human-readable explanation suitable for logs and agent-facing output. */\n message?: string;\n /** Value that configures or reports force for this contract. */\n force?: boolean;\n}\n\n/** Documents the files discovery candidate payload exchanged by command, SDK, and package integrations. */\nexport interface FilesDiscoveryCandidate {\n /** Filesystem path used for path resolution. */\n path: string;\n /** Value that configures or reports scope for this contract. */\n scope: LinkScope;\n /** Lifecycle state reported for status. */\n status: \"addable\" | \"already_linked\";\n /** Number of source entries represented by this result. */\n source_count: number;\n /** Value that configures or reports source fields for this contract. */\n source_fields: string[];\n /** Value that configures or reports original paths for this contract. */\n original_paths: string[];\n}\n\n/** Documents the files result payload exchanged by command, SDK, and package integrations. */\nexport interface FilesResult {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports files for this contract. */\n files: LinkedFile[];\n /** Value that configures or reports changed for this contract. */\n changed: boolean;\n /** Value that configures or reports count for this contract. */\n count: number;\n /** Value that configures or reports migrations applied for this contract. */\n migrations_applied?: number;\n /** Value that configures or reports validation for this contract. */\n validation?: LinkedPathValidation;\n}\n\n/** Documents the files discover result payload exchanged by command, SDK, and package integrations. */\nexport interface FilesDiscoverResult {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports files for this contract. */\n files: LinkedFile[];\n /** Value that configures or reports changed for this contract. */\n changed: boolean;\n /** Value that configures or reports apply for this contract. */\n apply: boolean;\n /** Value that configures or reports count for this contract. */\n count: number;\n /** Number of candidate entries represented by this result. */\n candidate_count: number;\n /** Number of addable entries represented by this result. */\n addable_count: number;\n /** Number of added entries represented by this result. */\n added_count: number;\n /** Number of skipped existing entries represented by this result. */\n skipped_existing_count: number;\n /** Value that configures or reports candidates for this contract. */\n candidates: FilesDiscoveryCandidate[];\n /** Value that configures or reports added for this contract. */\n added: LinkedFile[];\n /** Value that configures or reports skipped existing for this contract. */\n skipped_existing: FilesDiscoveryCandidate[];\n}\n\ninterface TextReference {\n field: string;\n value: string;\n}\n\ninterface RawPathReference {\n field: string;\n value: string;\n}\n\nfunction normalizeCandidatePathForOutput(value: string): string {\n return normalizeLinkedPath(path.normalize(value));\n}\n\nasync function realpathForContainment(inputPath: string): Promise<string> {\n try {\n return await fs.realpath(inputPath);\n } catch {\n return path.resolve(inputPath);\n }\n}\n\nfunction linkedFileResolvedKey(\n linkedFile: Pick<LinkedFile, \"path\" | \"scope\">,\n projectRoot: string,\n): string {\n const resolvedPath = path.isAbsolute(linkedFile.path)\n ? path.resolve(linkedFile.path)\n : path.resolve(projectRoot, linkedFile.path);\n return `${normalizeCandidatePathForOutput(resolvedPath)}::${linkedFile.scope}`;\n}\n\nfunction collectTextReferences(\n value: unknown,\n fieldPath: string,\n references: TextReference[],\n): void {\n if (typeof value === \"string\") {\n const trimmed = value.trim();\n if (trimmed.length > 0) {\n references.push({ field: fieldPath, value: trimmed });\n }\n return;\n }\n if (Array.isArray(value)) {\n value.forEach((entry, index) =>\n collectTextReferences(entry, `${fieldPath}[${index}]`, references),\n );\n return;\n }\n if (typeof value === \"object\" && value !== null) {\n for (const [key, nested] of Object.entries(value)) {\n /* c8 ignore next -- root-level object traversal always carries a non-empty field path in current callers. */\n collectTextReferences(\n nested,\n fieldPath ? `${fieldPath}.${key}` : key,\n references,\n );\n }\n }\n}\n\nfunction collectItemTextReferences(document: ItemDocument): TextReference[] {\n const references: TextReference[] = [];\n collectTextReferences(document.metadata, \"metadata\", references);\n collectTextReferences(document.body, \"body\", references);\n return references;\n}\n\nfunction cleanupPathToken(value: string): string {\n let next = value.trim();\n next = next.replace(/^[`\"'<([{]+/u, \"\");\n next = next.replace(/[`\"'>)\\]},;!?]+$/u, \"\");\n next = next.replace(/[.]+$/u, \"\");\n next = next.replace(/:(?:\\d+)(?::\\d+)?$/u, \"\");\n next = next.replace(/[.]+$/u, \"\");\n return next;\n}\n\nfunction extractRawPathReferences(\n references: TextReference[],\n): RawPathReference[] {\n const rawReferences: RawPathReference[] = [];\n const absolutePattern = /(?:[A-Za-z]:[\\\\/]|\\/)[^\\s\"'`<>()[\\]{},;]+/gu;\n const relativePattern =\n /(?:\\.{1,2}[\\\\/])?(?:(?:[A-Za-z0-9_.@-]+[\\\\/])+[A-Za-z0-9_.@-]+|[A-Za-z0-9_.@-]+\\.[A-Za-z0-9][A-Za-z0-9._-]*)/gu;\n for (const reference of references) {\n const seenInField = new Set<string>();\n for (const pattern of [absolutePattern, relativePattern]) {\n pattern.lastIndex = 0;\n for (const match of reference.value.matchAll(pattern)) {\n /* c8 ignore next -- RegExp match arrays always expose capture [0]. */\n const token = cleanupPathToken(match[0] ?? \"\");\n if (!token || seenInField.has(token)) {\n continue;\n }\n seenInField.add(token);\n rawReferences.push({ field: reference.field, value: token });\n }\n }\n }\n return rawReferences;\n}\n\nasync function resolveDiscoveredFile(\n rawPath: string,\n projectRoot: string,\n): Promise<Pick<LinkedFile, \"path\" | \"scope\"> | undefined> {\n const absolutePath = path.isAbsolute(rawPath)\n ? path.resolve(rawPath)\n : path.resolve(projectRoot, rawPath);\n let stats;\n try {\n stats = await fs.stat(absolutePath);\n } catch {\n return undefined;\n }\n if (!stats.isFile()) {\n return undefined;\n }\n const [canonicalProjectRoot, canonicalAbsolutePath] = await Promise.all([\n realpathForContainment(projectRoot),\n realpathForContainment(absolutePath),\n ]);\n if (isPathWithinDirectory(canonicalProjectRoot, canonicalAbsolutePath)) {\n const relativePath = path.relative(\n canonicalProjectRoot,\n canonicalAbsolutePath,\n );\n if (\n !relativePath ||\n relativePath.startsWith(\"..\") ||\n path.isAbsolute(relativePath)\n ) {\n return undefined;\n }\n return {\n path: normalizeCandidatePathForOutput(relativePath),\n scope: \"project\",\n };\n }\n return {\n path: normalizeCandidatePathForOutput(absolutePath),\n scope: \"global\",\n };\n}\n\nasync function discoverReferencedFiles(\n document: ItemDocument,\n projectRoot: string,\n): Promise<FilesDiscoveryCandidate[]> {\n const existingResolvedKeys = new Set(\n (document.metadata.files ?? []).map((entry) =>\n linkedFileResolvedKey(entry, projectRoot),\n ),\n );\n const grouped = new Map<\n string,\n {\n path: string;\n scope: LinkScope;\n sourceFields: Set<string>;\n originalPaths: Set<string>;\n sourceCount: number;\n }\n >();\n const rawReferences = extractRawPathReferences(\n collectItemTextReferences(document),\n );\n for (const reference of rawReferences) {\n const resolved = await resolveDiscoveredFile(reference.value, projectRoot);\n if (!resolved) {\n continue;\n }\n const key = linkedFileResolvedKey(resolved, projectRoot);\n const existing = grouped.get(key) ?? {\n path: resolved.path,\n scope: resolved.scope,\n sourceFields: new Set<string>(),\n originalPaths: new Set<string>(),\n sourceCount: 0,\n };\n existing.sourceFields.add(reference.field);\n existing.originalPaths.add(reference.value);\n existing.sourceCount += 1;\n grouped.set(key, existing);\n }\n return [...grouped.entries()]\n .map(([key, entry]) => ({\n path: entry.path,\n scope: entry.scope,\n status: existingResolvedKeys.has(key)\n ? (\"already_linked\" as const)\n : (\"addable\" as const),\n source_count: entry.sourceCount,\n source_fields: [...entry.sourceFields].sort((left, right) =>\n left.localeCompare(right),\n ),\n original_paths: [...entry.originalPaths].sort((left, right) =>\n left.localeCompare(right),\n ),\n }))\n .sort((left, right) => {\n const byStatus = left.status.localeCompare(right.status);\n if (byStatus !== 0) return byStatus;\n const byPath = left.path.localeCompare(right.path);\n if (byPath !== 0) return byPath;\n /* c8 ignore next -- path+status collisions are uncommon in deterministic fixtures. */\n return left.scope.localeCompare(right.scope);\n });\n}\n\n/** Public contract for test only, shared by SDK and presentation-layer consumers. */\nexport const _testOnly = {\n normalizeCandidatePathForOutput,\n realpathForContainment,\n linkedFileResolvedKey,\n collectTextReferences,\n collectItemTextReferences,\n cleanupPathToken,\n extractRawPathReferences,\n resolveDiscoveredFile,\n discoverReferencedFiles,\n};\n\n/** Implements run files for the public runtime surface of this module. */\nexport async function runFiles(\n id: string,\n options: FilesCommandOptions,\n global: GlobalOptions,\n): Promise<FilesResult> {\n const result: LinkedArtifactResult = await runLinkedArtifacts(\n id,\n options,\n global,\n {\n metadataKey: \"files\",\n op: \"files_add\",\n bareNoun: \"file\",\n supportsAppendStable: true,\n },\n );\n return renameArtifactsResultKey(result, \"files\") as unknown as FilesResult;\n}\n\n/** Implements run files discover for the public runtime surface of this module. */\nexport async function runFilesDiscover(\n id: string,\n options: FilesDiscoverOptions,\n global: GlobalOptions,\n): Promise<FilesDiscoverResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(\n `Tracker is not initialized at ${pmRoot}. Run pm init first.`,\n EXIT_CODE.NOT_FOUND,\n );\n }\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(\n settings,\n getActiveExtensionRegistrations(),\n );\n const located = await locateItem(\n pmRoot,\n id,\n settings.id_prefix,\n settings.item_format,\n typeRegistry.type_to_folder,\n );\n /* c8 ignore next -- not-found behavior is validated by CLI integration coverage. */\n if (!located) {\n throw new PmCliError(`Item ${id} not found`, EXIT_CODE.NOT_FOUND);\n }\n const loaded = await readLocatedItem(located, { schema: settings.schema });\n const candidates = await discoverReferencedFiles(\n loaded.document,\n process.cwd(),\n );\n const addableCandidates = candidates.filter(\n (candidate) => candidate.status === \"addable\",\n );\n const skippedExisting = candidates.filter(\n (candidate) => candidate.status === \"already_linked\",\n );\n const requestedApply = options.apply === true;\n const note = options.note?.trim() || \"discovered from item text\";\n\n if (!requestedApply || addableCandidates.length === 0) {\n const files = loaded.document.metadata.files ?? [];\n return {\n id: located.id,\n files,\n changed: false,\n apply: requestedApply,\n count: files.length,\n candidate_count: candidates.length,\n addable_count: addableCandidates.length,\n added_count: 0,\n skipped_existing_count: skippedExisting.length,\n candidates,\n added: [],\n skipped_existing: skippedExisting,\n };\n }\n\n const author = resolveAuthor(options.author, settings.author_default);\n const discoveredAdds: LinkedFile[] = addableCandidates.map((candidate) => ({\n path: candidate.path,\n scope: candidate.scope,\n note,\n }));\n const result = await mutateItem({\n pmRoot,\n settings,\n id,\n op: \"files_discover\",\n author,\n message: options.message ?? \"Discover referenced file links\",\n force: options.force,\n mutate(document) {\n const next = [...(document.metadata.files ?? [])];\n const existingResolvedKeys = new Set(\n next.map((entry) => linkedFileResolvedKey(entry, process.cwd())),\n );\n const appliedAdds: LinkedFile[] = [];\n for (const add of discoveredAdds) {\n const resolvedKey = linkedFileResolvedKey(add, process.cwd());\n /* c8 ignore next -- duplicate-key race paths are exercised in broader CLI race tests. */\n if (existingResolvedKeys.has(resolvedKey)) {\n continue;\n }\n next.push(add);\n existingResolvedKeys.add(resolvedKey);\n appliedAdds.push(add);\n }\n const deduped = dedupeLinkedArtifacts(next);\n /* c8 ignore next -- appendStable branch is covered through runFiles command contract tests. */\n const normalized = options.appendStable\n ? deduped\n : sortLinkedArtifacts(deduped);\n if (normalized.length > 0) {\n document.metadata.files = normalized;\n } else {\n delete document.metadata.files;\n }\n return {\n /* c8 ignore next -- no-op mutation responses may emit empty changedFields for skipped discover batches. */\n changedFields: appliedAdds.length > 0 ? [\"files\"] : [],\n /* c8 ignore next -- warning emission is exercised by race-aware integration tests. */\n warnings:\n appliedAdds.length !== discoveredAdds.length\n ? [\n `files_discover_skipped_existing:${discoveredAdds.length - appliedAdds.length}`,\n ]\n : [],\n };\n },\n });\n\n const files = result.item.files ?? [];\n const addedResolvedKeys = new Set(\n discoveredAdds.map((entry) => linkedFileResolvedKey(entry, process.cwd())),\n );\n const added = files.filter((entry) =>\n addedResolvedKeys.has(linkedFileResolvedKey(entry, process.cwd())),\n );\n return {\n id: result.item.id,\n files,\n changed: added.length > 0,\n apply: true,\n count: files.length,\n candidate_count: candidates.length,\n addable_count: addableCandidates.length,\n added_count: added.length,\n skipped_existing_count: skippedExisting.length,\n candidates,\n added,\n skipped_existing: skippedExisting,\n };\n}\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EACL,UAAU,EACV,UAAU,EACV,eAAe,GAChB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,wBAAwB,EACxB,kBAAkB,EAClB,mBAAmB,GAGpB,MAAM,uBAAuB,CAAC;AAkH/B,SAAS,+BAA+B,CAAC,KAAa;IACpD,OAAO,mBAAmB,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;AACpD,CAAC;AAED,KAAK,UAAU,sBAAsB,CAAC,SAAiB;IACrD,IAAI,CAAC;QACH,OAAO,MAAM,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IACtC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;I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KAAK,EAAE,EAAE,CAAC,qBAAqB,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAC3E,CAAC;IACF,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CACnC,iBAAiB,CAAC,GAAG,CAAC,qBAAqB,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CACnE,CAAC;IACF,OAAO;QACL,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE;QAClB,KAAK;QACL,OAAO,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC;QACzB,KAAK,EAAE,IAAI;QACX,KAAK,EAAE,KAAK,CAAC,MAAM;QACnB,eAAe,EAAE,UAAU,CAAC,MAAM;QAClC,aAAa,EAAE,iBAAiB,CAAC,MAAM;QACvC,WAAW,EAAE,KAAK,CAAC,MAAM;QACzB,sBAAsB,EAAE,eAAe,CAAC,MAAM;QAC9C,UAAU;QACV,KAAK;QACL,gBAAgB,EAAE,eAAe;KAClC,CAAC;AACJ,CAAC","debugId":"3a8f4027-c8bd-5e07-ba5f-edcf43224e09"}
|
|
1
|
+
{"version":3,"file":"files.js","sources":["cli/commands/files.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module cli/commands/files\n *\n * Re-exports the public SDK file-link primitive for CLI presentation wiring.\n */\nexport * from \"../../sdk/files.js\";\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,cAAc,oBAAoB,CAAC","debugId":"358bc01c-a706-559c-8c34-214a1610d8b5"}
|
package/dist/cli/commands/get.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Implements the pm get command surface and its agent-facing runtime behavior.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!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]="
|
|
7
|
+
!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]="233ec299-06cd-50e0-8ff5-bfbd40fe8bb2")}catch(e){}}();
|
|
8
8
|
import { pathExists } from "../../core/fs/fs-utils.js";
|
|
9
9
|
import { getActiveExtensionRegistrations } from "../../core/extensions/index.js";
|
|
10
10
|
import { toItemRecord } from "../../core/item/item-record.js";
|
|
@@ -16,6 +16,7 @@ import { PmCliError } from "../../core/shared/errors.js";
|
|
|
16
16
|
import { buildItemNotFoundError, listAllItemMetadataLight, locateItem, readLocatedItem, } from "../../core/store/item-store.js";
|
|
17
17
|
import { getHistoryPath, getSettingsPath, resolvePmRoot, } from "../../core/store/paths.js";
|
|
18
18
|
import { readSettings } from "../../core/store/settings.js";
|
|
19
|
+
import { recordContextUsageTouches } from "../../sdk/context-usage.js";
|
|
19
20
|
import { parseIntegerLimit } from "../shared-parsers.js";
|
|
20
21
|
import { readHistoryEntries } from "./history.js";
|
|
21
22
|
import { runList } from "./list.js";
|
|
@@ -304,7 +305,19 @@ export async function runGet(id, global, options = {}) {
|
|
|
304
305
|
}
|
|
305
306
|
result.children = await buildGetChildrenRollup(context, includeChildren);
|
|
306
307
|
result.tree = await buildGetTree(context, options, projection.treeDepth, global);
|
|
308
|
+
try {
|
|
309
|
+
await recordContextUsageTouches({
|
|
310
|
+
pmRoot: context.pmRoot,
|
|
311
|
+
author: (process.env.PM_AUTHOR ?? context.settings.author_default).trim() ||
|
|
312
|
+
"unknown",
|
|
313
|
+
itemIds: [context.locatedId],
|
|
314
|
+
intent: "get",
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
catch {
|
|
318
|
+
// Derived usage feedback must never make the source-of-truth read fail.
|
|
319
|
+
}
|
|
307
320
|
return result;
|
|
308
321
|
}
|
|
309
322
|
//# sourceMappingURL=get.js.map
|
|
310
|
-
//# debugId=
|
|
323
|
+
//# debugId=233ec299-06cd-50e0-8ff5-bfbd40fe8bb2
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get.js","sources":["cli/commands/get.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module cli/commands/get\n *\n * Implements the pm get command surface and its agent-facing runtime behavior.\n */\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { getActiveExtensionRegistrations } from \"../../core/extensions/index.js\";\nimport { toItemRecord } from \"../../core/item/item-record.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport {\n resolveRuntimeFieldRegistry,\n resolveRuntimeStatusRegistry,\n} from \"../../core/schema/runtime-schema.js\";\nimport { isTerminalStatus } from \"../../core/item/status.js\";\nimport {\n EXIT_CODE,\n ITEM_METADATA_KEY_ORDER,\n} from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport {\n buildItemNotFoundError,\n listAllItemMetadataLight,\n locateItem,\n readLocatedItem,\n} from \"../../core/store/item-store.js\";\nimport {\n getHistoryPath,\n getSettingsPath,\n resolvePmRoot,\n} from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport { parseIntegerLimit } from \"../shared-parsers.js\";\nimport type {\n ItemMetadata,\n LinkedDoc,\n LinkedFile,\n LinkedTest,\n} from \"../../types/index.js\";\nimport { readHistoryEntries } from \"./history.js\";\nimport { runList } from \"./list.js\";\n\ninterface ClaimHistoryContext {\n ts: string;\n author: string;\n message: string | null;\n}\n\ninterface ClaimHistoryEntry {\n op: string;\n ts: string;\n author: string;\n message?: string;\n}\n\ninterface ClaimStateContext {\n claimed: boolean;\n assignee: string | null;\n last_claim: ClaimHistoryContext | null;\n last_release: ClaimHistoryContext | null;\n}\n\ninterface ChildRollupContext {\n count: number;\n active: number;\n by_status: Record<string, number>;\n}\n\n// GH-155 (pm-gcm3): only container types get the inline child rollup so leaf\n// item reads keep avoiding the corpus scan that the rollup requires.\nconst CHILD_ROLLUP_TYPES = new Set([\"milestone\", \"epic\"]);\n\n/** Documents the get result payload exchanged by command, SDK, and package integrations. */\nexport interface GetResult {\n // `body` lives inside `item` (alongside `description`/`acceptance_criteria`)\n // for parity with `pm list --include-body`, so agents reliably find it at\n // `.item.body` in JSON output instead of a top-level sibling.\n /** Value that configures or reports item for this contract. */\n item: Partial<ItemMetadata> & { body?: string };\n /** Value that configures or reports linked for this contract. */\n linked?: {\n files: LinkedFile[];\n tests: LinkedTest[];\n docs: LinkedDoc[];\n };\n /** Value that configures or reports claim state for this contract. */\n claim_state?: ClaimStateContext;\n /** Value that configures or reports children for this contract. */\n children?: ChildRollupContext;\n /** Value that configures or reports tree for this contract. */\n tree?: {\n root_id: string;\n root_title: string | null;\n depth_limit: number | null;\n count: number;\n items: Record<string, unknown>[];\n };\n}\n\nconst GET_DEPTH_VALUES = [\"brief\", \"standard\", \"deep\"] as const;\n\ntype GetDepth = (typeof GET_DEPTH_VALUES)[number];\n\n/** Documents the get options payload exchanged by command, SDK, and package integrations. */\nexport interface GetOptions {\n /** Value that configures or reports depth for this contract. */\n depth?: string;\n /** Value that configures or reports fields for this contract. */\n fields?: string;\n /** Value that configures or reports full for this contract. */\n full?: boolean;\n /** Value that configures or reports tree for this contract. */\n tree?: boolean;\n /** Value that configures or reports tree depth for this contract. */\n treeDepth?: string;\n}\n\nfunction toClaimHistoryContext(entry: ClaimHistoryEntry): ClaimHistoryContext {\n return {\n ts: entry.ts,\n author: entry.author,\n message: entry.message ?? null,\n };\n}\n\nfunction resolveClaimStateContext(\n assigneeValue: string | undefined,\n history: ClaimHistoryEntry[],\n): ClaimStateContext {\n const assignee = assigneeValue?.trim();\n const normalizedAssignee = assignee && assignee.length > 0 ? assignee : null;\n const lastClaim = [...history]\n .reverse()\n .find((entry) => entry.op === \"claim\");\n const lastRelease = [...history]\n .reverse()\n .find((entry) => entry.op === \"release\");\n return {\n claimed: normalizedAssignee !== null,\n assignee: normalizedAssignee,\n last_claim: lastClaim ? toClaimHistoryContext(lastClaim) : null,\n last_release: lastRelease ? toClaimHistoryContext(lastRelease) : null,\n };\n}\n\nfunction parseGetDepth(raw: string | undefined): GetDepth {\n if (raw === undefined || raw.trim().length === 0) {\n return \"standard\";\n }\n const normalized = raw.trim().toLowerCase();\n if (normalized === \"full\") {\n return \"deep\";\n }\n if (GET_DEPTH_VALUES.includes(normalized as GetDepth)) {\n return normalized as GetDepth;\n }\n throw new PmCliError(\n \"Get --depth must be one of brief|standard|deep|full\",\n EXIT_CODE.USAGE,\n );\n}\n\nfunction projectItemForDepth(\n item: ItemMetadata,\n depth: GetDepth,\n): Partial<ItemMetadata> {\n if (depth === \"deep\") {\n return item;\n }\n const {\n comments: _comments,\n notes: _notes,\n learnings: _learnings,\n files: _files,\n tests: _tests,\n docs: _docs,\n reminders: _reminders,\n events: _events,\n ...projected\n } = item;\n return projected;\n}\n\nfunction parseGetFields(raw: string | undefined): string[] | null {\n if (raw === undefined) {\n return null;\n }\n const fields = raw\n .split(\",\")\n .map((entry) => entry.trim())\n .filter((entry) => entry.length > 0);\n if (fields.length === 0) {\n throw new PmCliError(\n \"Get --fields requires a comma-separated list of field names\",\n EXIT_CODE.USAGE,\n );\n }\n return fields;\n}\n\nfunction normalizeGetField(field: string): string {\n return field.startsWith(\"item.\") ? field.slice(\"item.\".length) : field;\n}\n\nfunction validateGetFields(\n fields: string[] | null,\n runtimeMetadataKeys: Iterable<string>,\n): void {\n if (fields === null) {\n return;\n }\n const itemFields = new Set([\n ...ITEM_METADATA_KEY_ORDER,\n ...runtimeMetadataKeys,\n ]);\n const allowedRootFields = new Set([\n \"body\",\n \"linked\",\n \"claim_state\",\n \"children\",\n ]);\n const allowedLinkedFields = new Set([\n \"linked.files\",\n \"linked.tests\",\n \"linked.docs\",\n ]);\n const allowedClaimStateFields = new Set([\n \"claim_state.claimed\",\n \"claim_state.assignee\",\n \"claim_state.last_claim\",\n \"claim_state.last_release\",\n ]);\n const unknown = fields.filter((field) => {\n const normalized = normalizeGetField(field);\n return (\n !itemFields.has(normalized) &&\n !allowedRootFields.has(normalized) &&\n !allowedLinkedFields.has(normalized) &&\n !allowedClaimStateFields.has(normalized)\n );\n });\n if (unknown.length > 0) {\n throw new PmCliError(\n `Unknown get --fields value(s): ${unknown.join(\", \")}`,\n EXIT_CODE.USAGE,\n {\n code: \"unknown_field_projection\",\n examples: [\n \"pm get <id> --fields id,title,status,type,updated_at\",\n \"pm get <id> --fields id,title,claim_state\",\n \"pm get <id> --fields id,title,body,linked.files\",\n ],\n },\n );\n }\n}\n\nfunction projectItemForFields(\n item: ItemMetadata,\n fields: string[],\n): Partial<ItemMetadata> {\n const source = toItemRecord(item);\n const projected: Record<string, unknown> = {};\n for (const field of fields) {\n const normalized = field.startsWith(\"item.\")\n ? field.slice(\"item.\".length)\n : field;\n if (\n normalized === \"body\" ||\n normalized === \"linked\" ||\n normalized.startsWith(\"linked.\")\n ) {\n continue;\n }\n projected[normalized] = source[normalized];\n }\n return projected as Partial<ItemMetadata>;\n}\n\nfunction fieldsInclude(fields: string[] | null, name: string): boolean {\n return (\n fields?.some((field) => field === name || field === `item.${name}`) ?? false\n );\n}\n\nfunction fieldsIncludeRoot(fields: string[], name: string): boolean {\n return fields.some((field) => field === name || field.startsWith(`${name}.`));\n}\n\ninterface ResolvedGetProjection {\n depth: GetDepth;\n treeDepth: number | undefined;\n fields: string[] | null;\n fieldProjection: boolean;\n}\n\ninterface GetItemContext {\n pmRoot: string;\n settings: Awaited<ReturnType<typeof readSettings>>;\n typeToFolder: Record<string, string>;\n locatedId: string;\n metadata: ItemMetadata;\n body: string;\n}\n\nfunction resolveGetProjection(options: GetOptions): ResolvedGetProjection {\n if (\n options.full &&\n (options.fields !== undefined || options.depth !== undefined)\n ) {\n throw new PmCliError(\n \"Get projection options are mutually exclusive; remove the extra projection flag and retry.\",\n EXIT_CODE.USAGE,\n );\n }\n if (options.tree !== true && options.treeDepth !== undefined) {\n throw new PmCliError(\"Get --tree-depth requires --tree\", EXIT_CODE.USAGE);\n }\n return {\n depth: options.full ? \"deep\" : parseGetDepth(options.depth),\n treeDepth:\n options.tree === true\n ? parseIntegerLimit(options.treeDepth, \"--tree-depth\")\n : undefined,\n fields: parseGetFields(options.fields),\n fieldProjection: options.fields !== undefined,\n };\n}\n\nasync function loadGetItemContext(\n id: string,\n global: GlobalOptions,\n): Promise<GetItemContext> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(\n `Tracker is not initialized at ${pmRoot}. Run pm init first.`,\n EXIT_CODE.NOT_FOUND,\n );\n }\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(\n settings,\n getActiveExtensionRegistrations(),\n );\n const located = await locateItem(\n pmRoot,\n id,\n settings.id_prefix,\n settings.item_format,\n typeRegistry.type_to_folder,\n );\n if (!located) {\n throw await buildItemNotFoundError(\n pmRoot,\n id,\n settings.id_prefix,\n typeRegistry.type_to_folder,\n );\n }\n const loaded = await readLocatedItem(located, { schema: settings.schema });\n return {\n pmRoot,\n settings,\n typeToFolder: typeRegistry.type_to_folder,\n locatedId: located.id,\n metadata: loaded.document.metadata,\n body: loaded.document.body,\n };\n}\n\nfunction validateGetProjectionFields(\n fields: string[] | null,\n settings: Awaited<ReturnType<typeof readSettings>>,\n): void {\n const runtimeMetadataKeys = resolveRuntimeFieldRegistry(\n settings.schema,\n ).definitions.map((field) => field.metadata_key);\n validateGetFields(fields, runtimeMetadataKeys);\n}\n\nfunction shouldIncludeGetField(params: {\n fieldProjection: boolean;\n depth: GetDepth;\n fields: string[] | null;\n field: \"body\" | \"linked\" | \"claim_state\" | \"children\";\n itemType?: string;\n}): boolean {\n const { fieldProjection, depth, fields, field, itemType } = params;\n if (fieldProjection) {\n if (field === \"body\" || field === \"linked\") {\n return fieldsInclude(fields, field);\n }\n return fieldsIncludeRoot(fields as string[], field);\n }\n if (field === \"children\") {\n return depth !== \"brief\" && CHILD_ROLLUP_TYPES.has(itemType as string);\n }\n return depth !== \"brief\";\n}\n\nasync function resolveGetClaimState(\n context: GetItemContext,\n includeClaimState: boolean,\n): Promise<ClaimStateContext | undefined> {\n if (!includeClaimState) {\n return undefined;\n }\n const historyPath = getHistoryPath(context.pmRoot, context.locatedId);\n const history = await readHistoryEntries(historyPath, context.locatedId);\n return resolveClaimStateContext(context.metadata.assignee, history);\n}\n\nfunction attachGetLinked(\n result: GetResult,\n context: GetItemContext,\n fields: string[] | null,\n includeLinked: boolean,\n): void {\n const includeLinkedFiles =\n includeLinked || fieldsInclude(fields, \"linked.files\");\n const includeLinkedTests =\n includeLinked || fieldsInclude(fields, \"linked.tests\");\n const includeLinkedDocs =\n includeLinked || fieldsInclude(fields, \"linked.docs\");\n if (\n !includeLinked &&\n !includeLinkedFiles &&\n !includeLinkedTests &&\n !includeLinkedDocs\n ) {\n return;\n }\n result.linked = {\n files: includeLinkedFiles ? (context.metadata.files ?? []) : [],\n tests: includeLinkedTests ? (context.metadata.tests ?? []) : [],\n docs: includeLinkedDocs ? (context.metadata.docs ?? []) : [],\n };\n}\n\nasync function buildGetChildrenRollup(\n context: GetItemContext,\n includeChildren: boolean,\n): Promise<ChildRollupContext | undefined> {\n if (!includeChildren) {\n return undefined;\n }\n const statusRegistry = resolveRuntimeStatusRegistry(context.settings.schema);\n const corpus = await listAllItemMetadataLight(\n context.pmRoot,\n context.settings.item_format,\n context.typeToFolder,\n undefined,\n context.settings.schema,\n );\n const byStatus: Record<string, number> = {};\n let active = 0;\n let count = 0;\n const locatedId = context.locatedId.trim().toLowerCase();\n for (const candidate of corpus) {\n const parentId =\n typeof candidate.parent === \"string\"\n ? candidate.parent.trim().toLowerCase()\n : \"\";\n if (parentId !== locatedId) continue;\n const candidateStatus = candidate.status.trim().toLowerCase();\n count += 1;\n byStatus[candidateStatus] = (byStatus[candidateStatus] ?? 0) + 1;\n if (!isTerminalStatus(candidateStatus, statusRegistry)) {\n active += 1;\n }\n }\n return { count, active, by_status: byStatus };\n}\n\nasync function buildGetTree(\n context: GetItemContext,\n options: GetOptions,\n treeDepth: number | undefined,\n global: GlobalOptions,\n): Promise<GetResult[\"tree\"] | undefined> {\n if (options.tree !== true) {\n return undefined;\n }\n const subtree = await runList(\n undefined,\n {\n parent: context.locatedId,\n tree: true,\n treeDepth: treeDepth === undefined ? undefined : String(treeDepth),\n full: true,\n },\n global,\n );\n return {\n root_id: context.locatedId,\n root_title: context.metadata.title,\n depth_limit: treeDepth ?? null,\n count: subtree.count,\n items: subtree.items.map((entry) => toItemRecord(entry)),\n };\n}\n\n/** Implements run get for the public runtime surface of this module. */\nexport async function runGet(\n id: string,\n global: GlobalOptions,\n options: GetOptions = {},\n): Promise<GetResult> {\n const projection = resolveGetProjection(options);\n const context = await loadGetItemContext(id, global);\n validateGetProjectionFields(projection.fields, context.settings);\n const includeBody = shouldIncludeGetField({ ...projection, field: \"body\" });\n const includeLinked = shouldIncludeGetField({\n ...projection,\n field: \"linked\",\n });\n const includeClaimState = shouldIncludeGetField({\n ...projection,\n field: \"claim_state\",\n });\n const itemType = context.metadata.type.trim().toLowerCase();\n const includeChildren = shouldIncludeGetField({\n ...projection,\n field: \"children\",\n itemType,\n });\n const claimState = await resolveGetClaimState(context, includeClaimState);\n const result: GetResult = {\n item: projection.fieldProjection\n ? projectItemForFields(context.metadata, projection.fields as string[])\n : projectItemForDepth(context.metadata, projection.depth),\n };\n if (includeBody) {\n result.item.body = context.body;\n }\n attachGetLinked(result, context, projection.fields, includeLinked);\n if (claimState) {\n result.claim_state = claimState;\n }\n result.children = await buildGetChildrenRollup(context, includeChildren);\n result.tree = await buildGetTree(\n context,\n options,\n projection.treeDepth,\n global,\n );\n return result;\n}\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACv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module cli/commands/get\n *\n * Implements the pm get command surface and its agent-facing runtime behavior.\n */\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { getActiveExtensionRegistrations } from \"../../core/extensions/index.js\";\nimport { toItemRecord } from \"../../core/item/item-record.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport {\n resolveRuntimeFieldRegistry,\n resolveRuntimeStatusRegistry,\n} from \"../../core/schema/runtime-schema.js\";\nimport { isTerminalStatus } from \"../../core/item/status.js\";\nimport {\n EXIT_CODE,\n ITEM_METADATA_KEY_ORDER,\n} from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport {\n buildItemNotFoundError,\n listAllItemMetadataLight,\n locateItem,\n readLocatedItem,\n} from \"../../core/store/item-store.js\";\nimport {\n getHistoryPath,\n getSettingsPath,\n resolvePmRoot,\n} from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport { recordContextUsageTouches } from \"../../sdk/context-usage.js\";\nimport { parseIntegerLimit } from \"../shared-parsers.js\";\nimport type {\n ItemMetadata,\n LinkedDoc,\n LinkedFile,\n LinkedTest,\n} from \"../../types/index.js\";\nimport { readHistoryEntries } from \"./history.js\";\nimport { runList } from \"./list.js\";\n\ninterface ClaimHistoryContext {\n ts: string;\n author: string;\n message: string | null;\n}\n\ninterface ClaimHistoryEntry {\n op: string;\n ts: string;\n author: string;\n message?: string;\n}\n\ninterface ClaimStateContext {\n claimed: boolean;\n assignee: string | null;\n last_claim: ClaimHistoryContext | null;\n last_release: ClaimHistoryContext | null;\n}\n\ninterface ChildRollupContext {\n count: number;\n active: number;\n by_status: Record<string, number>;\n}\n\n// GH-155 (pm-gcm3): only container types get the inline child rollup so leaf\n// item reads keep avoiding the corpus scan that the rollup requires.\nconst CHILD_ROLLUP_TYPES = new Set([\"milestone\", \"epic\"]);\n\n/** Documents the get result payload exchanged by command, SDK, and package integrations. */\nexport interface GetResult {\n // `body` lives inside `item` (alongside `description`/`acceptance_criteria`)\n // for parity with `pm list --include-body`, so agents reliably find it at\n // `.item.body` in JSON output instead of a top-level sibling.\n /** Value that configures or reports item for this contract. */\n item: Partial<ItemMetadata> & { body?: string };\n /** Value that configures or reports linked for this contract. */\n linked?: {\n files: LinkedFile[];\n tests: LinkedTest[];\n docs: LinkedDoc[];\n };\n /** Value that configures or reports claim state for this contract. */\n claim_state?: ClaimStateContext;\n /** Value that configures or reports children for this contract. */\n children?: ChildRollupContext;\n /** Value that configures or reports tree for this contract. */\n tree?: {\n root_id: string;\n root_title: string | null;\n depth_limit: number | null;\n count: number;\n items: Record<string, unknown>[];\n };\n}\n\nconst GET_DEPTH_VALUES = [\"brief\", \"standard\", \"deep\"] as const;\n\ntype GetDepth = (typeof GET_DEPTH_VALUES)[number];\n\n/** Documents the get options payload exchanged by command, SDK, and package integrations. */\nexport interface GetOptions {\n /** Value that configures or reports depth for this contract. */\n depth?: string;\n /** Value that configures or reports fields for this contract. */\n fields?: string;\n /** Value that configures or reports full for this contract. */\n full?: boolean;\n /** Value that configures or reports tree for this contract. */\n tree?: boolean;\n /** Value that configures or reports tree depth for this contract. */\n treeDepth?: string;\n}\n\nfunction toClaimHistoryContext(entry: ClaimHistoryEntry): ClaimHistoryContext {\n return {\n ts: entry.ts,\n author: entry.author,\n message: entry.message ?? null,\n };\n}\n\nfunction resolveClaimStateContext(\n assigneeValue: string | undefined,\n history: ClaimHistoryEntry[],\n): ClaimStateContext {\n const assignee = assigneeValue?.trim();\n const normalizedAssignee = assignee && assignee.length > 0 ? assignee : null;\n const lastClaim = [...history]\n .reverse()\n .find((entry) => entry.op === \"claim\");\n const lastRelease = [...history]\n .reverse()\n .find((entry) => entry.op === \"release\");\n return {\n claimed: normalizedAssignee !== null,\n assignee: normalizedAssignee,\n last_claim: lastClaim ? toClaimHistoryContext(lastClaim) : null,\n last_release: lastRelease ? toClaimHistoryContext(lastRelease) : null,\n };\n}\n\nfunction parseGetDepth(raw: string | undefined): GetDepth {\n if (raw === undefined || raw.trim().length === 0) {\n return \"standard\";\n }\n const normalized = raw.trim().toLowerCase();\n if (normalized === \"full\") {\n return \"deep\";\n }\n if (GET_DEPTH_VALUES.includes(normalized as GetDepth)) {\n return normalized as GetDepth;\n }\n throw new PmCliError(\n \"Get --depth must be one of brief|standard|deep|full\",\n EXIT_CODE.USAGE,\n );\n}\n\nfunction projectItemForDepth(\n item: ItemMetadata,\n depth: GetDepth,\n): Partial<ItemMetadata> {\n if (depth === \"deep\") {\n return item;\n }\n const {\n comments: _comments,\n notes: _notes,\n learnings: _learnings,\n files: _files,\n tests: _tests,\n docs: _docs,\n reminders: _reminders,\n events: _events,\n ...projected\n } = item;\n return projected;\n}\n\nfunction parseGetFields(raw: string | undefined): string[] | null {\n if (raw === undefined) {\n return null;\n }\n const fields = raw\n .split(\",\")\n .map((entry) => entry.trim())\n .filter((entry) => entry.length > 0);\n if (fields.length === 0) {\n throw new PmCliError(\n \"Get --fields requires a comma-separated list of field names\",\n EXIT_CODE.USAGE,\n );\n }\n return fields;\n}\n\nfunction normalizeGetField(field: string): string {\n return field.startsWith(\"item.\") ? field.slice(\"item.\".length) : field;\n}\n\nfunction validateGetFields(\n fields: string[] | null,\n runtimeMetadataKeys: Iterable<string>,\n): void {\n if (fields === null) {\n return;\n }\n const itemFields = new Set([\n ...ITEM_METADATA_KEY_ORDER,\n ...runtimeMetadataKeys,\n ]);\n const allowedRootFields = new Set([\n \"body\",\n \"linked\",\n \"claim_state\",\n \"children\",\n ]);\n const allowedLinkedFields = new Set([\n \"linked.files\",\n \"linked.tests\",\n \"linked.docs\",\n ]);\n const allowedClaimStateFields = new Set([\n \"claim_state.claimed\",\n \"claim_state.assignee\",\n \"claim_state.last_claim\",\n \"claim_state.last_release\",\n ]);\n const unknown = fields.filter((field) => {\n const normalized = normalizeGetField(field);\n return (\n !itemFields.has(normalized) &&\n !allowedRootFields.has(normalized) &&\n !allowedLinkedFields.has(normalized) &&\n !allowedClaimStateFields.has(normalized)\n );\n });\n if (unknown.length > 0) {\n throw new PmCliError(\n `Unknown get --fields value(s): ${unknown.join(\", \")}`,\n EXIT_CODE.USAGE,\n {\n code: \"unknown_field_projection\",\n examples: [\n \"pm get <id> --fields id,title,status,type,updated_at\",\n \"pm get <id> --fields id,title,claim_state\",\n \"pm get <id> --fields id,title,body,linked.files\",\n ],\n },\n );\n }\n}\n\nfunction projectItemForFields(\n item: ItemMetadata,\n fields: string[],\n): Partial<ItemMetadata> {\n const source = toItemRecord(item);\n const projected: Record<string, unknown> = {};\n for (const field of fields) {\n const normalized = field.startsWith(\"item.\")\n ? field.slice(\"item.\".length)\n : field;\n if (\n normalized === \"body\" ||\n normalized === \"linked\" ||\n normalized.startsWith(\"linked.\")\n ) {\n continue;\n }\n projected[normalized] = source[normalized];\n }\n return projected as Partial<ItemMetadata>;\n}\n\nfunction fieldsInclude(fields: string[] | null, name: string): boolean {\n return (\n fields?.some((field) => field === name || field === `item.${name}`) ?? false\n );\n}\n\nfunction fieldsIncludeRoot(fields: string[], name: string): boolean {\n return fields.some((field) => field === name || field.startsWith(`${name}.`));\n}\n\ninterface ResolvedGetProjection {\n depth: GetDepth;\n treeDepth: number | undefined;\n fields: string[] | null;\n fieldProjection: boolean;\n}\n\ninterface GetItemContext {\n pmRoot: string;\n settings: Awaited<ReturnType<typeof readSettings>>;\n typeToFolder: Record<string, string>;\n locatedId: string;\n metadata: ItemMetadata;\n body: string;\n}\n\nfunction resolveGetProjection(options: GetOptions): ResolvedGetProjection {\n if (\n options.full &&\n (options.fields !== undefined || options.depth !== undefined)\n ) {\n throw new PmCliError(\n \"Get projection options are mutually exclusive; remove the extra projection flag and retry.\",\n EXIT_CODE.USAGE,\n );\n }\n if (options.tree !== true && options.treeDepth !== undefined) {\n throw new PmCliError(\"Get --tree-depth requires --tree\", EXIT_CODE.USAGE);\n }\n return {\n depth: options.full ? \"deep\" : parseGetDepth(options.depth),\n treeDepth:\n options.tree === true\n ? parseIntegerLimit(options.treeDepth, \"--tree-depth\")\n : undefined,\n fields: parseGetFields(options.fields),\n fieldProjection: options.fields !== undefined,\n };\n}\n\nasync function loadGetItemContext(\n id: string,\n global: GlobalOptions,\n): Promise<GetItemContext> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(\n `Tracker is not initialized at ${pmRoot}. Run pm init first.`,\n EXIT_CODE.NOT_FOUND,\n );\n }\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(\n settings,\n getActiveExtensionRegistrations(),\n );\n const located = await locateItem(\n pmRoot,\n id,\n settings.id_prefix,\n settings.item_format,\n typeRegistry.type_to_folder,\n );\n if (!located) {\n throw await buildItemNotFoundError(\n pmRoot,\n id,\n settings.id_prefix,\n typeRegistry.type_to_folder,\n );\n }\n const loaded = await readLocatedItem(located, { schema: settings.schema });\n return {\n pmRoot,\n settings,\n typeToFolder: typeRegistry.type_to_folder,\n locatedId: located.id,\n metadata: loaded.document.metadata,\n body: loaded.document.body,\n };\n}\n\nfunction validateGetProjectionFields(\n fields: string[] | null,\n settings: Awaited<ReturnType<typeof readSettings>>,\n): void {\n const runtimeMetadataKeys = resolveRuntimeFieldRegistry(\n settings.schema,\n ).definitions.map((field) => field.metadata_key);\n validateGetFields(fields, runtimeMetadataKeys);\n}\n\nfunction shouldIncludeGetField(params: {\n fieldProjection: boolean;\n depth: GetDepth;\n fields: string[] | null;\n field: \"body\" | \"linked\" | \"claim_state\" | \"children\";\n itemType?: string;\n}): boolean {\n const { fieldProjection, depth, fields, field, itemType } = params;\n if (fieldProjection) {\n if (field === \"body\" || field === \"linked\") {\n return fieldsInclude(fields, field);\n }\n return fieldsIncludeRoot(fields as string[], field);\n }\n if (field === \"children\") {\n return depth !== \"brief\" && CHILD_ROLLUP_TYPES.has(itemType as string);\n }\n return depth !== \"brief\";\n}\n\nasync function resolveGetClaimState(\n context: GetItemContext,\n includeClaimState: boolean,\n): Promise<ClaimStateContext | undefined> {\n if (!includeClaimState) {\n return undefined;\n }\n const historyPath = getHistoryPath(context.pmRoot, context.locatedId);\n const history = await readHistoryEntries(historyPath, context.locatedId);\n return resolveClaimStateContext(context.metadata.assignee, history);\n}\n\nfunction attachGetLinked(\n result: GetResult,\n context: GetItemContext,\n fields: string[] | null,\n includeLinked: boolean,\n): void {\n const includeLinkedFiles =\n includeLinked || fieldsInclude(fields, \"linked.files\");\n const includeLinkedTests =\n includeLinked || fieldsInclude(fields, \"linked.tests\");\n const includeLinkedDocs =\n includeLinked || fieldsInclude(fields, \"linked.docs\");\n if (\n !includeLinked &&\n !includeLinkedFiles &&\n !includeLinkedTests &&\n !includeLinkedDocs\n ) {\n return;\n }\n result.linked = {\n files: includeLinkedFiles ? (context.metadata.files ?? []) : [],\n tests: includeLinkedTests ? (context.metadata.tests ?? []) : [],\n docs: includeLinkedDocs ? (context.metadata.docs ?? []) : [],\n };\n}\n\nasync function buildGetChildrenRollup(\n context: GetItemContext,\n includeChildren: boolean,\n): Promise<ChildRollupContext | undefined> {\n if (!includeChildren) {\n return undefined;\n }\n const statusRegistry = resolveRuntimeStatusRegistry(context.settings.schema);\n const corpus = await listAllItemMetadataLight(\n context.pmRoot,\n context.settings.item_format,\n context.typeToFolder,\n undefined,\n context.settings.schema,\n );\n const byStatus: Record<string, number> = {};\n let active = 0;\n let count = 0;\n const locatedId = context.locatedId.trim().toLowerCase();\n for (const candidate of corpus) {\n const parentId =\n typeof candidate.parent === \"string\"\n ? candidate.parent.trim().toLowerCase()\n : \"\";\n if (parentId !== locatedId) continue;\n const candidateStatus = candidate.status.trim().toLowerCase();\n count += 1;\n byStatus[candidateStatus] = (byStatus[candidateStatus] ?? 0) + 1;\n if (!isTerminalStatus(candidateStatus, statusRegistry)) {\n active += 1;\n }\n }\n return { count, active, by_status: byStatus };\n}\n\nasync function buildGetTree(\n context: GetItemContext,\n options: GetOptions,\n treeDepth: number | undefined,\n global: GlobalOptions,\n): Promise<GetResult[\"tree\"] | undefined> {\n if (options.tree !== true) {\n return undefined;\n }\n const subtree = await runList(\n undefined,\n {\n parent: context.locatedId,\n tree: true,\n treeDepth: treeDepth === undefined ? undefined : String(treeDepth),\n full: true,\n },\n global,\n );\n return {\n root_id: context.locatedId,\n root_title: context.metadata.title,\n depth_limit: treeDepth ?? null,\n count: subtree.count,\n items: subtree.items.map((entry) => toItemRecord(entry)),\n };\n}\n\n/** Implements run get for the public runtime surface of this module. */\nexport async function runGet(\n id: string,\n global: GlobalOptions,\n options: GetOptions = {},\n): Promise<GetResult> {\n const projection = resolveGetProjection(options);\n const context = await loadGetItemContext(id, global);\n validateGetProjectionFields(projection.fields, context.settings);\n const includeBody = shouldIncludeGetField({ ...projection, field: \"body\" });\n const includeLinked = shouldIncludeGetField({\n ...projection,\n field: \"linked\",\n });\n const includeClaimState = shouldIncludeGetField({\n ...projection,\n field: \"claim_state\",\n });\n const itemType = context.metadata.type.trim().toLowerCase();\n const includeChildren = shouldIncludeGetField({\n ...projection,\n field: \"children\",\n itemType,\n });\n const claimState = await resolveGetClaimState(context, includeClaimState);\n const result: GetResult = {\n item: projection.fieldProjection\n ? projectItemForFields(context.metadata, projection.fields as string[])\n : projectItemForDepth(context.metadata, projection.depth),\n };\n if (includeBody) {\n result.item.body = context.body;\n }\n attachGetLinked(result, context, projection.fields, includeLinked);\n if (claimState) {\n result.claim_state = claimState;\n }\n result.children = await buildGetChildrenRollup(context, includeChildren);\n result.tree = await buildGetTree(\n context,\n options,\n projection.treeDepth,\n global,\n );\n try {\n await recordContextUsageTouches({\n pmRoot: context.pmRoot,\n author:\n (process.env.PM_AUTHOR ?? context.settings.author_default).trim() ||\n \"unknown\",\n itemIds: [context.locatedId],\n intent: \"get\",\n });\n } catch {\n // Derived usage feedback must never make the source-of-truth read fail.\n }\n return result;\n}\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD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AC,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,IAAI,EAAE;gBACjE,SAAS;YACX,OAAO,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC;YAC5B,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;IACL,CAAC;IAAC,MAAM,CAAC;QACP,wEAAwE;IAC1E,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","debugId":"233ec299-06cd-50e0-8ff5-bfbd40fe8bb2"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Implements the pm list command surface and its agent-facing runtime behavior.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!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]="
|
|
7
|
+
!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]="6cf4aa0a-5582-5ed3-aff1-4a363ec0eda7")}catch(e){}}();
|
|
8
8
|
import { pathExists } from "../../core/fs/fs-utils.js";
|
|
9
9
|
import { getActiveExtensionRegistrations } from "../../core/extensions/index.js";
|
|
10
10
|
import { toItemRecord } from "../../core/item/item-record.js";
|
|
@@ -551,11 +551,10 @@ function parseAssigneeFilter(raw) {
|
|
|
551
551
|
}
|
|
552
552
|
return normalized;
|
|
553
553
|
}
|
|
554
|
-
//
|
|
555
|
-
//
|
|
556
|
-
// the shared CSV parser resolves the open/closed/canceled workflow-group aliases.
|
|
554
|
+
// Resolve built-in, runtime, and workflow-group aliases through the shared
|
|
555
|
+
// registry, rejecting typos instead of returning a misleading empty result.
|
|
557
556
|
function resolveStatusFilter(status, statusRegistry) {
|
|
558
|
-
return parseStatusFilterCsv(status, statusRegistry, { strict:
|
|
557
|
+
return parseStatusFilterCsv(status, statusRegistry, { strict: true });
|
|
559
558
|
}
|
|
560
559
|
function assertListAssigneeFilters(assigneeFilter, assigneeModeFilter) {
|
|
561
560
|
if (assigneeFilter &&
|
|
@@ -1072,4 +1071,4 @@ export const _testOnly = {
|
|
|
1072
1071
|
withTreeMetadata,
|
|
1073
1072
|
};
|
|
1074
1073
|
//# sourceMappingURL=list.js.map
|
|
1075
|
-
//# debugId=
|
|
1074
|
+
//# debugId=6cf4aa0a-5582-5ed3-aff1-4a363ec0eda7
|