@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sources":["cli/commands/context.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module cli/commands/context\n *\n * Implements the pm context command surface and its agent-facing runtime behavior.\n */\nimport { SETTINGS_DEFAULTS, EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { compareTimestampStrings, nowIso } from \"../../core/shared/time.js\";\nimport {\n isTerminalStatus,\n normalizeStatusForRegistry,\n normalizeStatusInput,\n} from \"../../core/item/status.js\";\nimport {\n resolveRuntimeStatusRegistry,\n type RuntimeStatusRegistry,\n} from \"../../core/schema/runtime-schema.js\";\nimport { resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport type {\n ContextDepth,\n ContextSectionName,\n ContextSettings,\n ItemMetadata,\n ItemStatus,\n PmSettings,\n} from \"../../types/index.js\";\nimport {\n CONTEXT_DEPTH_VALUES,\n CONTEXT_SECTION_VALUES,\n} from \"../../types/index.js\";\nimport { parseIntegerLimit } from \"../shared-parsers.js\";\nimport {\n runCalendar,\n type CalendarOptions,\n type CalendarRow,\n} from \"./calendar.js\";\nimport { runList, type ListOptions } from \"./list.js\";\nimport { runActivity, type CompactActivityEntry } from \"./activity.js\";\nimport {\n scoreContextCandidatesWithActiveExtensions,\n type ContextRelevanceCandidate,\n type ContextRelevanceContributions,\n type ContextRelevanceReport,\n type ContextRelevanceSignalName,\n} from \"../../sdk/context-relevance.js\";\nimport {\n createQueryFingerprint,\n encodeQueryCursor,\n resolveQueryCursorStart,\n} from \"../../sdk/pagination.js\";\n\n// ---------------------------------------------------------------------------\n// Output format\n// ---------------------------------------------------------------------------\n\n/** Supported values accepted by the context output contract. */\nexport const CONTEXT_OUTPUT_VALUES = [\"markdown\", \"toon\", \"json\"] as const;\n/** Restricts context output format values accepted by command, SDK, and storage contracts. */\nexport type ContextOutputFormat = (typeof CONTEXT_OUTPUT_VALUES)[number];\n\n// ---------------------------------------------------------------------------\n// Options\n// ---------------------------------------------------------------------------\n\n/** Documents the context options payload exchanged by command, SDK, and package integrations. */\nexport interface ContextOptions {\n /** Value that configures or reports date for this contract. */\n date?: string;\n /** Value that configures or reports from for this contract. */\n from?: string;\n /** Value that configures or reports to for this contract. */\n to?: string;\n /** Value that configures or reports past for this contract. */\n past?: boolean;\n /** Schema type that determines the shape and validation rules for this value. */\n type?: string;\n /** Value that configures or reports tag for this contract. */\n tag?: string;\n /** Value that configures or reports priority for this contract. */\n priority?: string;\n /** Value that configures or reports assignee for this contract. */\n assignee?: string;\n /** Value that configures or reports assignee filter for this contract. */\n assigneeFilter?: string;\n /** Value that configures or reports sprint for this contract. */\n sprint?: string;\n /** Value that configures or reports release for this contract. */\n release?: string;\n /** Value that configures or reports limit for this contract. */\n limit?: string;\n /** Value that configures or reports max items for this contract. */\n maxItems?: string;\n /** Opaque cursor returned by a previous context focus page. */\n after?: string;\n /** Value that configures or reports format for this contract. */\n format?: string;\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 section for this contract. */\n section?: string[];\n /** Value that configures or reports activity limit for this contract. */\n activityLimit?: string;\n /** Value that configures or reports stale threshold for this contract. */\n staleThreshold?: string;\n /** Value that configures or reports parent for this contract. */\n parent?: string;\n /** Value that configures or reports explain ranking for this contract. */\n explainRanking?: boolean;\n [key: string]: unknown;\n}\n\n// ---------------------------------------------------------------------------\n// Focus item (unchanged from original)\n// ---------------------------------------------------------------------------\n\n/** Documents the context focus item payload exchanged by command, SDK, and package integrations. */\nexport interface ContextFocusItem {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports title for this contract. */\n title: string;\n /** Schema type that determines the shape and validation rules for this value. */\n type: string;\n /** Lifecycle state reported for status. */\n status: ItemStatus;\n /** Value that configures or reports priority for this contract. */\n priority: number;\n /** Value that configures or reports order for this contract. */\n order: number | null;\n /** Value that configures or reports deadline for this contract. */\n deadline: string | null;\n /** Value that configures or reports assignee for this contract. */\n assignee: string | null;\n /** Value that configures or reports tags for this contract. */\n tags: string[];\n /** ISO 8601 timestamp recording when updated occurred. */\n updated_at: string;\n /** Value that configures or reports parent for this contract. */\n parent: string | null;\n /** Value that configures or reports children total for this contract. */\n children_total?: number;\n /** Value that configures or reports children closed for this contract. */\n children_closed?: number;\n /** Value that configures or reports completion pct for this contract. */\n completion_pct?: number;\n}\n\n// ---------------------------------------------------------------------------\n// Section data types\n// ---------------------------------------------------------------------------\n\n/** Documents the hierarchy child payload exchanged by command, SDK, and package integrations. */\nexport interface HierarchyChild {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports title for this contract. */\n title: string;\n /** Schema type that determines the shape and validation rules for this value. */\n type: string;\n /** Lifecycle state reported for status. */\n status: ItemStatus;\n /** Value that configures or reports children total for this contract. */\n children_total: number;\n /** Value that configures or reports children closed for this contract. */\n children_closed: number;\n}\n\n/** Documents the hierarchy node payload exchanged by command, SDK, and package integrations. */\nexport interface HierarchyNode {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports title for this contract. */\n title: string;\n /** Schema type that determines the shape and validation rules for this value. */\n type: string;\n /** Lifecycle state reported for status. */\n status: ItemStatus;\n /** Value that configures or reports children total for this contract. */\n children_total: number;\n /** Value that configures or reports children closed for this contract. */\n children_closed: number;\n /** Value that configures or reports children open for this contract. */\n children_open: number;\n /** Value that configures or reports children in progress for this contract. */\n children_in_progress: number;\n /** Value that configures or reports children blocked for this contract. */\n children_blocked: number;\n /** Value that configures or reports children for this contract. */\n children: HierarchyChild[];\n}\n\n/** Documents the progress entry payload exchanged by command, SDK, and package integrations. */\nexport interface ProgressEntry {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports title for this contract. */\n title: string;\n /** Schema type that determines the shape and validation rules for this value. */\n type: string;\n /** Value that configures or reports total for this contract. */\n total: number;\n /** Value that configures or reports closed for this contract. */\n closed: number;\n /** Value that configures or reports open for this contract. */\n open: number;\n /** Value that configures or reports in progress for this contract. */\n in_progress: number;\n /** Value that configures or reports blocked for this contract. */\n blocked: number;\n /** Value that configures or reports completion pct for this contract. */\n completion_pct: number;\n}\n\n/** Documents the blocker entry payload exchanged by command, SDK, and package integrations. */\nexport interface BlockerEntry {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports title for this contract. */\n title: string;\n /** Value that configures or reports blocked by for this contract. */\n blocked_by: string | null;\n /** Value that configures or reports blocked by title for this contract. */\n blocked_by_title: string | null;\n /** Lifecycle state reported for blocked bythe record. */\n blocked_by_status: ItemStatus | null;\n /** Value that configures or reports blocked reason for this contract. */\n blocked_reason: string | null;\n /** Value that configures or reports unblock note for this contract. */\n unblock_note: string | null;\n}\n\n/** Documents the hot file payload exchanged by command, SDK, and package integrations. */\nexport interface HotFile {\n /** Filesystem path used for path resolution. */\n path: string;\n /** Value that configures or reports references for this contract. */\n references: number;\n /** Value that configures or reports items for this contract. */\n items: string[];\n}\n\n/** Documents the workload entry payload exchanged by command, SDK, and package integrations. */\nexport interface WorkloadEntry {\n /** Value that configures or reports assignee for this contract. */\n assignee: string | null;\n /** Value that configures or reports active for this contract. */\n active: number;\n /** Value that configures or reports in progress for this contract. */\n in_progress: number;\n /** Value that configures or reports items for this contract. */\n items: string[];\n}\n\n/** Documents the stale entry payload exchanged by command, SDK, and package integrations. */\nexport interface StaleEntry {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports title for this contract. */\n title: string;\n /** Lifecycle state reported for status. */\n status: ItemStatus;\n /** ISO 8601 timestamp recording when updated occurred. */\n updated_at: string;\n /** Value that configures or reports stale days for this contract. */\n stale_days: number;\n}\n\n/** Documents the recent context item payload exchanged by command, SDK, and package integrations. */\nexport interface RecentContextItem extends ContextFocusItem {\n /** ISO 8601 timestamp recording when created occurred. */\n created_at?: string;\n}\n\n/** Documents the test health summary payload exchanged by command, SDK, and package integrations. */\nexport interface TestHealthSummary {\n /** Value that configures or reports items with tests for this contract. */\n items_with_tests: number;\n /** Value that configures or reports items with recent runs for this contract. */\n items_with_recent_runs: number;\n /** Value that configures or reports recent runs for this contract. */\n recent_runs: {\n passed: number;\n failed: number;\n skipped: number;\n };\n /** Value that configures or reports items failing for this contract. */\n items_failing: string[];\n}\n\n// ---------------------------------------------------------------------------\n// Agenda / summary (unchanged)\n// ---------------------------------------------------------------------------\n\ninterface ContextAgendaSummary {\n events: number;\n items: number;\n deadlines: number;\n reminders: number;\n scheduled: number;\n}\n\ninterface ContextSummary {\n active_items: number;\n in_progress: number;\n open: number;\n blocked: number;\n blocked_fallback_used: boolean;\n high_level: number;\n low_level: number;\n agenda_events: number;\n total_items?: number;\n closed?: number;\n canceled?: number;\n}\n\n// ---------------------------------------------------------------------------\n// Result\n// ---------------------------------------------------------------------------\n\n/** Documents the context result payload exchanged by command, SDK, and package integrations. */\nexport interface ContextResult {\n /** Value that configures or reports output default for this contract. */\n output_default: \"toon\";\n /** Value that configures or reports now for this contract. */\n now: string;\n /** Value that configures or reports depth for this contract. */\n depth: ContextDepth;\n /** Value that configures or reports sections included for this contract. */\n sections_included: ContextSectionName[];\n /** Value that configures or reports window for this contract. */\n window: {\n anchor: string;\n start: string | null;\n end: string | null;\n past: boolean;\n from: string | null;\n to: string | null;\n };\n /** Value that configures or reports filters for this contract. */\n filters: {\n type: string | null;\n tag: string | null;\n priority: string | null;\n assignee: string | null;\n assignee_filter: string | null;\n sprint: string | null;\n release: string | null;\n limit: string | null;\n parent: string | null;\n runtime_filters?: Record<string, unknown>;\n };\n /** Value that configures or reports summary for this contract. */\n summary: ContextSummary;\n /** Value that configures or reports high level for this contract. */\n high_level: ContextFocusItem[];\n /** Value that configures or reports low level for this contract. */\n low_level: ContextFocusItem[];\n /** Value that configures or reports blocked fallback for this contract. */\n blocked_fallback: ContextFocusItem[];\n /** Value that configures or reports agenda for this contract. */\n agenda: {\n summary: ContextAgendaSummary;\n events: CalendarRow[];\n };\n /** Value that configures or reports hierarchy for this contract. */\n hierarchy?: HierarchyNode[];\n /** Value that configures or reports activity for this contract. */\n activity?: CompactActivityEntry[];\n /** Value that configures or reports progress for this contract. */\n progress?: ProgressEntry[];\n /** Value that configures or reports blockers for this contract. */\n blockers?: BlockerEntry[];\n /** Value that configures or reports recently created for this contract. */\n recently_created?: RecentContextItem[];\n /** Value that configures or reports unparented for this contract. */\n unparented?: ContextFocusItem[];\n /** Value that configures or reports files for this contract. */\n files?: HotFile[];\n /** Value that configures or reports workload for this contract. */\n workload?: WorkloadEntry[];\n /** Value that configures or reports staleness for this contract. */\n staleness?: StaleEntry[];\n /** Value that configures or reports tests for this contract. */\n tests?: TestHealthSummary;\n /** Value that configures or reports suggestions for this contract. */\n suggestions?: string[];\n /** Focus-row field subset requested via --fields; null/omitted means full rows. */\n focus_fields?: string[];\n /** Value that configures or reports warnings for this contract. */\n warnings?: string[];\n /** Value that configures or reports ranking for this contract. */\n ranking?: ContextRankingSummary;\n /** Whether additional ranked focus rows remain after this page. */\n has_more?: boolean;\n /** Opaque continuation cursor for the next ranked focus page. */\n next_cursor?: string;\n /** Effective ranked-focus page size. */\n applied_limit?: number;\n /** Explicit marker that focus rows were bounded. */\n truncated?: true;\n}\n\n/** Compact explainability envelope shared by context and next JSON results. */\nexport interface ContextRankingSummary {\n /** Value that configures or reports model for this contract. */\n model: string;\n /** Value that configures or reports available signals for this contract. */\n available_signals: ContextRelevanceSignalName[];\n /** Value that configures or reports items for this contract. */\n items: Array<{\n id: string;\n rank: number;\n baseline_rank: number;\n score: number;\n contributions: ContextRelevanceContributions;\n }>;\n}\n\n// ---------------------------------------------------------------------------\n// Constants\n// ---------------------------------------------------------------------------\n\nconst HIGH_LEVEL_TYPES = new Set<string>([\"Epic\", \"Feature\"]);\nconst DEFAULT_CONTEXT_LIMIT = 10;\nconst CONTEXT_SCALE_THRESHOLD = 10_000;\n\nconst STANDARD_SECTIONS: ContextSectionName[] = [\n \"hierarchy\",\n \"activity\",\n \"progress\",\n \"recently_created\",\n \"unparented\",\n \"workload\",\n];\nconst DEEP_SECTIONS: ContextSectionName[] = [\n ...STANDARD_SECTIONS,\n \"blockers\",\n \"files\",\n \"staleness\",\n \"tests\",\n];\nconst LEADING_HYPHEN_DATE = /^(\\d{4})-(\\d{2})-(\\d{2})/;\nconst LEADING_COMPACT_DATE = /^(\\d{4})(\\d{2})(\\d{2})(?:[T ]?\\d{2}|$)/;\nconst COMPACT_DATE = /^(\\d{4})(\\d{2})(\\d{2})$/;\nconst COMPACT_DATETIME =\n /^(\\d{4})(\\d{2})(\\d{2})(?:[T\\s]?)(\\d{2})(\\d{2})(\\d{2})?(Z|[+-]\\d{2}:?\\d{2})?$/i;\n\n// ---------------------------------------------------------------------------\n// Parsers\n// ---------------------------------------------------------------------------\n\nfunction parseOutputFormat(\n raw: string | undefined,\n): ContextOutputFormat | undefined {\n if (!raw) return undefined;\n const normalized = raw.trim().toLowerCase();\n if (!CONTEXT_OUTPUT_VALUES.includes(normalized as ContextOutputFormat)) {\n throw new PmCliError(\n \"Context format must be one of markdown|toon|json\",\n EXIT_CODE.USAGE,\n );\n }\n return normalized as ContextOutputFormat;\n}\n\n// Fields selectable by `pm context --fields` for focus-row projection. Every\n// ContextFocusItem scalar plus `created_at` (carried by recently-created rows)\n// is addressable; unknown names are rejected with a usage hint.\nconst FOCUS_PROJECTION_FIELDS = new Set<string>([\n \"id\",\n \"title\",\n \"type\",\n \"status\",\n \"priority\",\n \"order\",\n \"deadline\",\n \"assignee\",\n \"tags\",\n \"updated_at\",\n \"parent\",\n \"children_total\",\n \"children_closed\",\n \"completion_pct\",\n \"created_at\",\n]);\n\n/** Parses the comma-separated `--fields` value into a validated, de-duplicated focus-row projection list. Returns undefined when no projection was requested. */\nexport function parseContextFocusFields(\n raw: string | undefined,\n): string[] | undefined {\n if (raw === undefined) return undefined;\n const fields: string[] = [];\n for (const token of raw.split(\",\")) {\n const normalized = token.trim().toLowerCase();\n if (normalized.length === 0) continue;\n if (!FOCUS_PROJECTION_FIELDS.has(normalized)) {\n throw new PmCliError(\n `Context --fields value not projectable: ${normalized} (valid: ${[...FOCUS_PROJECTION_FIELDS].join(\", \")})`,\n EXIT_CODE.USAGE,\n );\n }\n if (!fields.includes(normalized)) fields.push(normalized);\n }\n if (fields.length === 0) {\n throw new PmCliError(\n \"Context --fields requires at least one field name\",\n EXIT_CODE.USAGE,\n );\n }\n return fields;\n}\n\n/** Projects focus rows onto the requested field subset, preserving field order so the rendered/serialized output mirrors the `--fields` argument. */\nexport function projectContextFocusRows<T extends ContextFocusItem>(\n rows: T[],\n fields: string[],\n): ContextFocusItem[] {\n return rows.map((row) => {\n const projected: Record<string, unknown> = {};\n const source = row as Record<string, unknown>;\n for (const field of fields) {\n projected[field] = source[field] ?? null;\n }\n return projected as unknown as ContextFocusItem;\n });\n}\n\n/** Implements resolve context output format for the public runtime surface of this module. */\nexport function resolveContextOutputFormat(\n options: ContextOptions,\n global: GlobalOptions,\n): ContextOutputFormat {\n const commandFormat = parseOutputFormat(options.format);\n if (global.json && commandFormat && commandFormat !== \"json\") {\n throw new PmCliError(\n \"Cannot combine --json with --format markdown|toon\",\n EXIT_CODE.USAGE,\n );\n }\n if (global.json) {\n return \"json\";\n }\n return commandFormat ?? \"toon\";\n}\n\n// --depth full surfaces the entire backlog: when no explicit --limit is given,\n// every section returns all rows instead of the default top-N sample.\nfunction parseContextLimit(\n raw: string | undefined,\n depth: ContextDepth,\n): number {\n return (\n parseIntegerLimit(raw, \"--limit\") ??\n (depth === \"full\" ? Number.MAX_SAFE_INTEGER : DEFAULT_CONTEXT_LIMIT)\n );\n}\n\nfunction resolveContextLimitAtScale(limit: number, itemCount: number): number {\n return itemCount >= CONTEXT_SCALE_THRESHOLD && limit === Number.MAX_SAFE_INTEGER\n ? DEFAULT_CONTEXT_LIMIT\n : limit;\n}\n\n/** Implements parse context depth for the public runtime surface of this module. */\nexport function parseContextDepth(\n raw: string | undefined,\n settings: ContextSettings,\n): ContextDepth {\n if (!raw) return settings.default_depth;\n const normalized = raw.trim().toLowerCase();\n if (!CONTEXT_DEPTH_VALUES.includes(normalized as ContextDepth)) {\n throw new PmCliError(\n `Context --depth must be one of ${CONTEXT_DEPTH_VALUES.join(\"|\")}`,\n EXIT_CODE.USAGE,\n );\n }\n return normalized as ContextDepth;\n}\n\n/** Implements parse context sections for the public runtime surface of this module. */\nexport function parseContextSections(\n raw: string[] | undefined,\n depth: ContextDepth,\n settings: ContextSettings,\n): ContextSectionName[] {\n if (raw && raw.length > 0) {\n const sections: ContextSectionName[] = [];\n for (const value of raw) {\n const normalized = value.trim().toLowerCase();\n if (!CONTEXT_SECTION_VALUES.includes(normalized as ContextSectionName)) {\n throw new PmCliError(\n `Context --section must be one of ${CONTEXT_SECTION_VALUES.join(\"|\")}`,\n EXIT_CODE.USAGE,\n );\n }\n if (!sections.includes(normalized as ContextSectionName)) {\n sections.push(normalized as ContextSectionName);\n }\n }\n return sections;\n }\n if (depth === \"brief\") return [];\n // --depth full is the comprehensive snapshot: every known section, regardless\n // of the per-section settings toggles that brief/standard/deep respect.\n if (depth === \"full\") return [...CONTEXT_SECTION_VALUES];\n const pool = depth === \"deep\" ? DEEP_SECTIONS : STANDARD_SECTIONS;\n return pool.filter((section) => settings.sections[section]);\n}\n\nfunction parseActivityLimit(\n raw: string | undefined,\n settings: ContextSettings,\n): number {\n if (!raw) return settings.activity_limit;\n const parsed = parseIntegerLimit(raw, \"--activity-limit\");\n /* c8 ignore start -- parseIntegerLimit either throws or returns a number; fallback is defensive typing guard */\n return parsed ?? settings.activity_limit;\n /* c8 ignore stop */\n}\n\nfunction parseStaleThresholdDays(\n raw: string | undefined,\n settings: ContextSettings,\n): number {\n if (!raw) return settings.stale_threshold_days;\n const trimmed = raw.trim().toLowerCase();\n const match = /^(\\d+)d?$/.exec(trimmed);\n if (!match) {\n throw new PmCliError(\n \"--stale-threshold must be a number of days (e.g. 7 or 7d)\",\n EXIT_CODE.USAGE,\n );\n }\n const days = parseInt(match[1], 10);\n if (days <= 0) {\n throw new PmCliError(\"--stale-threshold must be positive\", EXIT_CODE.USAGE);\n }\n return days;\n}\n\n// ---------------------------------------------------------------------------\n// Status helpers\n// ---------------------------------------------------------------------------\n\nfunction statusRank(\n status: ItemStatus,\n statusRegistry: RuntimeStatusRegistry,\n): number {\n const normalizedStatus = normalizeStatusForRegistry(status, statusRegistry);\n const inProgressStatus = normalizeStatusInput(\"in_progress\", statusRegistry);\n const openStatus = normalizeStatusInput(\"open\", statusRegistry);\n const blockedStatus = normalizeStatusInput(\"blocked\", statusRegistry);\n const draftStatus = normalizeStatusInput(\"draft\", statusRegistry);\n if (inProgressStatus && normalizedStatus === inProgressStatus) return 0;\n if (openStatus && normalizedStatus === openStatus) return 1;\n if (blockedStatus && normalizedStatus === blockedStatus) return 2;\n if (draftStatus && normalizedStatus === draftStatus) return 3;\n if (statusRegistry.active_statuses.has(normalizedStatus)) return 4;\n if (statusRegistry.blocked_statuses.has(normalizedStatus)) return 5;\n if (statusRegistry.terminal_statuses.has(normalizedStatus)) return 7;\n return 6;\n}\n\nfunction isClosedStatus(\n status: ItemStatus,\n statusRegistry: RuntimeStatusRegistry,\n): boolean {\n const closeStatus = normalizeStatusInput(\"closed\", statusRegistry);\n return normalizeStatusForRegistry(status, statusRegistry) === closeStatus;\n}\n\nfunction isInProgressStatus(\n status: ItemStatus,\n statusRegistry: RuntimeStatusRegistry,\n): boolean {\n const inProgressStatus = normalizeStatusInput(\"in_progress\", statusRegistry);\n return (\n normalizeStatusForRegistry(status, statusRegistry) === inProgressStatus\n );\n}\n\nfunction isOpenStatus(\n status: ItemStatus,\n statusRegistry: RuntimeStatusRegistry,\n): boolean {\n const openStatus = normalizeStatusInput(\"open\", statusRegistry);\n return normalizeStatusForRegistry(status, statusRegistry) === openStatus;\n}\n\nfunction isBlockedStatus(\n status: ItemStatus,\n statusRegistry: RuntimeStatusRegistry,\n): boolean {\n return statusRegistry.blocked_statuses.has(\n normalizeStatusForRegistry(status, statusRegistry),\n );\n}\n\n// Projection flags belong to list/calendar/activity output shaping and must not\n// leak into runContext's downstream calls, which need full ItemMetadata rows.\n// --parent is a context-level subtree scope computed here transitively, so it\n// must not reach runList (whose --parent matches direct children only).\nconst LIST_PROJECTION_FLAGS = [\n \"compact\",\n \"brief\",\n \"fields\",\n \"includeBody\",\n \"include_body\",\n \"parent\",\n] as const;\n\nfunction stripListProjectionFlags(\n options: ContextOptions,\n): Record<string, unknown> {\n const copy: Record<string, unknown> = {\n ...(options as Record<string, unknown>),\n };\n for (const key of LIST_PROJECTION_FLAGS) {\n delete copy[key];\n }\n return copy;\n}\n\n/**\n * Resolves the transitive subtree (the anchor item plus every descendant via\n * parent links) so `--parent` can scope a snapshot to one epic/milestone. Reuses\n * the same {@link buildChildrenByParent}/{@link collectDescendants} helpers the\n * hierarchy section relies on, so subtree membership stays consistent across the\n * snapshot. Ids are normalized to lowercase for case-insensitive membership; the\n * `found` flag is false when the anchor id is absent from the corpus. Exported so\n * sibling read commands (e.g. `pm next`) can apply the same subtree scoping.\n */\nexport function collectSubtreeIds(\n corpus: ItemMetadata[],\n parentId: string,\n): { ids: Set<string>; found: boolean } {\n const target = parentId.trim().toLowerCase();\n const anchor = corpus.find((item) => item.id.trim().toLowerCase() === target);\n if (!anchor) {\n return { ids: new Set<string>(), found: false };\n }\n const childrenByParent = buildChildrenByParent(corpus);\n const descendants = collectDescendants(anchor.id, childrenByParent);\n // Store normalized ids so membership checks are case-insensitive end-to-end.\n const ids = new Set<string>(\n [anchor.id, ...descendants.map((item) => item.id)].map((id) =>\n id.trim().toLowerCase(),\n ),\n );\n return { ids, found: true };\n}\n\nfunction parseContextParent(raw: string | undefined): string | undefined {\n if (raw === undefined) return undefined;\n const trimmed = raw.trim();\n if (trimmed.length === 0) {\n throw new PmCliError(\n \"Context --parent requires an item id\",\n EXIT_CODE.USAGE,\n );\n }\n return trimmed;\n}\n\n// ---------------------------------------------------------------------------\n// Sorting / mapping helpers (unchanged from original)\n// ---------------------------------------------------------------------------\n\nfunction compareOptionalOrder(\n left: number | null | undefined,\n right: number | null | undefined,\n): number {\n const leftValue = left ?? null;\n const rightValue = right ?? null;\n if (leftValue === null && rightValue === null) return 0;\n if (leftValue === null) return 1;\n if (rightValue === null) return -1;\n return leftValue - rightValue;\n}\n\nfunction compareOptionalDeadline(\n left: string | null | undefined,\n right: string | null | undefined,\n): number {\n const leftValue = left ?? null;\n const rightValue = right ?? null;\n if (leftValue === null && rightValue === null) return 0;\n if (leftValue === null) return 1;\n if (rightValue === null) return -1;\n return compareTimestampStrings(leftValue, rightValue);\n}\n\nfunction daysInUtcMonth(year: number, monthIndex: number): number {\n return new Date(Date.UTC(year, monthIndex + 1, 0)).getUTCDate();\n}\n\nfunction hasNoInvalidDatePrefix(value: string): boolean {\n const match =\n LEADING_HYPHEN_DATE.exec(value) ?? LEADING_COMPACT_DATE.exec(value);\n if (!match) {\n return true;\n }\n const year = Number.parseInt(match[1], 10);\n const month = Number.parseInt(match[2], 10);\n const day = Number.parseInt(match[3], 10);\n return (\n month >= 1 &&\n month <= 12 &&\n day >= 1 &&\n day <= daysInUtcMonth(year, month - 1)\n );\n}\n\nfunction normalizeTimestampCandidate(value: string): string {\n const compactDate = COMPACT_DATE.exec(value);\n if (compactDate) {\n return `${compactDate[1]}-${compactDate[2]}-${compactDate[3]}`;\n }\n const compactDateTime = COMPACT_DATETIME.exec(value);\n if (compactDateTime) {\n const [, year, month, day, hour, minute, secondRaw, offsetRaw] =\n compactDateTime;\n const second = secondRaw ? `:${secondRaw}` : \"\";\n const offset =\n offsetRaw && offsetRaw.length === 5 && offsetRaw !== \"Z\"\n ? `${offsetRaw.slice(0, 3)}:${offsetRaw.slice(3)}`\n : (offsetRaw ?? \"\");\n return `${year}-${month}-${day}T${hour}:${minute}${second}${offset}`;\n }\n return value;\n}\n\nfunction parseContextTimestampMs(value: unknown): number {\n if (typeof value !== \"string\") {\n return Number.NaN;\n }\n const trimmed = value.trim();\n if (trimmed.length === 0 || !hasNoInvalidDatePrefix(trimmed)) {\n return Number.NaN;\n }\n const parsed = Date.parse(normalizeTimestampCandidate(trimmed));\n return Number.isFinite(parsed) ? parsed : Number.NaN;\n}\n\nfunction sortableTimestamp(value: unknown): string {\n const parsed = parseContextTimestampMs(value);\n return Number.isFinite(parsed) ? new Date(parsed).toISOString() : \"\";\n}\n\nfunction dateTokenForTimestamp(value: unknown): string {\n const parsed = parseContextTimestampMs(value);\n return Number.isFinite(parsed)\n ? new Date(parsed).toISOString().slice(0, 10)\n : \"unknown\";\n}\n\nfunction normalizedParentId(value: unknown): string | null {\n if (typeof value !== \"string\") {\n return null;\n }\n const trimmed = value.trim();\n return trimmed.length > 0 ? trimmed : null;\n}\n\n/**\n * Ranks two items by work criticality: in-progress before open before blocked\n * before draft (via {@link statusRank}), then ascending priority, explicit order,\n * earliest deadline, most-recently-updated, and finally id for a total order.\n * Exported as the canonical focus ordering so sibling read commands (e.g.\n * `pm next`) recommend work in the exact same sequence as `pm context`.\n */\nexport function compareCriticalItems(\n left: ItemMetadata,\n right: ItemMetadata,\n statusRegistry: RuntimeStatusRegistry,\n): number {\n const byStatus =\n statusRank(left.status, statusRegistry) -\n statusRank(right.status, statusRegistry);\n if (byStatus !== 0) return byStatus;\n const byPriority = left.priority - right.priority;\n if (byPriority !== 0) return byPriority;\n const byOrder = compareOptionalOrder(left.order, right.order);\n if (byOrder !== 0) return byOrder;\n const byDeadline = compareOptionalDeadline(left.deadline, right.deadline);\n if (byDeadline !== 0) return byDeadline;\n const byUpdated = compareTimestampStrings(\n sortableTimestamp(right.updated_at),\n sortableTimestamp(left.updated_at),\n );\n const byId = left.id.localeCompare(right.id);\n return byUpdated !== 0 ? byUpdated : byId;\n}\n\nfunction normalizedPressure(value: unknown, maximum: number): number {\n const parsed =\n typeof value === \"number\"\n ? value\n : typeof value === \"string\"\n ? Number.parseFloat(value)\n : Number.NaN;\n if (!Number.isFinite(parsed)) return 0;\n return 1 - Math.min(Math.max(parsed, 0), maximum) / maximum;\n}\n\nfunction resolveDeadlinePressure(deadline: unknown, nowMs: number): number {\n const deadlineMs =\n typeof deadline === \"string\"\n ? Date.parse(deadline)\n : deadline instanceof Date\n ? deadline.getTime()\n : typeof deadline === \"number\"\n ? deadline\n : Number.NaN;\n if (!Number.isFinite(deadlineMs) || !Number.isFinite(nowMs)) return 0;\n const deadlineDays = (deadlineMs - nowMs) / (24 * 60 * 60 * 1000);\n return deadlineDays <= 0 ? 1 : 1 / (1 + deadlineDays / 30);\n}\n\nfunction resolveRiskPressure(risk: ItemMetadata[\"risk\"]): number {\n const normalized =\n typeof risk === \"string\" ? risk.trim().toLowerCase() : undefined;\n if (normalized === \"critical\" || normalized === \"high\") return 1;\n if (normalized === \"medium\") return 0.5;\n return normalized === \"low\" ? 0.1 : 0;\n}\n\nfunction buildItemContextRelevanceCandidate(\n item: ItemMetadata,\n params: {\n statusRegistry: RuntimeStatusRegistry;\n nowMs: number;\n normalizedAuthor: string | undefined;\n recencyRank: ReadonlyMap<string, number>;\n recencyDenominator: number;\n itemCount: number;\n },\n): ContextRelevanceCandidate<ItemMetadata> {\n const assignedToAuthor =\n params.normalizedAuthor !== undefined &&\n typeof item.assignee === \"string\" &&\n item.assignee.trim().toLowerCase() === params.normalizedAuthor;\n const claimFocus = isInProgressStatus(item.status, params.statusRegistry)\n ? 1\n : assignedToAuthor\n ? 0.75\n : 0;\n const riskPressure = resolveRiskPressure(item.risk);\n const knowledgeEntries =\n (item.comments?.length ?? 0) +\n (item.notes?.length ?? 0) +\n (item.learnings?.length ?? 0);\n return {\n id: item.id,\n item,\n signals: {\n recency:\n params.itemCount === 1\n ? 1\n : 1 -\n (params.recencyRank.get(item.id) as number) /\n params.recencyDenominator,\n graph_proximity: item.parent ? 0.3 : 0,\n claim_focus: claimFocus,\n priority_pressure: normalizedPressure(item.priority, 4),\n risk_pressure: riskPressure,\n deadline_pressure: resolveDeadlinePressure(item.deadline, params.nowMs),\n knowledge_density: Math.min(knowledgeEntries / 5, 1),\n author_affinity: assignedToAuthor ? 1 : 0,\n },\n };\n}\n\n/** Derives the metadata signals currently available on compact item rows. More expensive history/index/semantic signals can be added by an extension scorer without changing the public candidate contract. */\nexport function buildItemContextRelevanceCandidates(\n items: readonly ItemMetadata[],\n statusRegistry: RuntimeStatusRegistry,\n now: string,\n author: string | undefined,\n): ContextRelevanceCandidate<ItemMetadata>[] {\n const recencyOrder = [...items].sort(\n (left, right) =>\n compareTimestampStrings(\n sortableTimestamp(right.updated_at),\n sortableTimestamp(left.updated_at),\n ) || left.id.localeCompare(right.id),\n );\n const recencyRank = new Map(\n recencyOrder.map((item, index) => [item.id, index]),\n );\n const recencyDenominator = Math.max(items.length - 1, 1);\n const normalizedAuthor = author?.trim().toLowerCase();\n const nowMs = Date.parse(now);\n return items.map((item) =>\n buildItemContextRelevanceCandidate(item, {\n statusRegistry,\n nowMs,\n normalizedAuthor,\n recencyRank,\n recencyDenominator,\n itemCount: items.length,\n }),\n );\n}\n\n/** Project a full scorer report onto the low-token command explanation shape. */\nexport function toContextRankingSummary<TItem>(\n report: ContextRelevanceReport<TItem>,\n): ContextRankingSummary {\n return {\n model: report.model,\n available_signals: report.available_signals,\n items: report.ranked.map((entry) => ({\n id: entry.id,\n rank: entry.rank,\n baseline_rank: entry.baseline_rank,\n score: entry.score,\n contributions: entry.contributions,\n })),\n };\n}\n\nfunction completionPct(closed: number, total: number): number {\n return total > 0 ? Math.round((closed / total) * 100) : 0;\n}\n\n/** Indexes items by their parent id, yielding a parent→direct-children map used by the hierarchy/progress rollups and by focus-row child completion. Items without a parent are skipped. Exported so sibling read commands reuse the same index. */\nexport function buildChildrenByParent(\n allItems: ItemMetadata[],\n): Map<string, ItemMetadata[]> {\n const childrenByParent = new Map<string, ItemMetadata[]>();\n for (const item of allItems) {\n const parent = normalizedParentId(item.parent);\n if (!parent) continue;\n const children = childrenByParent.get(parent) ?? [];\n children.push(item);\n childrenByParent.set(parent, children);\n }\n return childrenByParent;\n}\n\n/**\n * Projects an item onto the compact {@link ContextFocusItem} focus row. When both\n * a status registry and a parent→children index are supplied, it also folds in the\n * descendant rollup (`children_total`/`children_closed`/`completion_pct`). Exported\n * so sibling read commands (e.g. `pm next`) emit identically-shaped focus rows.\n */\nexport function toContextFocusItem(\n item: ItemMetadata,\n statusRegistry?: RuntimeStatusRegistry,\n childrenByParent?: Map<string, ItemMetadata[]>,\n): ContextFocusItem {\n const focus: ContextFocusItem = {\n id: item.id,\n title: item.title,\n type: item.type,\n status: item.status,\n priority: item.priority,\n order: item.order ?? null,\n deadline: item.deadline ?? null,\n assignee: item.assignee ?? null,\n tags: Array.isArray(item.tags) ? [...item.tags] : [],\n updated_at: item.updated_at,\n parent: normalizedParentId(item.parent),\n };\n if (statusRegistry && childrenByParent) {\n const descendants = collectDescendants(item.id, childrenByParent);\n const total = descendants.length;\n if (total > 0) {\n const closed = descendants.filter((desc) =>\n isClosedStatus(desc.status, statusRegistry),\n ).length;\n focus.children_total = total;\n focus.children_closed = closed;\n focus.completion_pct = completionPct(closed, total);\n }\n }\n return focus;\n}\n\nfunction summarizeAgenda(events: CalendarRow[]): ContextAgendaSummary {\n let deadlines = 0;\n let reminders = 0;\n let scheduled = 0;\n const itemIds = new Set<string>();\n for (const event of events) {\n itemIds.add(event.item_id);\n if (event.kind === \"deadline\") {\n deadlines += 1;\n continue;\n }\n if (event.kind === \"reminder\") {\n reminders += 1;\n continue;\n }\n scheduled += 1;\n }\n return {\n events: events.length,\n items: itemIds.size,\n deadlines,\n reminders,\n scheduled,\n };\n}\n\nfunction mergeSortedWarnings(\n ...warningGroups: Array<string[] | undefined>\n): string[] {\n return [...new Set(warningGroups.flatMap((group) => group ?? []))].sort(\n (left, right) => left.localeCompare(right),\n );\n}\n\nfunction filterTerminalCalendarEvents(\n events: CalendarRow[],\n statusRegistry: RuntimeStatusRegistry,\n): CalendarRow[] {\n return events.filter(\n (event) =>\n !statusRegistry.terminal_statuses.has(\n normalizeStatusForRegistry(event.item_status, statusRegistry),\n ),\n );\n}\n\n// ---------------------------------------------------------------------------\n// Section builders\n// ---------------------------------------------------------------------------\n\nfunction buildHierarchy(\n allItems: ItemMetadata[],\n activeItems: ItemMetadata[],\n statusRegistry: RuntimeStatusRegistry,\n limit: number,\n): HierarchyNode[] {\n const itemMap = new Map<string, ItemMetadata>();\n for (const item of allItems) {\n itemMap.set(item.id, item);\n }\n\n const childrenByParent = buildChildrenByParent(allItems);\n\n const activeHighLevelIds = new Set(\n activeItems\n .filter((item) => HIGH_LEVEL_TYPES.has(item.type))\n .map((item) => item.id),\n );\n\n const nodes: HierarchyNode[] = [];\n for (const parentId of activeHighLevelIds) {\n const parent = itemMap.get(parentId);\n if (!parent) continue;\n const allDescendants = collectDescendants(parentId, childrenByParent);\n const childItems = childrenByParent.get(parentId) ?? [];\n\n let closedCount = 0;\n let openCount = 0;\n let inProgressCount = 0;\n let blockedCount = 0;\n /* c8 ignore start -- chained status-classification branch accounting is noisy under v8 for mixed descendant sets */\n for (const desc of allDescendants) {\n if (isClosedStatus(desc.status, statusRegistry)) closedCount++;\n else if (isInProgressStatus(desc.status, statusRegistry))\n inProgressCount++;\n else if (isBlockedStatus(desc.status, statusRegistry)) blockedCount++;\n else if (isOpenStatus(desc.status, statusRegistry)) openCount++;\n }\n /* c8 ignore stop */\n\n const children: HierarchyChild[] = childItems\n .sort((a, b) => compareCriticalItems(a, b, statusRegistry))\n .slice(0, limit)\n .map((child) => {\n const grandchildren = collectDescendants(child.id, childrenByParent);\n const gcClosed = grandchildren.filter((gc) =>\n isClosedStatus(gc.status, statusRegistry),\n ).length;\n return {\n id: child.id,\n title: child.title,\n type: child.type,\n status: child.status,\n children_total: grandchildren.length,\n children_closed: gcClosed,\n };\n });\n\n nodes.push({\n id: parent.id,\n title: parent.title,\n type: parent.type,\n status: parent.status,\n children_total: allDescendants.length,\n children_closed: closedCount,\n children_open: openCount,\n children_in_progress: inProgressCount,\n children_blocked: blockedCount,\n children,\n });\n }\n\n return nodes\n .sort((a, b) => {\n const aParent = itemMap.get(a.id)!;\n const bParent = itemMap.get(b.id)!;\n return compareCriticalItems(aParent, bParent, statusRegistry);\n })\n .slice(0, limit);\n}\n\nfunction collectDescendants(\n parentId: string,\n childrenByParent: Map<string, ItemMetadata[]>,\n): ItemMetadata[] {\n const result: ItemMetadata[] = [];\n const stack = [parentId];\n const visited = new Set<string>();\n while (stack.length > 0) {\n const current = stack.pop()!;\n if (visited.has(current)) continue;\n visited.add(current);\n const children = childrenByParent.get(current) ?? [];\n for (const child of children) {\n result.push(child);\n stack.push(child.id);\n }\n }\n return result;\n}\n\n/** Public contract for test only, shared by SDK and presentation-layer consumers. */\nexport const _testOnly = {\n buildActivity,\n buildBlockers,\n buildChildrenByParent,\n buildHierarchy,\n buildHotFiles,\n buildProgress,\n buildRecentlyCreated,\n buildStaleness,\n buildTestHealth,\n buildUnparented,\n buildWorkload,\n collectDescendants,\n collectSubtreeIds,\n compareCriticalItems,\n compareOptionalDeadline,\n compareOptionalOrder,\n completionPct,\n dateTokenForTimestamp,\n filterTerminalCalendarEvents,\n isBlockedStatus,\n isClosedStatus,\n isInProgressStatus,\n isOpenStatus,\n mergeSortedWarnings,\n normalizedParentId,\n parseActivityLimit,\n parseContextLimit,\n resolveContextLimitAtScale,\n parseContextParent,\n parseContextTimestampMs,\n parseStaleThresholdDays,\n sortableTimestamp,\n statusRank,\n stripListProjectionFlags,\n summarizeAgenda,\n toContextFocusItem,\n};\n\nasync function buildActivity(\n activityLimit: number,\n global: GlobalOptions,\n): Promise<CompactActivityEntry[]> {\n const result = await runActivity(\n { compact: true, limit: String(activityLimit) },\n global,\n );\n return result.compact_activity ?? [];\n}\n\nfunction buildProgress(\n allItems: ItemMetadata[],\n activeItems: ItemMetadata[],\n statusRegistry: RuntimeStatusRegistry,\n limit: number,\n): ProgressEntry[] {\n const childrenByParent = new Map<string, ItemMetadata[]>();\n for (const item of allItems) {\n if (!item.parent) continue;\n const children = childrenByParent.get(item.parent) ?? [];\n children.push(item);\n childrenByParent.set(item.parent, children);\n }\n\n const activeHighLevel = activeItems.filter((item) =>\n HIGH_LEVEL_TYPES.has(item.type),\n );\n const entries: ProgressEntry[] = [];\n for (const parent of activeHighLevel) {\n const descendants = collectDescendants(parent.id, childrenByParent);\n const total = descendants.length;\n if (total === 0) continue;\n\n let closed = 0;\n let open = 0;\n let inProgress = 0;\n let blocked = 0;\n /* c8 ignore start -- chained status-classification branch accounting is noisy under v8 for mixed descendant sets */\n for (const desc of descendants) {\n if (isClosedStatus(desc.status, statusRegistry)) closed++;\n else if (isInProgressStatus(desc.status, statusRegistry)) inProgress++;\n else if (isBlockedStatus(desc.status, statusRegistry)) blocked++;\n else if (isOpenStatus(desc.status, statusRegistry)) open++;\n }\n /* c8 ignore stop */\n\n entries.push({\n id: parent.id,\n title: parent.title,\n type: parent.type,\n total,\n closed,\n open,\n in_progress: inProgress,\n blocked,\n completion_pct: completionPct(closed, total),\n });\n }\n\n return entries\n .sort((a, b) => a.completion_pct - b.completion_pct)\n .slice(0, limit);\n}\n\nfunction buildBlockers(\n blockedItems: ItemMetadata[],\n itemMap: Map<string, ItemMetadata>,\n limit: number,\n): BlockerEntry[] {\n return blockedItems.slice(0, limit).map((item) => {\n const blockerItem = item.blocked_by\n ? itemMap.get(item.blocked_by)\n : undefined;\n return {\n id: item.id,\n title: item.title,\n blocked_by: item.blocked_by ?? null,\n blocked_by_title: blockerItem?.title ?? null,\n blocked_by_status: blockerItem?.status ?? null,\n blocked_reason: item.blocked_reason ?? null,\n unblock_note: item.unblock_note ?? null,\n };\n });\n}\n\nfunction buildHotFiles(\n activeItems: ItemMetadata[],\n limit: number,\n): HotFile[] {\n const fileMap = new Map<string, Set<string>>();\n for (const item of activeItems) {\n for (const file of item.files ?? []) {\n const existing = fileMap.get(file.path) ?? new Set<string>();\n existing.add(item.id);\n fileMap.set(file.path, existing);\n }\n }\n\n return [...fileMap.entries()]\n .map(([filePath, itemIds]) => ({\n path: filePath,\n references: itemIds.size,\n items: [...itemIds].sort(),\n }))\n .sort((a, b) => b.references - a.references)\n .slice(0, limit);\n}\n\nfunction buildWorkload(\n activeItems: ItemMetadata[],\n statusRegistry: RuntimeStatusRegistry,\n limit: number,\n): WorkloadEntry[] {\n const groups = new Map<string | null, ItemMetadata[]>();\n for (const item of activeItems) {\n const key = item.assignee ?? null;\n const existing = groups.get(key) ?? [];\n existing.push(item);\n groups.set(key, existing);\n }\n\n return [...groups.entries()]\n .map(([assignee, items]) => ({\n assignee,\n active: items.length,\n in_progress: items.filter((item) =>\n isInProgressStatus(item.status, statusRegistry),\n ).length,\n items: items.map((item) => item.id).sort(),\n }))\n .sort((a, b) => b.active - a.active)\n .slice(0, limit);\n}\n\nfunction buildStaleness(\n allNonTerminal: ItemMetadata[],\n staleThresholdDays: number,\n now: string,\n limit: number,\n): StaleEntry[] {\n const cutoffMs =\n new Date(now).getTime() - staleThresholdDays * 24 * 60 * 60 * 1000;\n\n return allNonTerminal\n .filter((item) => new Date(item.updated_at).getTime() < cutoffMs)\n .map((item) => ({\n id: item.id,\n title: item.title,\n status: item.status,\n updated_at: item.updated_at,\n stale_days: Math.floor(\n (new Date(now).getTime() - new Date(item.updated_at).getTime()) /\n (24 * 60 * 60 * 1000),\n ),\n }))\n .sort((a, b) => b.stale_days - a.stale_days)\n .slice(0, limit);\n}\n\nfunction buildRecentlyCreated(\n allNonTerminal: ItemMetadata[],\n statusRegistry: RuntimeStatusRegistry,\n childrenByParent: Map<string, ItemMetadata[]>,\n limit: number,\n): RecentContextItem[] {\n return allNonTerminal\n .map((item) => ({ item, sortKey: sortableTimestamp(item.created_at) }))\n .sort((left, right) => {\n const byCreated = compareTimestampStrings(right.sortKey, left.sortKey);\n return byCreated !== 0\n ? byCreated\n : left.item.id.localeCompare(right.item.id);\n })\n .slice(0, limit)\n .map(({ item }) => ({\n ...toContextFocusItem(item, statusRegistry, childrenByParent),\n created_at: item.created_at,\n }));\n}\n\nfunction buildUnparented(\n allNonTerminal: ItemMetadata[],\n statusRegistry: RuntimeStatusRegistry,\n childrenByParent: Map<string, ItemMetadata[]>,\n limit: number,\n): ContextFocusItem[] {\n return allNonTerminal\n .filter(\n (item) =>\n !normalizedParentId(item.parent) && !HIGH_LEVEL_TYPES.has(item.type),\n )\n .sort((left, right) => compareCriticalItems(left, right, statusRegistry))\n .slice(0, limit)\n .map((item) => toContextFocusItem(item, statusRegistry, childrenByParent));\n}\n\nfunction buildTestHealth(activeItems: ItemMetadata[]): TestHealthSummary {\n let itemsWithTests = 0;\n let itemsWithRecentRuns = 0;\n let passed = 0;\n let failed = 0;\n let skipped = 0;\n const itemsFailing: string[] = [];\n\n for (const item of activeItems) {\n if ((item.tests ?? []).length > 0) {\n itemsWithTests++;\n }\n const runs = item.test_runs ?? [];\n if (runs.length > 0) {\n itemsWithRecentRuns++;\n let itemHasFailure = false;\n for (const run of runs) {\n passed += run.passed ?? 0;\n failed += run.failed ?? 0;\n skipped += run.skipped ?? 0;\n if ((run.failed ?? 0) > 0) {\n itemHasFailure = true;\n }\n }\n if (itemHasFailure) {\n itemsFailing.push(item.id);\n }\n }\n }\n\n return {\n items_with_tests: itemsWithTests,\n items_with_recent_runs: itemsWithRecentRuns,\n recent_runs: { passed, failed, skipped },\n items_failing: itemsFailing.sort(),\n };\n}\n\n// ---------------------------------------------------------------------------\n// Markdown formatting\n// ---------------------------------------------------------------------------\n\nfunction formatClock(timestamp: string): string {\n return `${new Date(timestamp).toISOString().slice(11, 16)}Z`;\n}\n\nfunction formatFocusLine(item: ContextFocusItem): string {\n const orderToken = item.order === null ? \"-\" : String(item.order);\n const deadlineToken = item.deadline ?? \"-\";\n const parentToken = item.parent ? ` parent:${item.parent}` : \"\";\n const progressToken =\n item.children_total !== undefined &&\n item.children_closed !== undefined &&\n item.completion_pct !== undefined\n ? ` children:${item.children_closed}/${item.children_total} done:${item.completion_pct}%`\n : \"\";\n return `${item.id} p${item.priority} ${item.status} ${item.type} order:${orderToken} deadline:${deadlineToken}${parentToken}${progressToken} ${item.title}`;\n}\n\n// Renders a focus row projected to a `--fields` subset as space-separated\n// field:value tokens, mirroring the projection field order. Array values join\n// with commas; missing/null values render as `-`.\nfunction formatProjectedFocusLine(\n item: ContextFocusItem,\n fields: string[],\n): string {\n const source = item as unknown as Record<string, unknown>;\n return fields\n .map((field) => {\n const value = source[field];\n if (Array.isArray(value)) return `${field}:${value.join(\",\")}`;\n return `${field}:${value ?? \"-\"}`;\n })\n .join(\" \");\n}\n\nfunction formatAgendaLine(event: CalendarRow): string {\n const base = `${formatClock(event.at)} [${event.kind}] ${event.item_id} p${event.item_priority} ${event.item_status} ${event.item_title}`;\n if (event.kind === \"reminder\") {\n return `${base} — ${event.reminder_text}`;\n }\n if (event.kind === \"event\") {\n const recurringSuffix = event.event_recurring ? \" (recurring)\" : \"\";\n const title = event.event_title ?? event.item_title;\n return `${base} — ${title}${recurringSuffix}`;\n }\n return base;\n}\n\nfunction pushContextFocusSection(\n lines: string[],\n title: string,\n rows: ContextFocusItem[],\n emptyText: string,\n renderFocus: (item: ContextFocusItem) => string,\n): void {\n lines.push(`## ${title}`);\n if (rows.length === 0) {\n lines.push(emptyText);\n } else {\n for (const item of rows) {\n lines.push(`- ${renderFocus(item)}`);\n }\n }\n lines.push(\"\");\n}\n\nfunction pushBlockedFallbackSection(\n lines: string[],\n result: ContextResult,\n renderFocus: (item: ContextFocusItem) => string,\n): void {\n if (result.blocked_fallback.length === 0) {\n return;\n }\n lines.push(\"## Blocked fallback\");\n for (const item of result.blocked_fallback) {\n lines.push(`- ${renderFocus(item)}`);\n }\n lines.push(\"\");\n}\n\nfunction pushAgendaSection(lines: string[], result: ContextResult): void {\n lines.push(\"## Agenda\");\n lines.push(\n `- events: ${result.agenda.summary.events} (deadlines: ${result.agenda.summary.deadlines}, reminders: ${result.agenda.summary.reminders}, scheduled: ${result.agenda.summary.scheduled})`,\n );\n if (result.agenda.events.length === 0) {\n lines.push(\"No agenda events matched the selected filters.\");\n } else {\n for (const event of result.agenda.events) {\n lines.push(`- ${formatAgendaLine(event)}`);\n }\n }\n lines.push(\"\");\n}\n\nfunction pushHierarchySection(lines: string[], result: ContextResult): void {\n if (!result.hierarchy || result.hierarchy.length === 0) {\n return;\n }\n lines.push(\"## Hierarchy\");\n for (const node of result.hierarchy) {\n const pct =\n node.children_total > 0\n ? Math.round((node.children_closed / node.children_total) * 100)\n : 0;\n lines.push(\n `- ${node.id} ${node.type} ${node.status} \"${node.title}\" [${node.children_closed}/${node.children_total} done ${pct}%]`,\n );\n for (const child of node.children) {\n const cpct =\n child.children_total > 0\n ? Math.round((child.children_closed / child.children_total) * 100)\n : 0;\n lines.push(\n ` - ${child.id} ${child.type} ${child.status} \"${child.title}\" [${child.children_closed}/${child.children_total} done ${cpct}%]`,\n );\n }\n }\n lines.push(\"\");\n}\n\nfunction pushProgressSection(lines: string[], result: ContextResult): void {\n if (!result.progress || result.progress.length === 0) {\n return;\n }\n lines.push(\"## Progress\");\n for (const entry of result.progress) {\n lines.push(\n `- ${entry.id} \"${entry.title}\" ${entry.completion_pct}% (${entry.closed}/${entry.total} closed, ${entry.in_progress} wip, ${entry.open} open, ${entry.blocked} blocked)`,\n );\n }\n lines.push(\"\");\n}\n\nfunction pushRecentlyCreatedSection(\n lines: string[],\n result: ContextResult,\n focusFields: string[] | undefined,\n renderFocus: (item: ContextFocusItem) => string,\n): void {\n if (!result.recently_created || result.recently_created.length === 0) {\n return;\n }\n lines.push(\"## Recently created\");\n for (const item of result.recently_created) {\n lines.push(\n focusFields\n ? `- ${renderFocus(item)}`\n : `- ${dateTokenForTimestamp(item.created_at)} ${formatFocusLine(item)}`,\n );\n }\n lines.push(\"\");\n}\n\nfunction pushUnparentedSection(\n lines: string[],\n result: ContextResult,\n renderFocus: (item: ContextFocusItem) => string,\n): void {\n if (!result.unparented || result.unparented.length === 0) {\n return;\n }\n lines.push(\"## Unparented\");\n for (const item of result.unparented) {\n lines.push(`- ${renderFocus(item)}`);\n }\n lines.push(\"\");\n}\n\nfunction pushActivitySection(lines: string[], result: ContextResult): void {\n if (!result.activity || result.activity.length === 0) {\n return;\n }\n lines.push(\"## Recent activity\");\n for (const entry of result.activity) {\n const msg = entry.msg ? ` ${entry.msg}` : \"\";\n lines.push(\n `- ${entry.ts.slice(0, 16)}Z ${entry.id} ${entry.op} by:${entry.author}${msg}`,\n );\n }\n lines.push(\"\");\n}\n\nfunction pushBlockersSection(lines: string[], result: ContextResult): void {\n if (!result.blockers || result.blockers.length === 0) {\n return;\n }\n lines.push(\"## Blockers\");\n for (const entry of result.blockers) {\n const by = entry.blocked_by\n ? `blocked_by:${entry.blocked_by}(${entry.blocked_by_status ?? \"?\"})`\n : \"blocked_by:-\";\n const reason = entry.blocked_reason\n ? ` reason:\"${entry.blocked_reason}\"`\n : \"\";\n const note = entry.unblock_note ? ` unblock:\"${entry.unblock_note}\"` : \"\";\n lines.push(`- ${entry.id} \"${entry.title}\" ${by}${reason}${note}`);\n }\n lines.push(\"\");\n}\n\nfunction pushFilesSection(lines: string[], result: ContextResult): void {\n if (!result.files || result.files.length === 0) {\n return;\n }\n lines.push(\"## Hot files\");\n for (const file of result.files) {\n lines.push(\n `- ${file.path} refs:${file.references} items:[${file.items.join(\",\")}]`,\n );\n }\n lines.push(\"\");\n}\n\nfunction pushWorkloadSection(lines: string[], result: ContextResult): void {\n if (!result.workload || result.workload.length === 0) {\n return;\n }\n lines.push(\"## Workload\");\n for (const entry of result.workload) {\n const who = entry.assignee ?? \"(unassigned)\";\n lines.push(\n `- ${who} active:${entry.active} wip:${entry.in_progress} items:[${entry.items.join(\",\")}]`,\n );\n }\n lines.push(\"\");\n}\n\nfunction pushStalenessSection(lines: string[], result: ContextResult): void {\n if (!result.staleness || result.staleness.length === 0) {\n return;\n }\n lines.push(\"## Stale items\");\n for (const entry of result.staleness) {\n lines.push(\n `- ${entry.id} ${entry.status} stale:${entry.stale_days}d last:${entry.updated_at.slice(0, 10)} \"${entry.title}\"`,\n );\n }\n lines.push(\"\");\n}\n\nfunction pushTestHealthSection(lines: string[], result: ContextResult): void {\n if (!result.tests) {\n return;\n }\n lines.push(\"## Test health\");\n lines.push(`- items_with_tests: ${result.tests.items_with_tests}`);\n lines.push(\n `- items_with_recent_runs: ${result.tests.items_with_recent_runs}`,\n );\n lines.push(\n `- passed: ${result.tests.recent_runs.passed}, failed: ${result.tests.recent_runs.failed}, skipped: ${result.tests.recent_runs.skipped}`,\n );\n if (result.tests.items_failing.length > 0) {\n lines.push(`- items_failing: [${result.tests.items_failing.join(\",\")}]`);\n }\n lines.push(\"\");\n}\n\nfunction pushEmptyContextSuggestions(\n lines: string[],\n result: ContextResult,\n): void {\n const isEmpty =\n result.summary.active_items === 0 &&\n result.summary.blocked === 0 &&\n result.agenda.summary.events === 0;\n if (!isEmpty) {\n return;\n }\n lines.push(\"## Suggestions\");\n lines.push(\"No active work items or upcoming events. Consider:\");\n lines.push('- `pm create --type Task --title \"...\"` to add a new work item');\n lines.push(\n \"- `pm list --status closed --limit 5` to review recent completions\",\n );\n lines.push(\"- `pm search <keywords>` to find related past work\");\n lines.push(\"- `pm aggregate` for a full project status overview\");\n}\n\n/** Implements render context markdown for the public runtime surface of this module. */\nexport function renderContextMarkdown(result: ContextResult): string {\n const lines: string[] = [];\n const focusFields = result.focus_fields;\n const renderFocus = (item: ContextFocusItem): string =>\n focusFields\n ? formatProjectedFocusLine(item, focusFields)\n : formatFocusLine(item);\n lines.push(\"# pm context\");\n lines.push(\"\");\n lines.push(`- now: ${result.now}`);\n lines.push(`- depth: ${result.depth}`);\n if (result.filters.parent) {\n lines.push(`- scope: subtree of ${result.filters.parent}`);\n }\n lines.push(\n `- active_items: ${result.summary.active_items} (in_progress: ${result.summary.in_progress}, open: ${result.summary.open})`,\n );\n if (result.summary.total_items !== undefined) {\n lines.push(\n `- total_items: ${result.summary.total_items} (closed: ${result.summary.closed ?? 0}, canceled: ${result.summary.canceled ?? 0})`,\n );\n }\n lines.push(`- agenda_events: ${result.summary.agenda_events}`);\n lines.push(\n `- blocked_fallback_used: ${result.summary.blocked_fallback_used}`,\n );\n const renderedSections = result.sections_included.filter(\n (section) => section !== \"blockers\" || (result.blockers?.length ?? 0) > 0,\n );\n if (renderedSections.length > 0) {\n lines.push(`- sections: ${renderedSections.join(\", \")}`);\n }\n lines.push(\"\");\n\n pushContextFocusSection(\n lines,\n \"High-level focus\",\n result.high_level,\n \"No high-level active items.\",\n renderFocus,\n );\n pushContextFocusSection(\n lines,\n \"Low-level focus\",\n result.low_level,\n \"No low-level active items.\",\n renderFocus,\n );\n pushBlockedFallbackSection(lines, result, renderFocus);\n pushAgendaSection(lines, result);\n pushHierarchySection(lines, result);\n pushProgressSection(lines, result);\n pushRecentlyCreatedSection(lines, result, focusFields, renderFocus);\n pushUnparentedSection(lines, result, renderFocus);\n pushActivitySection(lines, result);\n pushBlockersSection(lines, result);\n pushFilesSection(lines, result);\n pushWorkloadSection(lines, result);\n pushStalenessSection(lines, result);\n pushTestHealthSection(lines, result);\n pushEmptyContextSuggestions(lines, result);\n\n return lines.join(\"\\n\");\n}\n\n// ---------------------------------------------------------------------------\n// Main runner\n// ---------------------------------------------------------------------------\n\ninterface ContextRuntime {\n settings: PmSettings;\n contextSettings: ContextSettings;\n statusRegistry: RuntimeStatusRegistry;\n depth: ContextDepth;\n limit: number;\n sectionsIncluded: ContextSectionName[];\n activityLimit: number;\n staleThresholdDays: number;\n parentScope: string | undefined;\n focusFields: string[] | undefined;\n baseListOptions: Record<string, unknown>;\n}\n\ninterface ContextCorpus {\n listed: Awaited<ReturnType<typeof runList>>;\n listedItemMetadata: ItemMetadata[];\n allItems: ItemMetadata[];\n fullCorpus: ItemMetadata[];\n subtreeIds: Set<string> | undefined;\n}\n\ninterface ContextFocusGroups {\n activeItems: ItemMetadata[];\n blockedItems: ItemMetadata[];\n highLevel: ContextFocusItem[];\n lowLevel: ContextFocusItem[];\n blockedFallback: ContextFocusItem[];\n blockedFallbackUsed: boolean;\n ranking: ContextRelevanceReport<ItemMetadata>;\n pageExtras: {\n has_more?: boolean;\n next_cursor?: string;\n applied_limit?: number;\n truncated?: true;\n };\n}\n\ninterface ContextOptionalSections {\n hierarchy?: HierarchyNode[];\n activity?: CompactActivityEntry[];\n progress?: ProgressEntry[];\n blockersSection?: BlockerEntry[];\n recentlyCreated?: RecentContextItem[];\n unparented?: ContextFocusItem[];\n filesSection?: HotFile[];\n workload?: WorkloadEntry[];\n staleness?: StaleEntry[];\n tests?: TestHealthSummary;\n}\n\nasync function resolveContextRuntime(\n options: ContextOptions,\n global: GlobalOptions,\n): Promise<ContextRuntime> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n const settings = await readSettings(pmRoot);\n /* c8 ignore start -- settings persistence currently always materializes context defaults */\n const contextSettings = settings.context ?? SETTINGS_DEFAULTS.context;\n /* c8 ignore stop */\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const depth = parseContextDepth(options.depth, contextSettings);\n return {\n settings,\n contextSettings,\n statusRegistry,\n depth,\n limit: parseContextLimit(options.limit ?? options.maxItems, depth),\n sectionsIncluded: parseContextSections(\n options.section,\n depth,\n contextSettings,\n ),\n activityLimit: parseActivityLimit(options.activityLimit, contextSettings),\n staleThresholdDays: parseStaleThresholdDays(\n options.staleThreshold,\n contextSettings,\n ),\n parentScope: parseContextParent(options.parent),\n focusFields: parseContextFocusFields(options.fields),\n baseListOptions: stripListProjectionFlags(options),\n };\n}\n\nfunction contextNeedsAllItems(sectionsIncluded: ContextSectionName[]): boolean {\n return sectionsIncluded.some((section) =>\n [\n \"hierarchy\",\n \"progress\",\n \"blockers\",\n \"staleness\",\n \"recently_created\",\n \"unparented\",\n ].includes(section),\n );\n}\n\nfunction buildUnpaginatedContextListOptions(\n baseListOptions: Record<string, unknown>,\n extra: Partial<ListOptions>,\n): ListOptions {\n return {\n ...baseListOptions,\n ...extra,\n noTruncate: true,\n limit: undefined,\n offset: undefined,\n after: undefined,\n };\n}\n\nasync function loadContextCorpus(\n options: ContextOptions,\n global: GlobalOptions,\n runtime: ContextRuntime,\n): Promise<ContextCorpus> {\n const needsAllItems = contextNeedsAllItems(runtime.sectionsIncluded);\n const listOptions = buildUnpaginatedContextListOptions(\n runtime.baseListOptions,\n { excludeTerminal: true },\n );\n const listed = await runList(undefined, listOptions, global);\n let listedItemMetadata = listed.items as ItemMetadata[];\n let allItems: ItemMetadata[] = listedItemMetadata;\n if (needsAllItems || runtime.parentScope !== undefined) {\n const allListed = await runList(\n undefined,\n buildUnpaginatedContextListOptions(runtime.baseListOptions, {\n excludeTerminal: false,\n }),\n global,\n );\n allItems = allListed.items as ItemMetadata[];\n }\n const fullCorpus = allItems;\n const subtreeIds = resolveContextSubtreeIds(runtime.parentScope, fullCorpus);\n if (subtreeIds) {\n listedItemMetadata = listedItemMetadata.filter((item) =>\n subtreeIds.has(item.id.trim().toLowerCase()),\n );\n allItems = allItems.filter((item) =>\n subtreeIds.has(item.id.trim().toLowerCase()),\n );\n }\n return { listed, listedItemMetadata, allItems, fullCorpus, subtreeIds };\n}\n\nfunction resolveContextSubtreeIds(\n parentScope: string | undefined,\n fullCorpus: ItemMetadata[],\n): Set<string> | undefined {\n if (parentScope === undefined) {\n return undefined;\n }\n const subtree = collectSubtreeIds(fullCorpus, parentScope);\n if (!subtree.found) {\n throw new PmCliError(\n `Context --parent item not found: ${parentScope}`,\n EXIT_CODE.NOT_FOUND,\n );\n }\n return subtree.ids;\n}\n\nasync function resolveContextFocusGroups(\n listedItemMetadata: ItemMetadata[],\n allItems: ItemMetadata[],\n statusRegistry: RuntimeStatusRegistry,\n sectionsIncluded: ContextSectionName[],\n limit: number,\n now: string,\n author: string | undefined,\n cursor: string | undefined,\n cursorFingerprint: string,\n useBoundedPage: boolean,\n): Promise<ContextFocusGroups> {\n const structural = [...listedItemMetadata].sort((left, right) =>\n compareCriticalItems(left, right, statusRegistry),\n );\n const ranking = await scoreContextCandidatesWithActiveExtensions(\n \"context\",\n buildItemContextRelevanceCandidates(\n structural,\n statusRegistry,\n now,\n author,\n ),\n );\n const ranked = ranking.ranked.map((entry) => entry.item);\n const activeStatuses = statusRegistry.active_statuses;\n const activeItems = ranked.filter((item) =>\n activeStatuses.has(normalizeStatusForRegistry(item.status, statusRegistry)),\n );\n const pageStart = useBoundedPage\n ? resolveQueryCursorStart(\n activeItems,\n cursor,\n cursorFingerprint,\n (item) => item.id,\n )\n : 0;\n const focusPage = useBoundedPage\n ? activeItems.slice(pageStart, pageStart + limit)\n : activeItems;\n const hasMore =\n useBoundedPage &&\n focusPage.length > 0 &&\n pageStart + focusPage.length < activeItems.length;\n const nextCursor =\n hasMore && focusPage.length > 0\n ? encodeQueryCursor(\n cursorFingerprint,\n focusPage[focusPage.length - 1]!.id,\n pageStart + focusPage.length - 1,\n )\n : undefined;\n const blockedItems = ranked.filter((item) =>\n statusRegistry.blocked_statuses.has(\n normalizeStatusForRegistry(item.status, statusRegistry),\n ),\n );\n const childrenByParent = buildChildrenByParent(allItems);\n const focusChildrenByParent = contextNeedsAllItems(sectionsIncluded)\n ? childrenByParent\n : undefined;\n const highLevel = focusPage\n .filter((item) => HIGH_LEVEL_TYPES.has(item.type))\n .slice(0, useBoundedPage ? focusPage.length : limit)\n .map((item) =>\n toContextFocusItem(item, statusRegistry, focusChildrenByParent),\n );\n const lowLevel = focusPage\n .filter((item) => !HIGH_LEVEL_TYPES.has(item.type))\n .slice(0, useBoundedPage ? focusPage.length : limit)\n .map((item) =>\n toContextFocusItem(item, statusRegistry, focusChildrenByParent),\n );\n const blockedFallbackUsed = activeItems.length === 0;\n return {\n activeItems,\n blockedItems,\n highLevel,\n lowLevel,\n blockedFallback: blockedFallbackUsed\n ? blockedItems\n .slice(0, limit)\n .map((item) =>\n toContextFocusItem(item, statusRegistry, focusChildrenByParent),\n )\n : [],\n blockedFallbackUsed,\n ranking,\n pageExtras: {\n ...(useBoundedPage ? { applied_limit: limit } : {}),\n ...(hasMore ? { has_more: true, truncated: true } : {}),\n ...(nextCursor ? { next_cursor: nextCursor } : {}),\n },\n };\n}\n\nfunction buildContextCursorFingerprint(options: ContextOptions): string {\n const normalizedOptions: Record<string, unknown> = { ...options };\n delete normalizedOptions.after;\n delete normalizedOptions.limit;\n delete normalizedOptions.maxItems;\n delete normalizedOptions.format;\n delete normalizedOptions.fields;\n delete normalizedOptions.section;\n delete normalizedOptions.activityLimit;\n delete normalizedOptions.staleThreshold;\n delete normalizedOptions.explainRanking;\n return createQueryFingerprint(\"context\", normalizedOptions);\n}\n\nfunction shouldPageContextFocus(\n options: ContextOptions,\n corpusItemCount: number,\n): boolean {\n return (\n options.limit !== undefined ||\n options.maxItems !== undefined ||\n options.after !== undefined ||\n corpusItemCount >= CONTEXT_SCALE_THRESHOLD\n );\n}\n\nasync function buildContextAgenda(\n options: ContextOptions,\n global: GlobalOptions,\n runtime: ContextRuntime,\n subtreeIds: Set<string> | undefined,\n): Promise<{\n agenda: Awaited<ReturnType<typeof runCalendar>>;\n agendaEvents: CalendarRow[];\n agendaSummary: ContextAgendaSummary;\n}> {\n const calendarOptions: CalendarOptions = {\n ...runtime.baseListOptions,\n view: \"agenda\",\n include: \"all\",\n limit:\n runtime.parentScope === undefined ? String(runtime.limit) : undefined,\n };\n const agenda = await runCalendar(calendarOptions, global);\n const scopedAgenda =\n subtreeIds === undefined\n ? agenda.events\n : agenda.events.filter((event) =>\n subtreeIds.has(event.item_id.trim().toLowerCase()),\n );\n const agendaEvents = filterTerminalCalendarEvents(\n scopedAgenda,\n runtime.statusRegistry,\n ).slice(0, runtime.limit);\n return { agenda, agendaEvents, agendaSummary: summarizeAgenda(agendaEvents) };\n}\n\nfunction countContextStatus(\n items: ItemMetadata[],\n status: string | undefined,\n statusRegistry: RuntimeStatusRegistry,\n): number {\n const targetStatus = String(status);\n return items.filter(\n (item) =>\n normalizeStatusForRegistry(item.status, statusRegistry) === targetStatus,\n ).length;\n}\n\nasync function buildOptionalContextSections(params: {\n runtime: ContextRuntime;\n allItems: ItemMetadata[];\n fullCorpus: ItemMetadata[];\n focusGroups: ContextFocusGroups;\n now: string;\n global: GlobalOptions;\n}): Promise<ContextOptionalSections> {\n const { runtime, allItems, fullCorpus, focusGroups, now, global } = params;\n const childrenByParent = buildChildrenByParent(allItems);\n const itemMap = new Map(fullCorpus.map((item) => [item.id, item]));\n const allNonTerminal = allItems.filter(\n (item) => !isTerminalStatus(item.status, runtime.statusRegistry),\n );\n const has = (section: ContextSectionName) =>\n runtime.sectionsIncluded.includes(section);\n return {\n hierarchy: has(\"hierarchy\")\n ? buildHierarchy(\n allItems,\n focusGroups.activeItems,\n runtime.statusRegistry,\n runtime.limit,\n )\n : undefined,\n activity: has(\"activity\")\n ? await buildActivity(runtime.activityLimit, global)\n : undefined,\n progress: has(\"progress\")\n ? buildProgress(\n allItems,\n focusGroups.activeItems,\n runtime.statusRegistry,\n runtime.limit,\n )\n : undefined,\n blockersSection: has(\"blockers\")\n ? buildBlockers(focusGroups.blockedItems, itemMap, runtime.limit)\n : undefined,\n recentlyCreated: has(\"recently_created\")\n ? buildRecentlyCreated(\n allNonTerminal,\n runtime.statusRegistry,\n childrenByParent,\n runtime.limit,\n )\n : undefined,\n unparented: has(\"unparented\")\n ? buildUnparented(\n allNonTerminal,\n runtime.statusRegistry,\n childrenByParent,\n runtime.limit,\n )\n : undefined,\n filesSection: has(\"files\")\n ? buildHotFiles(focusGroups.activeItems, runtime.limit)\n : undefined,\n workload: has(\"workload\")\n ? buildWorkload(\n focusGroups.activeItems,\n runtime.statusRegistry,\n runtime.limit,\n )\n : undefined,\n staleness: has(\"staleness\")\n ? buildStaleness(\n allNonTerminal,\n runtime.staleThresholdDays,\n now,\n runtime.limit,\n )\n : undefined,\n tests: has(\"tests\") ? buildTestHealth(focusGroups.activeItems) : undefined,\n };\n}\n\nfunction buildContextSummaryExtras(\n needsAllItems: boolean,\n allItems: ItemMetadata[],\n statusRegistry: RuntimeStatusRegistry,\n): Pick<ContextSummary, \"total_items\" | \"closed\" | \"canceled\"> {\n if (!needsAllItems) {\n return {};\n }\n const canceledStatus = normalizeStatusInput(\"canceled\", statusRegistry);\n return {\n total_items: allItems.length,\n closed: allItems.filter((item) =>\n isClosedStatus(item.status, statusRegistry),\n ).length,\n canceled: allItems.filter(\n (item) =>\n normalizeStatusForRegistry(item.status, statusRegistry) ===\n canceledStatus,\n ).length,\n };\n}\n\nfunction attachOptionalContextSections(\n result: ContextResult,\n sections: ContextOptionalSections,\n): void {\n if (sections.hierarchy) result.hierarchy = sections.hierarchy;\n if (sections.activity) result.activity = sections.activity;\n if (sections.progress) result.progress = sections.progress;\n if (sections.blockersSection) result.blockers = sections.blockersSection;\n if (sections.recentlyCreated)\n result.recently_created = sections.recentlyCreated;\n if (sections.unparented) result.unparented = sections.unparented;\n if (sections.filesSection) result.files = sections.filesSection;\n if (sections.workload) result.workload = sections.workload;\n if (sections.staleness) result.staleness = sections.staleness;\n if (sections.tests) result.tests = sections.tests;\n}\n\nfunction applyContextFocusProjection(\n result: ContextResult,\n focusFields: string[] | undefined,\n): void {\n if (!focusFields) {\n return;\n }\n result.focus_fields = focusFields;\n result.high_level = projectContextFocusRows(result.high_level, focusFields);\n result.low_level = projectContextFocusRows(result.low_level, focusFields);\n result.blocked_fallback = projectContextFocusRows(\n result.blocked_fallback,\n focusFields,\n );\n if (result.recently_created) {\n result.recently_created = projectContextFocusRows(\n result.recently_created,\n focusFields,\n ) as RecentContextItem[];\n }\n if (result.unparented) {\n result.unparented = projectContextFocusRows(result.unparented, focusFields);\n }\n}\n\nfunction maybeAttachEmptyContextSuggestions(\n result: ContextResult,\n activeItems: ItemMetadata[],\n blockedItems: ItemMetadata[],\n): void {\n if (\n activeItems.length > 0 ||\n blockedItems.length > 0 ||\n result.agenda.events.length > 0\n ) {\n return;\n }\n result.suggestions = [\n 'pm create --type Task --title \"...\" to add a new work item',\n \"pm list --status closed --limit 5 to review recent completions\",\n \"pm search <keywords> to find related past work\",\n \"pm aggregate for a full project status overview\",\n ];\n}\n\n/** Implements run context for the public runtime surface of this module. */\nexport async function runContext(\n options: ContextOptions,\n global: GlobalOptions,\n): Promise<ContextResult> {\n const resolvedRuntime = await resolveContextRuntime(options, global);\n const corpus = await loadContextCorpus(options, global, resolvedRuntime);\n const runtime = {\n ...resolvedRuntime,\n limit: resolveContextLimitAtScale(\n resolvedRuntime.limit,\n corpus.fullCorpus.length,\n ),\n };\n const focusGroups = await resolveContextFocusGroups(\n corpus.listedItemMetadata,\n corpus.allItems,\n runtime.statusRegistry,\n runtime.sectionsIncluded,\n runtime.limit,\n nowIso(),\n process.env.PM_AUTHOR,\n options.after,\n buildContextCursorFingerprint(options),\n shouldPageContextFocus(options, corpus.fullCorpus.length),\n );\n const agendaContext = await buildContextAgenda(\n options,\n global,\n runtime,\n corpus.subtreeIds,\n );\n const warnings = mergeSortedWarnings(\n corpus.listed.warnings,\n agendaContext.agenda.warnings,\n focusGroups.ranking.warnings,\n );\n const inProgressCount = countContextStatus(\n focusGroups.activeItems,\n normalizeStatusInput(\"in_progress\", runtime.statusRegistry),\n runtime.statusRegistry,\n );\n const openCount = countContextStatus(\n focusGroups.activeItems,\n normalizeStatusInput(\"open\", runtime.statusRegistry),\n runtime.statusRegistry,\n );\n const sections = await buildOptionalContextSections({\n runtime,\n allItems: corpus.allItems,\n fullCorpus: corpus.fullCorpus,\n focusGroups,\n now: agendaContext.agenda.now,\n global,\n });\n const summaryExtras = buildContextSummaryExtras(\n contextNeedsAllItems(runtime.sectionsIncluded),\n corpus.allItems,\n runtime.statusRegistry,\n );\n\n const result: ContextResult = {\n output_default: \"toon\",\n now: agendaContext.agenda.now,\n depth: runtime.depth,\n sections_included: runtime.sectionsIncluded,\n window: {\n anchor: agendaContext.agenda.anchor,\n start: agendaContext.agenda.range.start,\n end: agendaContext.agenda.range.end,\n past: agendaContext.agenda.range.past,\n from: agendaContext.agenda.range.from,\n to: agendaContext.agenda.range.to,\n },\n filters: {\n type: options.type ?? null,\n tag: options.tag ?? null,\n priority: options.priority ?? null,\n assignee: options.assignee ?? null,\n assignee_filter: options.assigneeFilter ?? null,\n sprint: options.sprint ?? null,\n release: options.release ?? null,\n limit: options.limit ?? options.maxItems ?? null,\n parent: runtime.parentScope ?? null,\n /* c8 ignore next -- listed/calendar runtime filters are always materialized by their command handlers */\n runtime_filters: (corpus.listed.filters.runtime_filters ??\n agendaContext.agenda.filters.runtime_filters ??\n {}) as Record<string, unknown>,\n },\n summary: {\n active_items: focusGroups.activeItems.length,\n in_progress: inProgressCount,\n open: openCount,\n blocked: focusGroups.blockedItems.length,\n blocked_fallback_used: focusGroups.blockedFallbackUsed,\n high_level: focusGroups.highLevel.length,\n low_level: focusGroups.lowLevel.length,\n agenda_events: agendaContext.agendaSummary.events,\n ...summaryExtras,\n },\n high_level: focusGroups.highLevel,\n low_level: focusGroups.lowLevel,\n blocked_fallback: focusGroups.blockedFallback,\n agenda: {\n summary: agendaContext.agendaSummary,\n events: agendaContext.agendaEvents,\n },\n ...focusGroups.pageExtras,\n };\n\n attachOptionalContextSections(result, sections);\n if (options.explainRanking === true)\n result.ranking = toContextRankingSummary(focusGroups.ranking);\n applyContextFocusProjection(result, runtime.focusFields);\n if (warnings.length > 0) result.warnings = warnings;\n maybeAttachEmptyContextSuggestions(\n result,\n focusGroups.activeItems,\n focus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AC,MAAM,GAAG,CAAC;QAAE,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;IACpD,kCAAkC,CAChC,MAAM,EACN,WAAW,CAAC,WAAW,EACvB,WAAW,CAAC,YAAY,CACzB,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC","debugId":"a1564ad2-3e32-5b66-9327-7ff92b7aee37"}
|
|
1
|
+
{"version":3,"file":"context.js","sources":["cli/commands/context.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module cli/commands/context\n *\n * Implements the pm context command surface and its agent-facing runtime behavior.\n */\nimport { SETTINGS_DEFAULTS, EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { compareTimestampStrings, nowIso } from \"../../core/shared/time.js\";\nimport {\n isTerminalStatus,\n normalizeStatusForRegistry,\n normalizeStatusInput,\n} from \"../../core/item/status.js\";\nimport {\n resolveRuntimeStatusRegistry,\n type RuntimeStatusRegistry,\n} from \"../../core/schema/runtime-schema.js\";\nimport { resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport type {\n ContextDepth,\n ContextSectionName,\n ContextSettings,\n ItemMetadata,\n ItemStatus,\n PmSettings,\n} from \"../../types/index.js\";\nimport {\n CONTEXT_DEPTH_VALUES,\n CONTEXT_SECTION_VALUES,\n} from \"../../types/index.js\";\nimport { parseIntegerLimit } from \"../shared-parsers.js\";\nimport {\n runCalendar,\n type CalendarOptions,\n type CalendarRow,\n} from \"./calendar.js\";\nimport { runList, type ListOptions } from \"./list.js\";\nimport { runActivity, type CompactActivityEntry } from \"./activity.js\";\nimport {\n scoreContextCandidatesWithActiveExtensions,\n type ContextRelevanceCandidate,\n type ContextRelevanceContributions,\n type ContextRelevanceReport,\n type ContextRelevanceSignalName,\n} from \"../../sdk/context-relevance.js\";\nimport {\n createQueryFingerprint,\n encodeQueryCursor,\n resolveQueryCursorStart,\n} from \"../../sdk/pagination.js\";\nimport {\n packContextCandidates,\n type ContextPackingReport,\n} from \"../../sdk/context-packing.js\";\nimport {\n readContextUsageAffinity,\n recordContextUsageServing,\n} from \"../../sdk/context-usage.js\";\n\n// ---------------------------------------------------------------------------\n// Output format\n// ---------------------------------------------------------------------------\n\n/** Supported values accepted by the context output contract. */\nexport const CONTEXT_OUTPUT_VALUES = [\"markdown\", \"toon\", \"json\"] as const;\n/** Restricts context output format values accepted by command, SDK, and storage contracts. */\nexport type ContextOutputFormat = (typeof CONTEXT_OUTPUT_VALUES)[number];\n\n// ---------------------------------------------------------------------------\n// Options\n// ---------------------------------------------------------------------------\n\n/** Documents the context options payload exchanged by command, SDK, and package integrations. */\nexport interface ContextOptions {\n /** Value that configures or reports date for this contract. */\n date?: string;\n /** Value that configures or reports from for this contract. */\n from?: string;\n /** Value that configures or reports to for this contract. */\n to?: string;\n /** Value that configures or reports past for this contract. */\n past?: boolean;\n /** Schema type that determines the shape and validation rules for this value. */\n type?: string;\n /** Value that configures or reports tag for this contract. */\n tag?: string;\n /** Value that configures or reports priority for this contract. */\n priority?: string;\n /** Value that configures or reports assignee for this contract. */\n assignee?: string;\n /** Value that configures or reports assignee filter for this contract. */\n assigneeFilter?: string;\n /** Value that configures or reports sprint for this contract. */\n sprint?: string;\n /** Value that configures or reports release for this contract. */\n release?: string;\n /** Value that configures or reports limit for this contract. */\n limit?: string;\n /** Value that configures or reports max items for this contract. */\n maxItems?: string;\n /** Opaque cursor returned by a previous context focus page. */\n after?: string;\n /** Value that configures or reports format for this contract. */\n format?: string;\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 section for this contract. */\n section?: string[];\n /** Value that configures or reports activity limit for this contract. */\n activityLimit?: string;\n /** Value that configures or reports stale threshold for this contract. */\n staleThreshold?: string;\n /** Value that configures or reports parent for this contract. */\n parent?: string;\n /** Value that configures or reports explain ranking for this contract. */\n explainRanking?: boolean;\n [key: string]: unknown;\n}\n\n// ---------------------------------------------------------------------------\n// Focus item (unchanged from original)\n// ---------------------------------------------------------------------------\n\n/** Documents the context focus item payload exchanged by command, SDK, and package integrations. */\nexport interface ContextFocusItem {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports title for this contract. */\n title: string;\n /** Schema type that determines the shape and validation rules for this value. */\n type: string;\n /** Lifecycle state reported for status. */\n status: ItemStatus;\n /** Value that configures or reports priority for this contract. */\n priority: number;\n /** Value that configures or reports order for this contract. */\n order: number | null;\n /** Value that configures or reports deadline for this contract. */\n deadline: string | null;\n /** Value that configures or reports assignee for this contract. */\n assignee: string | null;\n /** Value that configures or reports tags for this contract. */\n tags: string[];\n /** ISO 8601 timestamp recording when updated occurred. */\n updated_at: string;\n /** Value that configures or reports parent for this contract. */\n parent: string | null;\n /** Value that configures or reports children total for this contract. */\n children_total?: number;\n /** Value that configures or reports children closed for this contract. */\n children_closed?: number;\n /** Value that configures or reports completion pct for this contract. */\n completion_pct?: number;\n}\n\n// ---------------------------------------------------------------------------\n// Section data types\n// ---------------------------------------------------------------------------\n\n/** Documents the hierarchy child payload exchanged by command, SDK, and package integrations. */\nexport interface HierarchyChild {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports title for this contract. */\n title: string;\n /** Schema type that determines the shape and validation rules for this value. */\n type: string;\n /** Lifecycle state reported for status. */\n status: ItemStatus;\n /** Value that configures or reports children total for this contract. */\n children_total: number;\n /** Value that configures or reports children closed for this contract. */\n children_closed: number;\n}\n\n/** Documents the hierarchy node payload exchanged by command, SDK, and package integrations. */\nexport interface HierarchyNode {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports title for this contract. */\n title: string;\n /** Schema type that determines the shape and validation rules for this value. */\n type: string;\n /** Lifecycle state reported for status. */\n status: ItemStatus;\n /** Value that configures or reports children total for this contract. */\n children_total: number;\n /** Value that configures or reports children closed for this contract. */\n children_closed: number;\n /** Value that configures or reports children open for this contract. */\n children_open: number;\n /** Value that configures or reports children in progress for this contract. */\n children_in_progress: number;\n /** Value that configures or reports children blocked for this contract. */\n children_blocked: number;\n /** Value that configures or reports children for this contract. */\n children: HierarchyChild[];\n}\n\n/** Documents the progress entry payload exchanged by command, SDK, and package integrations. */\nexport interface ProgressEntry {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports title for this contract. */\n title: string;\n /** Schema type that determines the shape and validation rules for this value. */\n type: string;\n /** Value that configures or reports total for this contract. */\n total: number;\n /** Value that configures or reports closed for this contract. */\n closed: number;\n /** Value that configures or reports open for this contract. */\n open: number;\n /** Value that configures or reports in progress for this contract. */\n in_progress: number;\n /** Value that configures or reports blocked for this contract. */\n blocked: number;\n /** Value that configures or reports completion pct for this contract. */\n completion_pct: number;\n}\n\n/** Documents the blocker entry payload exchanged by command, SDK, and package integrations. */\nexport interface BlockerEntry {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports title for this contract. */\n title: string;\n /** Value that configures or reports blocked by for this contract. */\n blocked_by: string | null;\n /** Value that configures or reports blocked by title for this contract. */\n blocked_by_title: string | null;\n /** Lifecycle state reported for blocked bythe record. */\n blocked_by_status: ItemStatus | null;\n /** Value that configures or reports blocked reason for this contract. */\n blocked_reason: string | null;\n /** Value that configures or reports unblock note for this contract. */\n unblock_note: string | null;\n}\n\n/** Documents the hot file payload exchanged by command, SDK, and package integrations. */\nexport interface HotFile {\n /** Filesystem path used for path resolution. */\n path: string;\n /** Value that configures or reports references for this contract. */\n references: number;\n /** Value that configures or reports items for this contract. */\n items: string[];\n}\n\n/** Documents the workload entry payload exchanged by command, SDK, and package integrations. */\nexport interface WorkloadEntry {\n /** Value that configures or reports assignee for this contract. */\n assignee: string | null;\n /** Value that configures or reports active for this contract. */\n active: number;\n /** Value that configures or reports in progress for this contract. */\n in_progress: number;\n /** Value that configures or reports items for this contract. */\n items: string[];\n}\n\n/** Documents the stale entry payload exchanged by command, SDK, and package integrations. */\nexport interface StaleEntry {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports title for this contract. */\n title: string;\n /** Lifecycle state reported for status. */\n status: ItemStatus;\n /** ISO 8601 timestamp recording when updated occurred. */\n updated_at: string;\n /** Value that configures or reports stale days for this contract. */\n stale_days: number;\n}\n\n/** Documents the recent context item payload exchanged by command, SDK, and package integrations. */\nexport interface RecentContextItem extends ContextFocusItem {\n /** ISO 8601 timestamp recording when created occurred. */\n created_at?: string;\n}\n\n/** Documents the test health summary payload exchanged by command, SDK, and package integrations. */\nexport interface TestHealthSummary {\n /** Value that configures or reports items with tests for this contract. */\n items_with_tests: number;\n /** Value that configures or reports items with recent runs for this contract. */\n items_with_recent_runs: number;\n /** Value that configures or reports recent runs for this contract. */\n recent_runs: {\n passed: number;\n failed: number;\n skipped: number;\n };\n /** Value that configures or reports items failing for this contract. */\n items_failing: string[];\n}\n\n// ---------------------------------------------------------------------------\n// Agenda / summary (unchanged)\n// ---------------------------------------------------------------------------\n\ninterface ContextAgendaSummary {\n events: number;\n items: number;\n deadlines: number;\n reminders: number;\n scheduled: number;\n}\n\ninterface ContextSummary {\n active_items: number;\n in_progress: number;\n open: number;\n blocked: number;\n blocked_fallback_used: boolean;\n high_level: number;\n low_level: number;\n agenda_events: number;\n total_items?: number;\n closed?: number;\n canceled?: number;\n}\n\n// ---------------------------------------------------------------------------\n// Result\n// ---------------------------------------------------------------------------\n\n/** Documents the context result payload exchanged by command, SDK, and package integrations. */\nexport interface ContextResult {\n /** Value that configures or reports output default for this contract. */\n output_default: \"toon\";\n /** Value that configures or reports now for this contract. */\n now: string;\n /** Value that configures or reports depth for this contract. */\n depth: ContextDepth;\n /** Value that configures or reports sections included for this contract. */\n sections_included: ContextSectionName[];\n /** Value that configures or reports window for this contract. */\n window: {\n anchor: string;\n start: string | null;\n end: string | null;\n past: boolean;\n from: string | null;\n to: string | null;\n };\n /** Value that configures or reports filters for this contract. */\n filters: {\n type: string | null;\n tag: string | null;\n priority: string | null;\n assignee: string | null;\n assignee_filter: string | null;\n sprint: string | null;\n release: string | null;\n limit: string | null;\n parent: string | null;\n runtime_filters?: Record<string, unknown>;\n };\n /** Value that configures or reports summary for this contract. */\n summary: ContextSummary;\n /** Value that configures or reports high level for this contract. */\n high_level: ContextFocusItem[];\n /** Value that configures or reports low level for this contract. */\n low_level: ContextFocusItem[];\n /** Value that configures or reports blocked fallback for this contract. */\n blocked_fallback: ContextFocusItem[];\n /** Value that configures or reports agenda for this contract. */\n agenda: {\n summary: ContextAgendaSummary;\n events: CalendarRow[];\n };\n /** Value that configures or reports hierarchy for this contract. */\n hierarchy?: HierarchyNode[];\n /** Value that configures or reports activity for this contract. */\n activity?: CompactActivityEntry[];\n /** Value that configures or reports progress for this contract. */\n progress?: ProgressEntry[];\n /** Value that configures or reports blockers for this contract. */\n blockers?: BlockerEntry[];\n /** Value that configures or reports recently created for this contract. */\n recently_created?: RecentContextItem[];\n /** Value that configures or reports unparented for this contract. */\n unparented?: ContextFocusItem[];\n /** Value that configures or reports files for this contract. */\n files?: HotFile[];\n /** Value that configures or reports workload for this contract. */\n workload?: WorkloadEntry[];\n /** Value that configures or reports staleness for this contract. */\n staleness?: StaleEntry[];\n /** Value that configures or reports tests for this contract. */\n tests?: TestHealthSummary;\n /** Value that configures or reports suggestions for this contract. */\n suggestions?: string[];\n /** Focus-row field subset requested via --fields; null/omitted means full rows. */\n focus_fields?: string[];\n /** Value that configures or reports warnings for this contract. */\n warnings?: string[];\n /** Value that configures or reports ranking for this contract. */\n ranking?: ContextRankingSummary;\n /** Token-budget selection and projection accounting for ranked focus rows. */\n packing?: ContextPackingSummary;\n /** Whether additional ranked focus rows remain after this page. */\n has_more?: boolean;\n /** Opaque continuation cursor for the next ranked focus page. */\n next_cursor?: string;\n /** Effective ranked-focus page size. */\n applied_limit?: number;\n /** Explicit marker that focus rows were bounded. */\n truncated?: true;\n}\n\n/** Compact token-budget accounting shared by context and next results. */\nexport type ContextPackingSummary = Omit<\n ContextPackingReport<unknown>,\n \"included\"\n> & {\n included: Array<{ id: string; projection: string; tokens: number }>;\n};\n\n/** Compact explainability envelope shared by context and next JSON results. */\nexport interface ContextRankingSummary {\n /** Value that configures or reports model for this contract. */\n model: string;\n /** Value that configures or reports available signals for this contract. */\n available_signals: ContextRelevanceSignalName[];\n /** Value that configures or reports items for this contract. */\n items: Array<{\n id: string;\n rank: number;\n baseline_rank: number;\n score: number;\n contributions: ContextRelevanceContributions;\n }>;\n}\n\n// ---------------------------------------------------------------------------\n// Constants\n// ---------------------------------------------------------------------------\n\nconst HIGH_LEVEL_TYPES = new Set<string>([\"Epic\", \"Feature\"]);\nconst DEFAULT_CONTEXT_LIMIT = 10;\nconst CONTEXT_SCALE_THRESHOLD = 10_000;\n\nconst STANDARD_SECTIONS: ContextSectionName[] = [\n \"hierarchy\",\n \"activity\",\n \"progress\",\n \"recently_created\",\n \"unparented\",\n \"workload\",\n];\nconst DEEP_SECTIONS: ContextSectionName[] = [\n ...STANDARD_SECTIONS,\n \"blockers\",\n \"files\",\n \"staleness\",\n \"tests\",\n];\nconst LEADING_HYPHEN_DATE = /^(\\d{4})-(\\d{2})-(\\d{2})/;\nconst LEADING_COMPACT_DATE = /^(\\d{4})(\\d{2})(\\d{2})(?:[T ]?\\d{2}|$)/;\nconst COMPACT_DATE = /^(\\d{4})(\\d{2})(\\d{2})$/;\nconst COMPACT_DATETIME =\n /^(\\d{4})(\\d{2})(\\d{2})(?:[T\\s]?)(\\d{2})(\\d{2})(\\d{2})?(Z|[+-]\\d{2}:?\\d{2})?$/i;\n\n// ---------------------------------------------------------------------------\n// Parsers\n// ---------------------------------------------------------------------------\n\nfunction parseOutputFormat(\n raw: string | undefined,\n): ContextOutputFormat | undefined {\n if (!raw) return undefined;\n const normalized = raw.trim().toLowerCase();\n if (!CONTEXT_OUTPUT_VALUES.includes(normalized as ContextOutputFormat)) {\n throw new PmCliError(\n \"Context format must be one of markdown|toon|json\",\n EXIT_CODE.USAGE,\n );\n }\n return normalized as ContextOutputFormat;\n}\n\n// Fields selectable by `pm context --fields` for focus-row projection. Every\n// ContextFocusItem scalar plus `created_at` (carried by recently-created rows)\n// is addressable; unknown names are rejected with a usage hint.\nconst FOCUS_PROJECTION_FIELDS = new Set<string>([\n \"id\",\n \"title\",\n \"type\",\n \"status\",\n \"priority\",\n \"order\",\n \"deadline\",\n \"assignee\",\n \"tags\",\n \"updated_at\",\n \"parent\",\n \"children_total\",\n \"children_closed\",\n \"completion_pct\",\n \"created_at\",\n]);\n\n/** Parses the comma-separated `--fields` value into a validated, de-duplicated focus-row projection list. Returns undefined when no projection was requested. */\nexport function parseContextFocusFields(\n raw: string | undefined,\n): string[] | undefined {\n if (raw === undefined) return undefined;\n const fields: string[] = [];\n for (const token of raw.split(\",\")) {\n const normalized = token.trim().toLowerCase();\n if (normalized.length === 0) continue;\n if (!FOCUS_PROJECTION_FIELDS.has(normalized)) {\n throw new PmCliError(\n `Context --fields value not projectable: ${normalized} (valid: ${[...FOCUS_PROJECTION_FIELDS].join(\", \")})`,\n EXIT_CODE.USAGE,\n );\n }\n if (!fields.includes(normalized)) fields.push(normalized);\n }\n if (fields.length === 0) {\n throw new PmCliError(\n \"Context --fields requires at least one field name\",\n EXIT_CODE.USAGE,\n );\n }\n return fields;\n}\n\n/** Projects focus rows onto the requested field subset, preserving field order so the rendered/serialized output mirrors the `--fields` argument. */\nexport function projectContextFocusRows<T extends ContextFocusItem>(\n rows: T[],\n fields: string[],\n): ContextFocusItem[] {\n return rows.map((row) => {\n const projected: Record<string, unknown> = {};\n const source = row as Record<string, unknown>;\n for (const field of fields) {\n projected[field] = source[field] ?? null;\n }\n return projected as unknown as ContextFocusItem;\n });\n}\n\n/** Implements resolve context output format for the public runtime surface of this module. */\nexport function resolveContextOutputFormat(\n options: ContextOptions,\n global: GlobalOptions,\n): ContextOutputFormat {\n const commandFormat = parseOutputFormat(options.format);\n if (global.json && commandFormat && commandFormat !== \"json\") {\n throw new PmCliError(\n \"Cannot combine --json with --format markdown|toon\",\n EXIT_CODE.USAGE,\n );\n }\n if (global.json) {\n return \"json\";\n }\n return commandFormat ?? \"toon\";\n}\n\n// --depth full surfaces the entire backlog: when no explicit --limit is given,\n// every section returns all rows instead of the default top-N sample.\nfunction parseContextLimit(\n raw: string | undefined,\n depth: ContextDepth,\n): number {\n return (\n parseIntegerLimit(raw, \"--limit\") ??\n (depth === \"full\" ? Number.MAX_SAFE_INTEGER : DEFAULT_CONTEXT_LIMIT)\n );\n}\n\nfunction resolveContextLimitAtScale(limit: number, itemCount: number): number {\n return itemCount >= CONTEXT_SCALE_THRESHOLD && limit === Number.MAX_SAFE_INTEGER\n ? DEFAULT_CONTEXT_LIMIT\n : limit;\n}\n\n/** Implements parse context depth for the public runtime surface of this module. */\nexport function parseContextDepth(\n raw: string | undefined,\n settings: ContextSettings,\n): ContextDepth {\n if (!raw) return settings.default_depth;\n const normalized = raw.trim().toLowerCase();\n if (!CONTEXT_DEPTH_VALUES.includes(normalized as ContextDepth)) {\n throw new PmCliError(\n `Context --depth must be one of ${CONTEXT_DEPTH_VALUES.join(\"|\")}`,\n EXIT_CODE.USAGE,\n );\n }\n return normalized as ContextDepth;\n}\n\n/** Implements parse context sections for the public runtime surface of this module. */\nexport function parseContextSections(\n raw: string[] | undefined,\n depth: ContextDepth,\n settings: ContextSettings,\n): ContextSectionName[] {\n if (raw && raw.length > 0) {\n const sections: ContextSectionName[] = [];\n for (const value of raw) {\n const normalized = value.trim().toLowerCase();\n if (!CONTEXT_SECTION_VALUES.includes(normalized as ContextSectionName)) {\n throw new PmCliError(\n `Context --section must be one of ${CONTEXT_SECTION_VALUES.join(\"|\")}`,\n EXIT_CODE.USAGE,\n );\n }\n if (!sections.includes(normalized as ContextSectionName)) {\n sections.push(normalized as ContextSectionName);\n }\n }\n return sections;\n }\n if (depth === \"brief\") return [];\n // --depth full is the comprehensive snapshot: every known section, regardless\n // of the per-section settings toggles that brief/standard/deep respect.\n if (depth === \"full\") return [...CONTEXT_SECTION_VALUES];\n const pool = depth === \"deep\" ? DEEP_SECTIONS : STANDARD_SECTIONS;\n return pool.filter((section) => settings.sections[section]);\n}\n\nfunction parseActivityLimit(\n raw: string | undefined,\n settings: ContextSettings,\n): number {\n if (!raw) return settings.activity_limit;\n const parsed = parseIntegerLimit(raw, \"--activity-limit\");\n /* c8 ignore start -- parseIntegerLimit either throws or returns a number; fallback is defensive typing guard */\n return parsed ?? settings.activity_limit;\n /* c8 ignore stop */\n}\n\nfunction parseStaleThresholdDays(\n raw: string | undefined,\n settings: ContextSettings,\n): number {\n if (!raw) return settings.stale_threshold_days;\n const trimmed = raw.trim().toLowerCase();\n const match = /^(\\d+)d?$/.exec(trimmed);\n if (!match) {\n throw new PmCliError(\n \"--stale-threshold must be a number of days (e.g. 7 or 7d)\",\n EXIT_CODE.USAGE,\n );\n }\n const days = parseInt(match[1], 10);\n if (days <= 0) {\n throw new PmCliError(\"--stale-threshold must be positive\", EXIT_CODE.USAGE);\n }\n return days;\n}\n\n// ---------------------------------------------------------------------------\n// Status helpers\n// ---------------------------------------------------------------------------\n\nfunction statusRank(\n status: ItemStatus,\n statusRegistry: RuntimeStatusRegistry,\n): number {\n const normalizedStatus = normalizeStatusForRegistry(status, statusRegistry);\n const inProgressStatus = normalizeStatusInput(\"in_progress\", statusRegistry);\n const openStatus = normalizeStatusInput(\"open\", statusRegistry);\n const blockedStatus = normalizeStatusInput(\"blocked\", statusRegistry);\n const draftStatus = normalizeStatusInput(\"draft\", statusRegistry);\n if (inProgressStatus && normalizedStatus === inProgressStatus) return 0;\n if (openStatus && normalizedStatus === openStatus) return 1;\n if (blockedStatus && normalizedStatus === blockedStatus) return 2;\n if (draftStatus && normalizedStatus === draftStatus) return 3;\n if (statusRegistry.active_statuses.has(normalizedStatus)) return 4;\n if (statusRegistry.blocked_statuses.has(normalizedStatus)) return 5;\n if (statusRegistry.terminal_statuses.has(normalizedStatus)) return 7;\n return 6;\n}\n\nfunction isClosedStatus(\n status: ItemStatus,\n statusRegistry: RuntimeStatusRegistry,\n): boolean {\n const closeStatus = normalizeStatusInput(\"closed\", statusRegistry);\n return normalizeStatusForRegistry(status, statusRegistry) === closeStatus;\n}\n\nfunction isInProgressStatus(\n status: ItemStatus,\n statusRegistry: RuntimeStatusRegistry,\n): boolean {\n const inProgressStatus = normalizeStatusInput(\"in_progress\", statusRegistry);\n return (\n normalizeStatusForRegistry(status, statusRegistry) === inProgressStatus\n );\n}\n\nfunction isOpenStatus(\n status: ItemStatus,\n statusRegistry: RuntimeStatusRegistry,\n): boolean {\n const openStatus = normalizeStatusInput(\"open\", statusRegistry);\n return normalizeStatusForRegistry(status, statusRegistry) === openStatus;\n}\n\nfunction isBlockedStatus(\n status: ItemStatus,\n statusRegistry: RuntimeStatusRegistry,\n): boolean {\n return statusRegistry.blocked_statuses.has(\n normalizeStatusForRegistry(status, statusRegistry),\n );\n}\n\n// Projection flags belong to list/calendar/activity output shaping and must not\n// leak into runContext's downstream calls, which need full ItemMetadata rows.\n// --parent is a context-level subtree scope computed here transitively, so it\n// must not reach runList (whose --parent matches direct children only).\nconst LIST_PROJECTION_FLAGS = [\n \"compact\",\n \"brief\",\n \"fields\",\n \"includeBody\",\n \"include_body\",\n \"parent\",\n] as const;\n\nfunction stripListProjectionFlags(\n options: ContextOptions,\n): Record<string, unknown> {\n const copy: Record<string, unknown> = {\n ...(options as Record<string, unknown>),\n };\n for (const key of LIST_PROJECTION_FLAGS) {\n delete copy[key];\n }\n return copy;\n}\n\n/**\n * Resolves the transitive subtree (the anchor item plus every descendant via\n * parent links) so `--parent` can scope a snapshot to one epic/milestone. Reuses\n * the same {@link buildChildrenByParent}/{@link collectDescendants} helpers the\n * hierarchy section relies on, so subtree membership stays consistent across the\n * snapshot. Ids are normalized to lowercase for case-insensitive membership; the\n * `found` flag is false when the anchor id is absent from the corpus. Exported so\n * sibling read commands (e.g. `pm next`) can apply the same subtree scoping.\n */\nexport function collectSubtreeIds(\n corpus: ItemMetadata[],\n parentId: string,\n): { ids: Set<string>; found: boolean } {\n const target = parentId.trim().toLowerCase();\n const anchor = corpus.find((item) => item.id.trim().toLowerCase() === target);\n if (!anchor) {\n return { ids: new Set<string>(), found: false };\n }\n const childrenByParent = buildChildrenByParent(corpus);\n const descendants = collectDescendants(anchor.id, childrenByParent);\n // Store normalized ids so membership checks are case-insensitive end-to-end.\n const ids = new Set<string>(\n [anchor.id, ...descendants.map((item) => item.id)].map((id) =>\n id.trim().toLowerCase(),\n ),\n );\n return { ids, found: true };\n}\n\nfunction parseContextParent(raw: string | undefined): string | undefined {\n if (raw === undefined) return undefined;\n const trimmed = raw.trim();\n if (trimmed.length === 0) {\n throw new PmCliError(\n \"Context --parent requires an item id\",\n EXIT_CODE.USAGE,\n );\n }\n return trimmed;\n}\n\n// ---------------------------------------------------------------------------\n// Sorting / mapping helpers (unchanged from original)\n// ---------------------------------------------------------------------------\n\nfunction compareOptionalOrder(\n left: number | null | undefined,\n right: number | null | undefined,\n): number {\n const leftValue = left ?? null;\n const rightValue = right ?? null;\n if (leftValue === null && rightValue === null) return 0;\n if (leftValue === null) return 1;\n if (rightValue === null) return -1;\n return leftValue - rightValue;\n}\n\nfunction compareOptionalDeadline(\n left: string | null | undefined,\n right: string | null | undefined,\n): number {\n const leftValue = left ?? null;\n const rightValue = right ?? null;\n if (leftValue === null && rightValue === null) return 0;\n if (leftValue === null) return 1;\n if (rightValue === null) return -1;\n return compareTimestampStrings(leftValue, rightValue);\n}\n\nfunction daysInUtcMonth(year: number, monthIndex: number): number {\n return new Date(Date.UTC(year, monthIndex + 1, 0)).getUTCDate();\n}\n\nfunction hasNoInvalidDatePrefix(value: string): boolean {\n const match =\n LEADING_HYPHEN_DATE.exec(value) ?? LEADING_COMPACT_DATE.exec(value);\n if (!match) {\n return true;\n }\n const year = Number.parseInt(match[1], 10);\n const month = Number.parseInt(match[2], 10);\n const day = Number.parseInt(match[3], 10);\n return (\n month >= 1 &&\n month <= 12 &&\n day >= 1 &&\n day <= daysInUtcMonth(year, month - 1)\n );\n}\n\nfunction normalizeTimestampCandidate(value: string): string {\n const compactDate = COMPACT_DATE.exec(value);\n if (compactDate) {\n return `${compactDate[1]}-${compactDate[2]}-${compactDate[3]}`;\n }\n const compactDateTime = COMPACT_DATETIME.exec(value);\n if (compactDateTime) {\n const [, year, month, day, hour, minute, secondRaw, offsetRaw] =\n compactDateTime;\n const second = secondRaw ? `:${secondRaw}` : \"\";\n const offset =\n offsetRaw && offsetRaw.length === 5 && offsetRaw !== \"Z\"\n ? `${offsetRaw.slice(0, 3)}:${offsetRaw.slice(3)}`\n : (offsetRaw ?? \"\");\n return `${year}-${month}-${day}T${hour}:${minute}${second}${offset}`;\n }\n return value;\n}\n\nfunction parseContextTimestampMs(value: unknown): number {\n if (typeof value !== \"string\") {\n return Number.NaN;\n }\n const trimmed = value.trim();\n if (trimmed.length === 0 || !hasNoInvalidDatePrefix(trimmed)) {\n return Number.NaN;\n }\n const parsed = Date.parse(normalizeTimestampCandidate(trimmed));\n return Number.isFinite(parsed) ? parsed : Number.NaN;\n}\n\nfunction sortableTimestamp(value: unknown): string {\n const parsed = parseContextTimestampMs(value);\n return Number.isFinite(parsed) ? new Date(parsed).toISOString() : \"\";\n}\n\nfunction dateTokenForTimestamp(value: unknown): string {\n const parsed = parseContextTimestampMs(value);\n return Number.isFinite(parsed)\n ? new Date(parsed).toISOString().slice(0, 10)\n : \"unknown\";\n}\n\nfunction normalizedParentId(value: unknown): string | null {\n if (typeof value !== \"string\") {\n return null;\n }\n const trimmed = value.trim();\n return trimmed.length > 0 ? trimmed : null;\n}\n\n/**\n * Ranks two items by work criticality: in-progress before open before blocked\n * before draft (via {@link statusRank}), then ascending priority, explicit order,\n * earliest deadline, most-recently-updated, and finally id for a total order.\n * Exported as the canonical focus ordering so sibling read commands (e.g.\n * `pm next`) recommend work in the exact same sequence as `pm context`.\n */\nexport function compareCriticalItems(\n left: ItemMetadata,\n right: ItemMetadata,\n statusRegistry: RuntimeStatusRegistry,\n): number {\n const byStatus =\n statusRank(left.status, statusRegistry) -\n statusRank(right.status, statusRegistry);\n if (byStatus !== 0) return byStatus;\n const byPriority = left.priority - right.priority;\n if (byPriority !== 0) return byPriority;\n const byOrder = compareOptionalOrder(left.order, right.order);\n if (byOrder !== 0) return byOrder;\n const byDeadline = compareOptionalDeadline(left.deadline, right.deadline);\n if (byDeadline !== 0) return byDeadline;\n const byUpdated = compareTimestampStrings(\n sortableTimestamp(right.updated_at),\n sortableTimestamp(left.updated_at),\n );\n const byId = left.id.localeCompare(right.id);\n return byUpdated !== 0 ? byUpdated : byId;\n}\n\nfunction normalizedPressure(value: unknown, maximum: number): number {\n const parsed =\n typeof value === \"number\"\n ? value\n : typeof value === \"string\"\n ? Number.parseFloat(value)\n : Number.NaN;\n if (!Number.isFinite(parsed)) return 0;\n return 1 - Math.min(Math.max(parsed, 0), maximum) / maximum;\n}\n\nfunction resolveDeadlinePressure(deadline: unknown, nowMs: number): number {\n const deadlineMs =\n typeof deadline === \"string\"\n ? Date.parse(deadline)\n : deadline instanceof Date\n ? deadline.getTime()\n : typeof deadline === \"number\"\n ? deadline\n : Number.NaN;\n if (!Number.isFinite(deadlineMs) || !Number.isFinite(nowMs)) return 0;\n const deadlineDays = (deadlineMs - nowMs) / (24 * 60 * 60 * 1000);\n return deadlineDays <= 0 ? 1 : 1 / (1 + deadlineDays / 30);\n}\n\nfunction resolveRiskPressure(risk: ItemMetadata[\"risk\"]): number {\n const normalized =\n typeof risk === \"string\" ? risk.trim().toLowerCase() : undefined;\n if (normalized === \"critical\" || normalized === \"high\") return 1;\n if (normalized === \"medium\") return 0.5;\n return normalized === \"low\" ? 0.1 : 0;\n}\n\nfunction buildItemContextRelevanceCandidate(\n item: ItemMetadata,\n params: {\n statusRegistry: RuntimeStatusRegistry;\n nowMs: number;\n normalizedAuthor: string | undefined;\n recencyRank: ReadonlyMap<string, number>;\n recencyDenominator: number;\n itemCount: number;\n usageAffinity?: Readonly<Record<string, number>>;\n },\n): ContextRelevanceCandidate<ItemMetadata> {\n const assignedToAuthor =\n params.normalizedAuthor !== undefined &&\n typeof item.assignee === \"string\" &&\n item.assignee.trim().toLowerCase() === params.normalizedAuthor;\n const claimFocus = isInProgressStatus(item.status, params.statusRegistry)\n ? 1\n : assignedToAuthor\n ? 0.75\n : 0;\n const riskPressure = resolveRiskPressure(item.risk);\n const knowledgeEntries =\n (item.comments?.length ?? 0) +\n (item.notes?.length ?? 0) +\n (item.learnings?.length ?? 0);\n return {\n id: item.id,\n item,\n signals: {\n recency:\n params.itemCount === 1\n ? 1\n : 1 -\n (params.recencyRank.get(item.id) as number) /\n params.recencyDenominator,\n graph_proximity: item.parent ? 0.3 : 0,\n claim_focus: claimFocus,\n priority_pressure: normalizedPressure(item.priority, 4),\n risk_pressure: riskPressure,\n deadline_pressure: resolveDeadlinePressure(item.deadline, params.nowMs),\n knowledge_density: Math.min(knowledgeEntries / 5, 1),\n author_affinity: assignedToAuthor ? 1 : 0,\n usage_affinity: params.usageAffinity?.[item.id],\n },\n };\n}\n\n/** Derives the metadata signals currently available on compact item rows. More expensive history/index/semantic signals can be added by an extension scorer without changing the public candidate contract. */\nexport function buildItemContextRelevanceCandidates(\n items: readonly ItemMetadata[],\n statusRegistry: RuntimeStatusRegistry,\n now: string,\n author: string | undefined,\n usageAffinity?: Readonly<Record<string, number>>,\n): ContextRelevanceCandidate<ItemMetadata>[] {\n const recencyOrder = [...items].sort(\n (left, right) =>\n compareTimestampStrings(\n sortableTimestamp(right.updated_at),\n sortableTimestamp(left.updated_at),\n ) || left.id.localeCompare(right.id),\n );\n const recencyRank = new Map(\n recencyOrder.map((item, index) => [item.id, index]),\n );\n const recencyDenominator = Math.max(items.length - 1, 1);\n const normalizedAuthor = author?.trim().toLowerCase();\n const nowMs = Date.parse(now);\n return items.map((item) =>\n buildItemContextRelevanceCandidate(item, {\n statusRegistry,\n nowMs,\n normalizedAuthor,\n recencyRank,\n recencyDenominator,\n itemCount: items.length,\n usageAffinity,\n }),\n );\n}\n\nfunction estimateJsonTokens(value: unknown): number {\n return Math.max(\n 1,\n Math.ceil(Buffer.byteLength(JSON.stringify(value), \"utf8\") / 4),\n );\n}\n\n/** Packs a relevance report with monotone identity, summary, and full item projections. */\nexport function packRankedContextItems(\n report: ContextRelevanceReport<ItemMetadata>,\n tokenBudget: number,\n requiredIds: ReadonlySet<string> = new Set(),\n profile: \"context\" | \"next\" = \"context\",\n): ContextPackingReport<ItemMetadata> {\n return packContextCandidates(\n report.ranked.map((entry) => ({\n id: entry.id,\n item: entry.item,\n rank: entry.rank,\n score: entry.score,\n required: requiredIds.has(entry.id),\n cluster: entry.item.parent?.trim() || entry.item.type,\n token_costs: {\n identity: estimateJsonTokens({ id: entry.id, title: entry.item.title }),\n summary: estimateJsonTokens({\n id: entry.id,\n title: entry.item.title,\n type: entry.item.type,\n status: entry.item.status,\n priority: entry.item.priority,\n parent: entry.item.parent,\n }),\n full: estimateJsonTokens(entry.item),\n },\n })),\n { tokenBudget, profile, latencyBudgetMs: 25 },\n );\n}\n\n/** Projects the SDK packer report onto the stable low-token command envelope. */\nexport function toContextPackingSummary(\n report: ContextPackingReport<ItemMetadata>,\n): ContextPackingSummary {\n return {\n ...report,\n included: report.included.map((entry) => ({\n id: entry.id,\n projection: entry.projection,\n tokens: entry.tokens,\n })),\n };\n}\n\n/** Project a full scorer report onto the low-token command explanation shape. */\nexport function toContextRankingSummary<TItem>(\n report: ContextRelevanceReport<TItem>,\n): ContextRankingSummary {\n return {\n model: report.model,\n available_signals: report.available_signals,\n items: report.ranked.map((entry) => ({\n id: entry.id,\n rank: entry.rank,\n baseline_rank: entry.baseline_rank,\n score: entry.score,\n contributions: entry.contributions,\n })),\n };\n}\n\nfunction completionPct(closed: number, total: number): number {\n return total > 0 ? Math.round((closed / total) * 100) : 0;\n}\n\n/** Indexes items by their parent id, yielding a parent→direct-children map used by the hierarchy/progress rollups and by focus-row child completion. Items without a parent are skipped. Exported so sibling read commands reuse the same index. */\nexport function buildChildrenByParent(\n allItems: ItemMetadata[],\n): Map<string, ItemMetadata[]> {\n const childrenByParent = new Map<string, ItemMetadata[]>();\n for (const item of allItems) {\n const parent = normalizedParentId(item.parent);\n if (!parent) continue;\n const children = childrenByParent.get(parent) ?? [];\n children.push(item);\n childrenByParent.set(parent, children);\n }\n return childrenByParent;\n}\n\n/**\n * Projects an item onto the compact {@link ContextFocusItem} focus row. When both\n * a status registry and a parent→children index are supplied, it also folds in the\n * descendant rollup (`children_total`/`children_closed`/`completion_pct`). Exported\n * so sibling read commands (e.g. `pm next`) emit identically-shaped focus rows.\n */\nexport function toContextFocusItem(\n item: ItemMetadata,\n statusRegistry?: RuntimeStatusRegistry,\n childrenByParent?: Map<string, ItemMetadata[]>,\n): ContextFocusItem {\n const focus: ContextFocusItem = {\n id: item.id,\n title: item.title,\n type: item.type,\n status: item.status,\n priority: item.priority,\n order: item.order ?? null,\n deadline: item.deadline ?? null,\n assignee: item.assignee ?? null,\n tags: Array.isArray(item.tags) ? [...item.tags] : [],\n updated_at: item.updated_at,\n parent: normalizedParentId(item.parent),\n };\n if (statusRegistry && childrenByParent) {\n const descendants = collectDescendants(item.id, childrenByParent);\n const total = descendants.length;\n if (total > 0) {\n const closed = descendants.filter((desc) =>\n isClosedStatus(desc.status, statusRegistry),\n ).length;\n focus.children_total = total;\n focus.children_closed = closed;\n focus.completion_pct = completionPct(closed, total);\n }\n }\n return focus;\n}\n\nfunction summarizeAgenda(events: CalendarRow[]): ContextAgendaSummary {\n let deadlines = 0;\n let reminders = 0;\n let scheduled = 0;\n const itemIds = new Set<string>();\n for (const event of events) {\n itemIds.add(event.item_id);\n if (event.kind === \"deadline\") {\n deadlines += 1;\n continue;\n }\n if (event.kind === \"reminder\") {\n reminders += 1;\n continue;\n }\n scheduled += 1;\n }\n return {\n events: events.length,\n items: itemIds.size,\n deadlines,\n reminders,\n scheduled,\n };\n}\n\nfunction mergeSortedWarnings(\n ...warningGroups: Array<string[] | undefined>\n): string[] {\n return [...new Set(warningGroups.flatMap((group) => group ?? []))].sort(\n (left, right) => left.localeCompare(right),\n );\n}\n\nfunction filterTerminalCalendarEvents(\n events: CalendarRow[],\n statusRegistry: RuntimeStatusRegistry,\n): CalendarRow[] {\n return events.filter(\n (event) =>\n !statusRegistry.terminal_statuses.has(\n normalizeStatusForRegistry(event.item_status, statusRegistry),\n ),\n );\n}\n\n// ---------------------------------------------------------------------------\n// Section builders\n// ---------------------------------------------------------------------------\n\nfunction buildHierarchy(\n allItems: ItemMetadata[],\n activeItems: ItemMetadata[],\n statusRegistry: RuntimeStatusRegistry,\n limit: number,\n): HierarchyNode[] {\n const itemMap = new Map<string, ItemMetadata>();\n for (const item of allItems) {\n itemMap.set(item.id, item);\n }\n\n const childrenByParent = buildChildrenByParent(allItems);\n\n const activeHighLevelIds = new Set(\n activeItems\n .filter((item) => HIGH_LEVEL_TYPES.has(item.type))\n .map((item) => item.id),\n );\n\n const nodes: HierarchyNode[] = [];\n for (const parentId of activeHighLevelIds) {\n const parent = itemMap.get(parentId);\n if (!parent) continue;\n const allDescendants = collectDescendants(parentId, childrenByParent);\n const childItems = childrenByParent.get(parentId) ?? [];\n\n let closedCount = 0;\n let openCount = 0;\n let inProgressCount = 0;\n let blockedCount = 0;\n /* c8 ignore start -- chained status-classification branch accounting is noisy under v8 for mixed descendant sets */\n for (const desc of allDescendants) {\n if (isClosedStatus(desc.status, statusRegistry)) closedCount++;\n else if (isInProgressStatus(desc.status, statusRegistry))\n inProgressCount++;\n else if (isBlockedStatus(desc.status, statusRegistry)) blockedCount++;\n else if (isOpenStatus(desc.status, statusRegistry)) openCount++;\n }\n /* c8 ignore stop */\n\n const children: HierarchyChild[] = childItems\n .sort((a, b) => compareCriticalItems(a, b, statusRegistry))\n .slice(0, limit)\n .map((child) => {\n const grandchildren = collectDescendants(child.id, childrenByParent);\n const gcClosed = grandchildren.filter((gc) =>\n isClosedStatus(gc.status, statusRegistry),\n ).length;\n return {\n id: child.id,\n title: child.title,\n type: child.type,\n status: child.status,\n children_total: grandchildren.length,\n children_closed: gcClosed,\n };\n });\n\n nodes.push({\n id: parent.id,\n title: parent.title,\n type: parent.type,\n status: parent.status,\n children_total: allDescendants.length,\n children_closed: closedCount,\n children_open: openCount,\n children_in_progress: inProgressCount,\n children_blocked: blockedCount,\n children,\n });\n }\n\n return nodes\n .sort((a, b) => {\n const aParent = itemMap.get(a.id)!;\n const bParent = itemMap.get(b.id)!;\n return compareCriticalItems(aParent, bParent, statusRegistry);\n })\n .slice(0, limit);\n}\n\nfunction collectDescendants(\n parentId: string,\n childrenByParent: Map<string, ItemMetadata[]>,\n): ItemMetadata[] {\n const result: ItemMetadata[] = [];\n const stack = [parentId];\n const visited = new Set<string>();\n while (stack.length > 0) {\n const current = stack.pop()!;\n if (visited.has(current)) continue;\n visited.add(current);\n const children = childrenByParent.get(current) ?? [];\n for (const child of children) {\n result.push(child);\n stack.push(child.id);\n }\n }\n return result;\n}\n\n/** Public contract for test only, shared by SDK and presentation-layer consumers. */\nexport const _testOnly = {\n buildActivity,\n buildBlockers,\n buildChildrenByParent,\n buildHierarchy,\n buildHotFiles,\n buildProgress,\n buildRecentlyCreated,\n buildStaleness,\n buildTestHealth,\n buildUnparented,\n buildWorkload,\n collectDescendants,\n collectSubtreeIds,\n compareCriticalItems,\n compareOptionalDeadline,\n compareOptionalOrder,\n completionPct,\n dateTokenForTimestamp,\n filterTerminalCalendarEvents,\n isBlockedStatus,\n isClosedStatus,\n isInProgressStatus,\n isOpenStatus,\n mergeSortedWarnings,\n normalizedParentId,\n parseActivityLimit,\n parseContextLimit,\n resolveContextLimitAtScale,\n parseContextParent,\n parseContextTimestampMs,\n parseStaleThresholdDays,\n sortableTimestamp,\n statusRank,\n stripListProjectionFlags,\n summarizeAgenda,\n toContextFocusItem,\n};\n\nasync function buildActivity(\n activityLimit: number,\n global: GlobalOptions,\n): Promise<CompactActivityEntry[]> {\n const result = await runActivity(\n { compact: true, limit: String(activityLimit) },\n global,\n );\n return result.compact_activity ?? [];\n}\n\nfunction buildProgress(\n allItems: ItemMetadata[],\n activeItems: ItemMetadata[],\n statusRegistry: RuntimeStatusRegistry,\n limit: number,\n): ProgressEntry[] {\n const childrenByParent = new Map<string, ItemMetadata[]>();\n for (const item of allItems) {\n if (!item.parent) continue;\n const children = childrenByParent.get(item.parent) ?? [];\n children.push(item);\n childrenByParent.set(item.parent, children);\n }\n\n const activeHighLevel = activeItems.filter((item) =>\n HIGH_LEVEL_TYPES.has(item.type),\n );\n const entries: ProgressEntry[] = [];\n for (const parent of activeHighLevel) {\n const descendants = collectDescendants(parent.id, childrenByParent);\n const total = descendants.length;\n if (total === 0) continue;\n\n let closed = 0;\n let open = 0;\n let inProgress = 0;\n let blocked = 0;\n /* c8 ignore start -- chained status-classification branch accounting is noisy under v8 for mixed descendant sets */\n for (const desc of descendants) {\n if (isClosedStatus(desc.status, statusRegistry)) closed++;\n else if (isInProgressStatus(desc.status, statusRegistry)) inProgress++;\n else if (isBlockedStatus(desc.status, statusRegistry)) blocked++;\n else if (isOpenStatus(desc.status, statusRegistry)) open++;\n }\n /* c8 ignore stop */\n\n entries.push({\n id: parent.id,\n title: parent.title,\n type: parent.type,\n total,\n closed,\n open,\n in_progress: inProgress,\n blocked,\n completion_pct: completionPct(closed, total),\n });\n }\n\n return entries\n .sort((a, b) => a.completion_pct - b.completion_pct)\n .slice(0, limit);\n}\n\nfunction buildBlockers(\n blockedItems: ItemMetadata[],\n itemMap: Map<string, ItemMetadata>,\n limit: number,\n): BlockerEntry[] {\n return blockedItems.slice(0, limit).map((item) => {\n const blockerItem = item.blocked_by\n ? itemMap.get(item.blocked_by)\n : undefined;\n return {\n id: item.id,\n title: item.title,\n blocked_by: item.blocked_by ?? null,\n blocked_by_title: blockerItem?.title ?? null,\n blocked_by_status: blockerItem?.status ?? null,\n blocked_reason: item.blocked_reason ?? null,\n unblock_note: item.unblock_note ?? null,\n };\n });\n}\n\nfunction buildHotFiles(\n activeItems: ItemMetadata[],\n limit: number,\n): HotFile[] {\n const fileMap = new Map<string, Set<string>>();\n for (const item of activeItems) {\n for (const file of item.files ?? []) {\n const existing = fileMap.get(file.path) ?? new Set<string>();\n existing.add(item.id);\n fileMap.set(file.path, existing);\n }\n }\n\n return [...fileMap.entries()]\n .map(([filePath, itemIds]) => ({\n path: filePath,\n references: itemIds.size,\n items: [...itemIds].sort(),\n }))\n .sort((a, b) => b.references - a.references)\n .slice(0, limit);\n}\n\nfunction buildWorkload(\n activeItems: ItemMetadata[],\n statusRegistry: RuntimeStatusRegistry,\n limit: number,\n): WorkloadEntry[] {\n const groups = new Map<string | null, ItemMetadata[]>();\n for (const item of activeItems) {\n const key = item.assignee ?? null;\n const existing = groups.get(key) ?? [];\n existing.push(item);\n groups.set(key, existing);\n }\n\n return [...groups.entries()]\n .map(([assignee, items]) => ({\n assignee,\n active: items.length,\n in_progress: items.filter((item) =>\n isInProgressStatus(item.status, statusRegistry),\n ).length,\n items: items.map((item) => item.id).sort(),\n }))\n .sort((a, b) => b.active - a.active)\n .slice(0, limit);\n}\n\nfunction buildStaleness(\n allNonTerminal: ItemMetadata[],\n staleThresholdDays: number,\n now: string,\n limit: number,\n): StaleEntry[] {\n const cutoffMs =\n new Date(now).getTime() - staleThresholdDays * 24 * 60 * 60 * 1000;\n\n return allNonTerminal\n .filter((item) => new Date(item.updated_at).getTime() < cutoffMs)\n .map((item) => ({\n id: item.id,\n title: item.title,\n status: item.status,\n updated_at: item.updated_at,\n stale_days: Math.floor(\n (new Date(now).getTime() - new Date(item.updated_at).getTime()) /\n (24 * 60 * 60 * 1000),\n ),\n }))\n .sort((a, b) => b.stale_days - a.stale_days)\n .slice(0, limit);\n}\n\nfunction buildRecentlyCreated(\n allNonTerminal: ItemMetadata[],\n statusRegistry: RuntimeStatusRegistry,\n childrenByParent: Map<string, ItemMetadata[]>,\n limit: number,\n): RecentContextItem[] {\n return allNonTerminal\n .map((item) => ({ item, sortKey: sortableTimestamp(item.created_at) }))\n .sort((left, right) => {\n const byCreated = compareTimestampStrings(right.sortKey, left.sortKey);\n return byCreated !== 0\n ? byCreated\n : left.item.id.localeCompare(right.item.id);\n })\n .slice(0, limit)\n .map(({ item }) => ({\n ...toContextFocusItem(item, statusRegistry, childrenByParent),\n created_at: item.created_at,\n }));\n}\n\nfunction buildUnparented(\n allNonTerminal: ItemMetadata[],\n statusRegistry: RuntimeStatusRegistry,\n childrenByParent: Map<string, ItemMetadata[]>,\n limit: number,\n): ContextFocusItem[] {\n return allNonTerminal\n .filter(\n (item) =>\n !normalizedParentId(item.parent) && !HIGH_LEVEL_TYPES.has(item.type),\n )\n .sort((left, right) => compareCriticalItems(left, right, statusRegistry))\n .slice(0, limit)\n .map((item) => toContextFocusItem(item, statusRegistry, childrenByParent));\n}\n\nfunction buildTestHealth(activeItems: ItemMetadata[]): TestHealthSummary {\n let itemsWithTests = 0;\n let itemsWithRecentRuns = 0;\n let passed = 0;\n let failed = 0;\n let skipped = 0;\n const itemsFailing: string[] = [];\n\n for (const item of activeItems) {\n if ((item.tests ?? []).length > 0) {\n itemsWithTests++;\n }\n const runs = item.test_runs ?? [];\n if (runs.length > 0) {\n itemsWithRecentRuns++;\n let itemHasFailure = false;\n for (const run of runs) {\n passed += run.passed ?? 0;\n failed += run.failed ?? 0;\n skipped += run.skipped ?? 0;\n if ((run.failed ?? 0) > 0) {\n itemHasFailure = true;\n }\n }\n if (itemHasFailure) {\n itemsFailing.push(item.id);\n }\n }\n }\n\n return {\n items_with_tests: itemsWithTests,\n items_with_recent_runs: itemsWithRecentRuns,\n recent_runs: { passed, failed, skipped },\n items_failing: itemsFailing.sort(),\n };\n}\n\n// ---------------------------------------------------------------------------\n// Markdown formatting\n// ---------------------------------------------------------------------------\n\nfunction formatClock(timestamp: string): string {\n return `${new Date(timestamp).toISOString().slice(11, 16)}Z`;\n}\n\nfunction formatFocusLine(item: ContextFocusItem): string {\n const orderToken = item.order === null ? \"-\" : String(item.order);\n const deadlineToken = item.deadline ?? \"-\";\n const parentToken = item.parent ? ` parent:${item.parent}` : \"\";\n const progressToken =\n item.children_total !== undefined &&\n item.children_closed !== undefined &&\n item.completion_pct !== undefined\n ? ` children:${item.children_closed}/${item.children_total} done:${item.completion_pct}%`\n : \"\";\n return `${item.id} p${item.priority} ${item.status} ${item.type} order:${orderToken} deadline:${deadlineToken}${parentToken}${progressToken} ${item.title}`;\n}\n\n// Renders a focus row projected to a `--fields` subset as space-separated\n// field:value tokens, mirroring the projection field order. Array values join\n// with commas; missing/null values render as `-`.\nfunction formatProjectedFocusLine(\n item: ContextFocusItem,\n fields: string[],\n): string {\n const source = item as unknown as Record<string, unknown>;\n return fields\n .map((field) => {\n const value = source[field];\n if (Array.isArray(value)) return `${field}:${value.join(\",\")}`;\n return `${field}:${value ?? \"-\"}`;\n })\n .join(\" \");\n}\n\nfunction formatAgendaLine(event: CalendarRow): string {\n const base = `${formatClock(event.at)} [${event.kind}] ${event.item_id} p${event.item_priority} ${event.item_status} ${event.item_title}`;\n if (event.kind === \"reminder\") {\n return `${base} — ${event.reminder_text}`;\n }\n if (event.kind === \"event\") {\n const recurringSuffix = event.event_recurring ? \" (recurring)\" : \"\";\n const title = event.event_title ?? event.item_title;\n return `${base} — ${title}${recurringSuffix}`;\n }\n return base;\n}\n\nfunction pushContextFocusSection(\n lines: string[],\n title: string,\n rows: ContextFocusItem[],\n emptyText: string,\n renderFocus: (item: ContextFocusItem) => string,\n): void {\n lines.push(`## ${title}`);\n if (rows.length === 0) {\n lines.push(emptyText);\n } else {\n for (const item of rows) {\n lines.push(`- ${renderFocus(item)}`);\n }\n }\n lines.push(\"\");\n}\n\nfunction pushBlockedFallbackSection(\n lines: string[],\n result: ContextResult,\n renderFocus: (item: ContextFocusItem) => string,\n): void {\n if (result.blocked_fallback.length === 0) {\n return;\n }\n lines.push(\"## Blocked fallback\");\n for (const item of result.blocked_fallback) {\n lines.push(`- ${renderFocus(item)}`);\n }\n lines.push(\"\");\n}\n\nfunction pushAgendaSection(lines: string[], result: ContextResult): void {\n lines.push(\"## Agenda\");\n lines.push(\n `- events: ${result.agenda.summary.events} (deadlines: ${result.agenda.summary.deadlines}, reminders: ${result.agenda.summary.reminders}, scheduled: ${result.agenda.summary.scheduled})`,\n );\n if (result.agenda.events.length === 0) {\n lines.push(\"No agenda events matched the selected filters.\");\n } else {\n for (const event of result.agenda.events) {\n lines.push(`- ${formatAgendaLine(event)}`);\n }\n }\n lines.push(\"\");\n}\n\nfunction pushHierarchySection(lines: string[], result: ContextResult): void {\n if (!result.hierarchy || result.hierarchy.length === 0) {\n return;\n }\n lines.push(\"## Hierarchy\");\n for (const node of result.hierarchy) {\n const pct =\n node.children_total > 0\n ? Math.round((node.children_closed / node.children_total) * 100)\n : 0;\n lines.push(\n `- ${node.id} ${node.type} ${node.status} \"${node.title}\" [${node.children_closed}/${node.children_total} done ${pct}%]`,\n );\n for (const child of node.children) {\n const cpct =\n child.children_total > 0\n ? Math.round((child.children_closed / child.children_total) * 100)\n : 0;\n lines.push(\n ` - ${child.id} ${child.type} ${child.status} \"${child.title}\" [${child.children_closed}/${child.children_total} done ${cpct}%]`,\n );\n }\n }\n lines.push(\"\");\n}\n\nfunction pushProgressSection(lines: string[], result: ContextResult): void {\n if (!result.progress || result.progress.length === 0) {\n return;\n }\n lines.push(\"## Progress\");\n for (const entry of result.progress) {\n lines.push(\n `- ${entry.id} \"${entry.title}\" ${entry.completion_pct}% (${entry.closed}/${entry.total} closed, ${entry.in_progress} wip, ${entry.open} open, ${entry.blocked} blocked)`,\n );\n }\n lines.push(\"\");\n}\n\nfunction pushRecentlyCreatedSection(\n lines: string[],\n result: ContextResult,\n focusFields: string[] | undefined,\n renderFocus: (item: ContextFocusItem) => string,\n): void {\n if (!result.recently_created || result.recently_created.length === 0) {\n return;\n }\n lines.push(\"## Recently created\");\n for (const item of result.recently_created) {\n lines.push(\n focusFields\n ? `- ${renderFocus(item)}`\n : `- ${dateTokenForTimestamp(item.created_at)} ${formatFocusLine(item)}`,\n );\n }\n lines.push(\"\");\n}\n\nfunction pushUnparentedSection(\n lines: string[],\n result: ContextResult,\n renderFocus: (item: ContextFocusItem) => string,\n): void {\n if (!result.unparented || result.unparented.length === 0) {\n return;\n }\n lines.push(\"## Unparented\");\n for (const item of result.unparented) {\n lines.push(`- ${renderFocus(item)}`);\n }\n lines.push(\"\");\n}\n\nfunction pushActivitySection(lines: string[], result: ContextResult): void {\n if (!result.activity || result.activity.length === 0) {\n return;\n }\n lines.push(\"## Recent activity\");\n for (const entry of result.activity) {\n const msg = entry.msg ? ` ${entry.msg}` : \"\";\n lines.push(\n `- ${entry.ts.slice(0, 16)}Z ${entry.id} ${entry.op} by:${entry.author}${msg}`,\n );\n }\n lines.push(\"\");\n}\n\nfunction pushBlockersSection(lines: string[], result: ContextResult): void {\n if (!result.blockers || result.blockers.length === 0) {\n return;\n }\n lines.push(\"## Blockers\");\n for (const entry of result.blockers) {\n const by = entry.blocked_by\n ? `blocked_by:${entry.blocked_by}(${entry.blocked_by_status ?? \"?\"})`\n : \"blocked_by:-\";\n const reason = entry.blocked_reason\n ? ` reason:\"${entry.blocked_reason}\"`\n : \"\";\n const note = entry.unblock_note ? ` unblock:\"${entry.unblock_note}\"` : \"\";\n lines.push(`- ${entry.id} \"${entry.title}\" ${by}${reason}${note}`);\n }\n lines.push(\"\");\n}\n\nfunction pushFilesSection(lines: string[], result: ContextResult): void {\n if (!result.files || result.files.length === 0) {\n return;\n }\n lines.push(\"## Hot files\");\n for (const file of result.files) {\n lines.push(\n `- ${file.path} refs:${file.references} items:[${file.items.join(\",\")}]`,\n );\n }\n lines.push(\"\");\n}\n\nfunction pushWorkloadSection(lines: string[], result: ContextResult): void {\n if (!result.workload || result.workload.length === 0) {\n return;\n }\n lines.push(\"## Workload\");\n for (const entry of result.workload) {\n const who = entry.assignee ?? \"(unassigned)\";\n lines.push(\n `- ${who} active:${entry.active} wip:${entry.in_progress} items:[${entry.items.join(\",\")}]`,\n );\n }\n lines.push(\"\");\n}\n\nfunction pushStalenessSection(lines: string[], result: ContextResult): void {\n if (!result.staleness || result.staleness.length === 0) {\n return;\n }\n lines.push(\"## Stale items\");\n for (const entry of result.staleness) {\n lines.push(\n `- ${entry.id} ${entry.status} stale:${entry.stale_days}d last:${entry.updated_at.slice(0, 10)} \"${entry.title}\"`,\n );\n }\n lines.push(\"\");\n}\n\nfunction pushTestHealthSection(lines: string[], result: ContextResult): void {\n if (!result.tests) {\n return;\n }\n lines.push(\"## Test health\");\n lines.push(`- items_with_tests: ${result.tests.items_with_tests}`);\n lines.push(\n `- items_with_recent_runs: ${result.tests.items_with_recent_runs}`,\n );\n lines.push(\n `- passed: ${result.tests.recent_runs.passed}, failed: ${result.tests.recent_runs.failed}, skipped: ${result.tests.recent_runs.skipped}`,\n );\n if (result.tests.items_failing.length > 0) {\n lines.push(`- items_failing: [${result.tests.items_failing.join(\",\")}]`);\n }\n lines.push(\"\");\n}\n\nfunction pushEmptyContextSuggestions(\n lines: string[],\n result: ContextResult,\n): void {\n const isEmpty =\n result.summary.active_items === 0 &&\n result.summary.blocked === 0 &&\n result.agenda.summary.events === 0;\n if (!isEmpty) {\n return;\n }\n lines.push(\"## Suggestions\");\n lines.push(\"No active work items or upcoming events. Consider:\");\n lines.push('- `pm create --type Task --title \"...\"` to add a new work item');\n lines.push(\n \"- `pm list --status closed --limit 5` to review recent completions\",\n );\n lines.push(\"- `pm search <keywords>` to find related past work\");\n lines.push(\"- `pm aggregate` for a full project status overview\");\n}\n\n/** Implements render context markdown for the public runtime surface of this module. */\nexport function renderContextMarkdown(result: ContextResult): string {\n const lines: string[] = [];\n const focusFields = result.focus_fields;\n const renderFocus = (item: ContextFocusItem): string =>\n focusFields\n ? formatProjectedFocusLine(item, focusFields)\n : formatFocusLine(item);\n lines.push(\"# pm context\");\n lines.push(\"\");\n lines.push(`- now: ${result.now}`);\n lines.push(`- depth: ${result.depth}`);\n if (result.filters.parent) {\n lines.push(`- scope: subtree of ${result.filters.parent}`);\n }\n lines.push(\n `- active_items: ${result.summary.active_items} (in_progress: ${result.summary.in_progress}, open: ${result.summary.open})`,\n );\n if (result.summary.total_items !== undefined) {\n lines.push(\n `- total_items: ${result.summary.total_items} (closed: ${result.summary.closed ?? 0}, canceled: ${result.summary.canceled ?? 0})`,\n );\n }\n lines.push(`- agenda_events: ${result.summary.agenda_events}`);\n lines.push(\n `- blocked_fallback_used: ${result.summary.blocked_fallback_used}`,\n );\n const renderedSections = result.sections_included.filter(\n (section) => section !== \"blockers\" || (result.blockers?.length ?? 0) > 0,\n );\n if (renderedSections.length > 0) {\n lines.push(`- sections: ${renderedSections.join(\", \")}`);\n }\n lines.push(\"\");\n\n pushContextFocusSection(\n lines,\n \"High-level focus\",\n result.high_level,\n \"No high-level active items.\",\n renderFocus,\n );\n pushContextFocusSection(\n lines,\n \"Low-level focus\",\n result.low_level,\n \"No low-level active items.\",\n renderFocus,\n );\n pushBlockedFallbackSection(lines, result, renderFocus);\n pushAgendaSection(lines, result);\n pushHierarchySection(lines, result);\n pushProgressSection(lines, result);\n pushRecentlyCreatedSection(lines, result, focusFields, renderFocus);\n pushUnparentedSection(lines, result, renderFocus);\n pushActivitySection(lines, result);\n pushBlockersSection(lines, result);\n pushFilesSection(lines, result);\n pushWorkloadSection(lines, result);\n pushStalenessSection(lines, result);\n pushTestHealthSection(lines, result);\n pushEmptyContextSuggestions(lines, result);\n\n return lines.join(\"\\n\");\n}\n\n// ---------------------------------------------------------------------------\n// Main runner\n// ---------------------------------------------------------------------------\n\ninterface ContextRuntime {\n settings: PmSettings;\n contextSettings: ContextSettings;\n statusRegistry: RuntimeStatusRegistry;\n depth: ContextDepth;\n limit: number;\n sectionsIncluded: ContextSectionName[];\n activityLimit: number;\n staleThresholdDays: number;\n parentScope: string | undefined;\n focusFields: string[] | undefined;\n baseListOptions: Record<string, unknown>;\n}\n\ninterface ContextCorpus {\n listed: Awaited<ReturnType<typeof runList>>;\n listedItemMetadata: ItemMetadata[];\n allItems: ItemMetadata[];\n fullCorpus: ItemMetadata[];\n subtreeIds: Set<string> | undefined;\n}\n\ninterface ContextFocusGroups {\n activeItems: ItemMetadata[];\n blockedItems: ItemMetadata[];\n highLevel: ContextFocusItem[];\n lowLevel: ContextFocusItem[];\n blockedFallback: ContextFocusItem[];\n blockedFallbackUsed: boolean;\n ranking: ContextRelevanceReport<ItemMetadata>;\n packing: ContextPackingReport<ItemMetadata>;\n pageExtras: {\n has_more?: boolean;\n next_cursor?: string;\n applied_limit?: number;\n truncated?: true;\n };\n}\n\ninterface ContextOptionalSections {\n hierarchy?: HierarchyNode[];\n activity?: CompactActivityEntry[];\n progress?: ProgressEntry[];\n blockersSection?: BlockerEntry[];\n recentlyCreated?: RecentContextItem[];\n unparented?: ContextFocusItem[];\n filesSection?: HotFile[];\n workload?: WorkloadEntry[];\n staleness?: StaleEntry[];\n tests?: TestHealthSummary;\n}\n\nasync function resolveContextRuntime(\n options: ContextOptions,\n global: GlobalOptions,\n): Promise<ContextRuntime> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n const settings = await readSettings(pmRoot);\n /* c8 ignore start -- settings persistence currently always materializes context defaults */\n const contextSettings = settings.context ?? SETTINGS_DEFAULTS.context;\n /* c8 ignore stop */\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const depth = parseContextDepth(options.depth, contextSettings);\n return {\n settings,\n contextSettings,\n statusRegistry,\n depth,\n limit: parseContextLimit(options.limit ?? options.maxItems, depth),\n sectionsIncluded: parseContextSections(\n options.section,\n depth,\n contextSettings,\n ),\n activityLimit: parseActivityLimit(options.activityLimit, contextSettings),\n staleThresholdDays: parseStaleThresholdDays(\n options.staleThreshold,\n contextSettings,\n ),\n parentScope: parseContextParent(options.parent),\n focusFields: parseContextFocusFields(options.fields),\n baseListOptions: stripListProjectionFlags(options),\n };\n}\n\nfunction contextNeedsAllItems(sectionsIncluded: ContextSectionName[]): boolean {\n return sectionsIncluded.some((section) =>\n [\n \"hierarchy\",\n \"progress\",\n \"blockers\",\n \"staleness\",\n \"recently_created\",\n \"unparented\",\n ].includes(section),\n );\n}\n\nfunction buildUnpaginatedContextListOptions(\n baseListOptions: Record<string, unknown>,\n extra: Partial<ListOptions>,\n): ListOptions {\n return {\n ...baseListOptions,\n ...extra,\n noTruncate: true,\n limit: undefined,\n offset: undefined,\n after: undefined,\n };\n}\n\nasync function loadContextCorpus(\n options: ContextOptions,\n global: GlobalOptions,\n runtime: ContextRuntime,\n): Promise<ContextCorpus> {\n const needsAllItems = contextNeedsAllItems(runtime.sectionsIncluded);\n const listOptions = buildUnpaginatedContextListOptions(\n runtime.baseListOptions,\n { excludeTerminal: true },\n );\n const listed = await runList(undefined, listOptions, global);\n let listedItemMetadata = listed.items as ItemMetadata[];\n let allItems: ItemMetadata[] = listedItemMetadata;\n if (needsAllItems || runtime.parentScope !== undefined) {\n const allListed = await runList(\n undefined,\n buildUnpaginatedContextListOptions(runtime.baseListOptions, {\n excludeTerminal: false,\n }),\n global,\n );\n allItems = allListed.items as ItemMetadata[];\n }\n const fullCorpus = allItems;\n const subtreeIds = resolveContextSubtreeIds(runtime.parentScope, fullCorpus);\n if (subtreeIds) {\n listedItemMetadata = listedItemMetadata.filter((item) =>\n subtreeIds.has(item.id.trim().toLowerCase()),\n );\n allItems = allItems.filter((item) =>\n subtreeIds.has(item.id.trim().toLowerCase()),\n );\n }\n return { listed, listedItemMetadata, allItems, fullCorpus, subtreeIds };\n}\n\nfunction resolveContextSubtreeIds(\n parentScope: string | undefined,\n fullCorpus: ItemMetadata[],\n): Set<string> | undefined {\n if (parentScope === undefined) {\n return undefined;\n }\n const subtree = collectSubtreeIds(fullCorpus, parentScope);\n if (!subtree.found) {\n throw new PmCliError(\n `Context --parent item not found: ${parentScope}`,\n EXIT_CODE.NOT_FOUND,\n );\n }\n return subtree.ids;\n}\n\nasync function resolveContextFocusGroups(\n listedItemMetadata: ItemMetadata[],\n allItems: ItemMetadata[],\n statusRegistry: RuntimeStatusRegistry,\n sectionsIncluded: ContextSectionName[],\n limit: number,\n now: string,\n author: string,\n cursor: string | undefined,\n cursorFingerprint: string,\n useBoundedPage: boolean,\n pmRoot: string,\n): Promise<ContextFocusGroups> {\n const structural = [...listedItemMetadata].sort((left, right) =>\n compareCriticalItems(left, right, statusRegistry),\n );\n const usage = await readContextUsageAffinity({\n pmRoot,\n author,\n enabled: process.env.PM_CONTEXT_USAGE_DISABLED !== \"1\",\n });\n const ranking = await scoreContextCandidatesWithActiveExtensions(\n \"context\",\n buildItemContextRelevanceCandidates(\n structural,\n statusRegistry,\n now,\n author,\n usage.affinity,\n ),\n );\n const ranked = ranking.ranked.map((entry) => entry.item);\n const activeStatuses = statusRegistry.active_statuses;\n const rankedActiveItems = ranked.filter((item) =>\n activeStatuses.has(normalizeStatusForRegistry(item.status, statusRegistry)),\n );\n const pageStart = useBoundedPage\n ? resolveQueryCursorStart(\n rankedActiveItems,\n cursor,\n cursorFingerprint,\n (item) => item.id,\n )\n : 0;\n const focusPage = useBoundedPage\n ? rankedActiveItems.slice(pageStart, pageStart + limit)\n : rankedActiveItems;\n const hasMore =\n useBoundedPage &&\n focusPage.length > 0 &&\n pageStart + focusPage.length < rankedActiveItems.length;\n const nextCursor =\n hasMore && focusPage.length > 0\n ? encodeQueryCursor(\n cursorFingerprint,\n focusPage[focusPage.length - 1]!.id,\n pageStart + focusPage.length - 1,\n )\n : undefined;\n const rankedBlockedItems = ranked.filter((item) =>\n statusRegistry.blocked_statuses.has(\n normalizeStatusForRegistry(item.status, statusRegistry),\n ),\n );\n const packingIds = new Set([\n ...focusPage.map((item) => item.id),\n ...rankedBlockedItems.slice(0, limit).map((item) => item.id),\n ]);\n const packing = packRankedContextItems(\n { ...ranking, ranked: ranking.ranked.filter((entry) => packingIds.has(entry.id)) },\n Math.max(256, limit * 160),\n );\n const packedItems = packing.included.map((entry) => entry.item);\n const activeItems = packedItems.filter((item) =>\n activeStatuses.has(normalizeStatusForRegistry(item.status, statusRegistry)),\n );\n const blockedItems = packedItems.filter((item) =>\n statusRegistry.blocked_statuses.has(\n normalizeStatusForRegistry(item.status, statusRegistry),\n ),\n );\n const childrenByParent = buildChildrenByParent(allItems);\n const focusChildrenByParent = contextNeedsAllItems(sectionsIncluded)\n ? childrenByParent\n : undefined;\n const highLevel = activeItems\n .filter((item) => HIGH_LEVEL_TYPES.has(item.type))\n .slice(0, useBoundedPage ? focusPage.length : limit)\n .map((item) =>\n toContextFocusItem(item, statusRegistry, focusChildrenByParent),\n );\n const lowLevel = activeItems\n .filter((item) => !HIGH_LEVEL_TYPES.has(item.type))\n .slice(0, useBoundedPage ? focusPage.length : limit)\n .map((item) =>\n toContextFocusItem(item, statusRegistry, focusChildrenByParent),\n );\n const blockedFallbackUsed = rankedActiveItems.length === 0;\n return {\n activeItems,\n blockedItems,\n highLevel,\n lowLevel,\n blockedFallback: blockedFallbackUsed\n ? blockedItems\n .slice(0, limit)\n .map((item) =>\n toContextFocusItem(item, statusRegistry, focusChildrenByParent),\n )\n : [],\n blockedFallbackUsed,\n ranking,\n packing,\n pageExtras: {\n ...(useBoundedPage ? { applied_limit: limit } : {}),\n ...(hasMore ? { has_more: true, truncated: true } : {}),\n ...(nextCursor ? { next_cursor: nextCursor } : {}),\n },\n };\n}\n\nfunction buildContextCursorFingerprint(options: ContextOptions): string {\n const normalizedOptions: Record<string, unknown> = { ...options };\n delete normalizedOptions.after;\n delete normalizedOptions.limit;\n delete normalizedOptions.maxItems;\n delete normalizedOptions.format;\n delete normalizedOptions.fields;\n delete normalizedOptions.section;\n delete normalizedOptions.activityLimit;\n delete normalizedOptions.staleThreshold;\n delete normalizedOptions.explainRanking;\n return createQueryFingerprint(\"context\", normalizedOptions);\n}\n\nfunction shouldPageContextFocus(\n options: ContextOptions,\n corpusItemCount: number,\n): boolean {\n return (\n options.limit !== undefined ||\n options.maxItems !== undefined ||\n options.after !== undefined ||\n corpusItemCount >= CONTEXT_SCALE_THRESHOLD\n );\n}\n\nasync function buildContextAgenda(\n options: ContextOptions,\n global: GlobalOptions,\n runtime: ContextRuntime,\n subtreeIds: Set<string> | undefined,\n): Promise<{\n agenda: Awaited<ReturnType<typeof runCalendar>>;\n agendaEvents: CalendarRow[];\n agendaSummary: ContextAgendaSummary;\n}> {\n const calendarOptions: CalendarOptions = {\n ...runtime.baseListOptions,\n view: \"agenda\",\n include: \"all\",\n limit:\n runtime.parentScope === undefined ? String(runtime.limit) : undefined,\n };\n const agenda = await runCalendar(calendarOptions, global);\n const scopedAgenda =\n subtreeIds === undefined\n ? agenda.events\n : agenda.events.filter((event) =>\n subtreeIds.has(event.item_id.trim().toLowerCase()),\n );\n const agendaEvents = filterTerminalCalendarEvents(\n scopedAgenda,\n runtime.statusRegistry,\n ).slice(0, runtime.limit);\n return { agenda, agendaEvents, agendaSummary: summarizeAgenda(agendaEvents) };\n}\n\nfunction countContextStatus(\n items: ItemMetadata[],\n status: string | undefined,\n statusRegistry: RuntimeStatusRegistry,\n): number {\n const targetStatus = String(status);\n return items.filter(\n (item) =>\n normalizeStatusForRegistry(item.status, statusRegistry) === targetStatus,\n ).length;\n}\n\nasync function buildOptionalContextSections(params: {\n runtime: ContextRuntime;\n allItems: ItemMetadata[];\n fullCorpus: ItemMetadata[];\n focusGroups: ContextFocusGroups;\n now: string;\n global: GlobalOptions;\n}): Promise<ContextOptionalSections> {\n const { runtime, allItems, fullCorpus, focusGroups, now, global } = params;\n const childrenByParent = buildChildrenByParent(allItems);\n const itemMap = new Map(fullCorpus.map((item) => [item.id, item]));\n const allNonTerminal = allItems.filter(\n (item) => !isTerminalStatus(item.status, runtime.statusRegistry),\n );\n const has = (section: ContextSectionName) =>\n runtime.sectionsIncluded.includes(section);\n return {\n hierarchy: has(\"hierarchy\")\n ? buildHierarchy(\n allItems,\n focusGroups.activeItems,\n runtime.statusRegistry,\n runtime.limit,\n )\n : undefined,\n activity: has(\"activity\")\n ? await buildActivity(runtime.activityLimit, global)\n : undefined,\n progress: has(\"progress\")\n ? buildProgress(\n allItems,\n focusGroups.activeItems,\n runtime.statusRegistry,\n runtime.limit,\n )\n : undefined,\n blockersSection: has(\"blockers\")\n ? buildBlockers(focusGroups.blockedItems, itemMap, runtime.limit)\n : undefined,\n recentlyCreated: has(\"recently_created\")\n ? buildRecentlyCreated(\n allNonTerminal,\n runtime.statusRegistry,\n childrenByParent,\n runtime.limit,\n )\n : undefined,\n unparented: has(\"unparented\")\n ? buildUnparented(\n allNonTerminal,\n runtime.statusRegistry,\n childrenByParent,\n runtime.limit,\n )\n : undefined,\n filesSection: has(\"files\")\n ? buildHotFiles(focusGroups.activeItems, runtime.limit)\n : undefined,\n workload: has(\"workload\")\n ? buildWorkload(\n focusGroups.activeItems,\n runtime.statusRegistry,\n runtime.limit,\n )\n : undefined,\n staleness: has(\"staleness\")\n ? buildStaleness(\n allNonTerminal,\n runtime.staleThresholdDays,\n now,\n runtime.limit,\n )\n : undefined,\n tests: has(\"tests\") ? buildTestHealth(focusGroups.activeItems) : undefined,\n };\n}\n\nfunction buildContextSummaryExtras(\n needsAllItems: boolean,\n allItems: ItemMetadata[],\n statusRegistry: RuntimeStatusRegistry,\n): Pick<ContextSummary, \"total_items\" | \"closed\" | \"canceled\"> {\n if (!needsAllItems) {\n return {};\n }\n const canceledStatus = normalizeStatusInput(\"canceled\", statusRegistry);\n return {\n total_items: allItems.length,\n closed: allItems.filter((item) =>\n isClosedStatus(item.status, statusRegistry),\n ).length,\n canceled: allItems.filter(\n (item) =>\n normalizeStatusForRegistry(item.status, statusRegistry) ===\n canceledStatus,\n ).length,\n };\n}\n\nfunction attachOptionalContextSections(\n result: ContextResult,\n sections: ContextOptionalSections,\n): void {\n if (sections.hierarchy) result.hierarchy = sections.hierarchy;\n if (sections.activity) result.activity = sections.activity;\n if (sections.progress) result.progress = sections.progress;\n if (sections.blockersSection) result.blockers = sections.blockersSection;\n if (sections.recentlyCreated)\n result.recently_created = sections.recentlyCreated;\n if (sections.unparented) result.unparented = sections.unparented;\n if (sections.filesSection) result.files = sections.filesSection;\n if (sections.workload) result.workload = sections.workload;\n if (sections.staleness) result.staleness = sections.staleness;\n if (sections.tests) result.tests = sections.tests;\n}\n\nfunction applyContextFocusProjection(\n result: ContextResult,\n focusFields: string[] | undefined,\n): void {\n if (!focusFields) {\n return;\n }\n result.focus_fields = focusFields;\n result.high_level = projectContextFocusRows(result.high_level, focusFields);\n result.low_level = projectContextFocusRows(result.low_level, focusFields);\n result.blocked_fallback = projectContextFocusRows(\n result.blocked_fallback,\n focusFields,\n );\n if (result.recently_created) {\n result.recently_created = projectContextFocusRows(\n result.recently_created,\n focusFields,\n ) as RecentContextItem[];\n }\n if (result.unparented) {\n result.unparented = projectContextFocusRows(result.unparented, focusFields);\n }\n}\n\nfunction maybeAttachEmptyContextSuggestions(\n result: ContextResult,\n activeItems: ItemMetadata[],\n blockedItems: ItemMetadata[],\n): void {\n if (\n activeItems.length > 0 ||\n blockedItems.length > 0 ||\n result.agenda.events.length > 0\n ) {\n return;\n }\n result.suggestions = [\n 'pm create --type Task --title \"...\" to add a new work item',\n \"pm list --status closed --limit 5 to review recent completions\",\n \"pm search <keywords> to find related past work\",\n \"pm aggregate for a full project status overview\",\n ];\n}\n\nasync function attachContextUsageFeedback(\n result: ContextResult,\n focusGroups: ContextFocusGroups,\n pmRoot: string,\n author: string,\n): Promise<void> {\n try {\n const included = new Set(\n focusGroups.packing.included.map((entry) => entry.id),\n );\n await recordContextUsageServing({\n pmRoot,\n author,\n surface: \"context\",\n profile: focusGroups.packing.profile,\n rows: focusGroups.ranking.ranked.map((entry) => ({\n id: entry.id,\n rank: entry.rank,\n included: included.has(entry.id),\n })),\n enabled: process.env.PM_CONTEXT_USAGE_DISABLED !== \"1\",\n });\n } catch {\n result.warnings = mergeSortedWarnings(result.warnings, [\n \"context_usage_feedback_write_failed\",\n ]);\n }\n}\n\n/** Implements run context for the public runtime surface of this module. */\nexport async function runContext(\n options: ContextOptions,\n global: GlobalOptions,\n): Promise<ContextResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n const resolvedRuntime = await resolveContextRuntime(options, global);\n const corpus = await loadContextCorpus(options, global, resolvedRuntime);\n const runtime = {\n ...resolvedRuntime,\n limit: resolveContextLimitAtScale(\n resolvedRuntime.limit,\n corpus.fullCorpus.length,\n ),\n };\n const author = process.env.PM_AUTHOR ?? runtime.settings.author_default;\n const focusGroups = await resolveContextFocusGroups(\n corpus.listedItemMetadata,\n corpus.allItems,\n runtime.statusRegistry,\n runtime.sectionsIncluded,\n runtime.limit,\n nowIso(),\n author,\n options.after,\n buildContextCursorFingerprint(options),\n shouldPageContextFocus(options, corpus.fullCorpus.length),\n pmRoot,\n );\n const agendaContext = await buildContextAgenda(\n options,\n global,\n runtime,\n corpus.subtreeIds,\n );\n const warnings = mergeSortedWarnings(\n corpus.listed.warnings,\n agendaContext.agenda.warnings,\n focusGroups.ranking.warnings,\n );\n const inProgressCount = countContextStatus(\n focusGroups.activeItems,\n normalizeStatusInput(\"in_progress\", runtime.statusRegistry),\n runtime.statusRegistry,\n );\n const openCount = countContextStatus(\n focusGroups.activeItems,\n normalizeStatusInput(\"open\", runtime.statusRegistry),\n runtime.statusRegistry,\n );\n const sections = await buildOptionalContextSections({\n runtime,\n allItems: corpus.allItems,\n fullCorpus: corpus.fullCorpus,\n focusGroups,\n now: agendaContext.agenda.now,\n global,\n });\n const summaryExtras = buildContextSummaryExtras(\n contextNeedsAllItems(runtime.sectionsIncluded),\n corpus.allItems,\n runtime.statusRegistry,\n );\n\n const result: ContextResult = {\n output_default: \"toon\",\n now: agendaContext.agenda.now,\n depth: runtime.depth,\n sections_included: runtime.sectionsIncluded,\n window: {\n anchor: agendaContext.agenda.anchor,\n start: agendaContext.agenda.range.start,\n end: agendaContext.agenda.range.end,\n past: agendaContext.agenda.range.past,\n from: agendaContext.agenda.range.from,\n to: agendaContext.agenda.range.to,\n },\n filters: {\n type: options.type ?? null,\n tag: options.tag ?? null,\n priority: options.priority ?? null,\n assignee: options.assignee ?? null,\n assignee_filter: options.assigneeFilter ?? null,\n sprint: options.sprint ?? null,\n release: options.release ?? null,\n limit: options.limit ?? options.maxItems ?? null,\n parent: runtime.parentScope ?? null,\n /* c8 ignore next -- listed/calendar runtime filters are always materialized by their command handlers */\n runtime_filters: (corpus.listed.filters.runtime_filters ??\n agendaContext.agenda.filters.runtime_filters ??\n {}) as Record<string, unknown>,\n },\n summary: {\n active_items: focusGroups.activeItems.length,\n in_progress: inProgressCount,\n open: openCount,\n blocked: focusGroups.blockedItems.length,\n blocked_fallback_used: focusGroups.blockedFallbackUsed,\n high_level: focusGroups.highLevel.length,\n low_level: focusGroups.lowLevel.length,\n agenda_events: agendaContext.agendaSummary.events,\n ...summaryExtras,\n },\n high_level: focusGroups.highLevel,\n low_level: focusGroups.lowLevel,\n blocked_fallback: focusGroups.blockedFallback,\n agenda: {\n summary: agendaContext.agendaSummary,\n events: agendaContext.agendaEvents,\n },\n ...focusGroups.pageExtras,\n };\n\n attachOptionalContextSections(result, sections);\n if (options.explainRanking === true) {\n result.ranking = toContextRankingSummary(focusGroups.ranking);\n result.packing = toContextPackingSummary(focusGroups.packing);\n }\n applyContextFocusProjection(result, runtime.focusFields);\n if (warnings.length > 0) result.warnings = warnings;\n maybeAttachEmptyContextSuggestions(\n result,\n focusGroups.activeItems,\n focusGroups.blockedItems,\n );\n await attachContextUsageFeedback(result, focusGroups, pmRoot, author);\n\n return result;\n}\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE9E,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EACL,gBAAgB,EAChB,0BAA0B,EAC1B,oBAAoB,GACrB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,4BAA4B,GAE7B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,8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