@unbrained/pm-cli 2026.7.16 → 2026.7.17
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 +17 -2
- package/CONTRIBUTING.md +2 -2
- package/dist/cli/bootstrap-args.d.ts +2 -115
- package/dist/cli/bootstrap-args.js +4 -831
- package/dist/cli/bootstrap-args.js.map +1 -1
- package/dist/cli/commands/eval.d.ts +4 -64
- package/dist/cli/commands/eval.js +4 -153
- package/dist/cli/commands/eval.js.map +1 -1
- package/dist/cli/commands/linked-test-entry.d.ts +6 -6
- package/dist/cli/commands/linked-test-entry.js +4 -65
- package/dist/cli/commands/linked-test-entry.js.map +1 -1
- package/dist/cli/commands/linked-test-parsers.d.ts +3 -45
- package/dist/cli/commands/linked-test-parsers.js +4 -516
- package/dist/cli/commands/linked-test-parsers.js.map +1 -1
- package/dist/cli/commands/list.d.ts +3 -210
- package/dist/cli/commands/list.js +4 -1068
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/search.d.ts +3 -464
- package/dist/cli/commands/search.js +4 -2236
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/stats.d.ts +6 -66
- package/dist/cli/commands/stats.js +4 -157
- package/dist/cli/commands/stats.js.map +1 -1
- package/dist/cli/commands/telemetry.d.ts +6 -14
- package/dist/cli/commands/telemetry.js +4 -349
- package/dist/cli/commands/telemetry.js.map +1 -1
- package/dist/cli/commands/test-all.d.ts +6 -95
- package/dist/cli/commands/test-all.js +4 -439
- package/dist/cli/commands/test-all.js.map +1 -1
- package/dist/cli/commands/test-runs.d.ts +6 -92
- package/dist/cli/commands/test-runs.js +4 -189
- package/dist/cli/commands/test-runs.js.map +1 -1
- package/dist/cli/commands/test.d.ts +6 -244
- package/dist/cli/commands/test.js +4 -1780
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/commands/update-many.d.ts +15 -29
- package/dist/cli/commands/update-many.js +355 -259
- package/dist/cli/commands/update-many.js.map +1 -1
- package/dist/cli/main.js +140 -133
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/search-refresh.js +4 -9
- package/dist/cli/search-refresh.js.map +1 -1
- package/dist/cli/shared-parsers.d.ts +6 -9
- package/dist/cli/shared-parsers.js +4 -37
- package/dist/cli/shared-parsers.js.map +1 -1
- package/dist/cli/telemetry-flush.js +4 -4
- package/dist/cli/telemetry-flush.js.map +1 -1
- package/dist/cli-bundle/bundle-manifest.json +341 -341
- package/dist/cli-bundle/chunks/{append-OJQFUQ4T.js → append-5YF3TO7I.js} +5 -5
- package/dist/cli-bundle/chunks/append-JHO5K6RP.js +11 -0
- package/dist/cli-bundle/chunks/{chunk-WT3ZEOGH.js → chunk-23TCGBRK.js} +16 -7
- package/dist/cli-bundle/chunks/{chunk-WT3ZEOGH.js.map → chunk-23TCGBRK.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-BCOFWYW4.js → chunk-2BX74BAS.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-APRVSW2O.js → chunk-2CXL335K.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-KG44YSKD.js → chunk-2FUOXSRN.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-HDH3JUGG.js → chunk-2IPNL3DR.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-J6364LFM.js → chunk-2MPMKJF2.js} +9 -18
- package/dist/cli-bundle/chunks/{chunk-J6364LFM.js.map → chunk-2MPMKJF2.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-GM5QHQU6.js → chunk-2XOSFSTH.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-K3WII2ME.js → chunk-37DRDP2B.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-2WSE6PO2.js → chunk-37V5MXAU.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-UWQHLMEB.js → chunk-3D4YVTNG.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-PMOSXADO.js → chunk-47HXN6RX.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-6CFNAVTF.js → chunk-5HGZKQUL.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-2IFFUZLC.js → chunk-5UKQLQM2.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-DM4H7FP4.js → chunk-633PKXLT.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-XSJUSQAE.js → chunk-646MQXFW.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ZI6VQWQ7.js → chunk-66MKH7SZ.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-S6MQESFR.js → chunk-67RO3H4N.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-34L5OT3Y.js → chunk-6DYOZS6C.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-RRM5JYJC.js → chunk-6O44IN44.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ONG5V5CI.js → chunk-6XAZB6SE.js} +97 -69
- package/dist/cli-bundle/chunks/chunk-6XAZB6SE.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-PENXZX3U.js → chunk-74FKFFXO.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-LPYWLWDS.js → chunk-7CTQ7WW5.js} +37 -37
- package/dist/cli-bundle/chunks/chunk-7CTQ7WW5.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-HO4KXD6I.js → chunk-7H5NNCJ5.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-XXXF6PAQ.js → chunk-7LTCLTRG.js} +69 -61
- package/dist/cli-bundle/chunks/chunk-7LTCLTRG.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-TQSZFPIS.js → chunk-AFGKSHAM.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-JXQUXVMI.js → chunk-AFSV5HBB.js} +77 -7
- package/dist/cli-bundle/chunks/{chunk-JXQUXVMI.js.map → chunk-AFSV5HBB.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-6N2VXVTQ.js → chunk-ARGDWQ4J.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3U7ZR6M4.js → chunk-B57RJHBZ.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-7B67ZL4N.js → chunk-B6SH2YNN.js} +75 -5
- package/dist/cli-bundle/chunks/{chunk-7B67ZL4N.js.map → chunk-B6SH2YNN.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-YCQET3OT.js → chunk-BAP7G3N2.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-QKXHFPYM.js → chunk-BIRYX32V.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-RMLWNPH2.js → chunk-BVLOMU6O.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-YBLZ2VE7.js → chunk-CFSUNEL7.js} +320 -239
- package/dist/cli-bundle/chunks/chunk-CFSUNEL7.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-2VPAVL7O.js → chunk-CKX4WOPC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-TKOVBP6C.js → chunk-D52ZN3BF.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-KPMKHGEA.js → chunk-D53RTYVI.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-ODALILG3.js → chunk-D5XHO4Q7.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-E2OJMKML.js → chunk-DCC2AQBD.js} +18 -9
- package/dist/cli-bundle/chunks/{chunk-E2OJMKML.js.map → chunk-DCC2AQBD.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-YAQEBNY7.js → chunk-DDFGYUCQ.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-EAB64KLB.js → chunk-DG2EQRIH.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-IG3SWA4A.js → chunk-EHJFUOXL.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-ONREO4ST.js → chunk-EY7ZE3TG.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-EJEXHTY5.js → chunk-FHOBCGQO.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-H3EIEWGR.js → chunk-FL4D53ND.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WUJQK4YV.js → chunk-FVNWHUME.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-INU6DKT5.js → chunk-FXFCFL73.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-QEHQ2GVG.js → chunk-FY4RLHSC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-EACOH7AU.js → chunk-FZGM3PNA.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-FNSPG7MU.js → chunk-G6KM4YKY.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-AHVTB5I5.js → chunk-G6MYGULG.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-TSMHDIW4.js → chunk-GLZKZON6.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-2JKGO6QX.js → chunk-H5IOT54C.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-5ZSLZLDN.js → chunk-HF63SBLC.js} +585 -456
- package/dist/cli-bundle/chunks/chunk-HF63SBLC.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-SELVXEZK.js → chunk-HO4DLBNK.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3CLU2XZO.js → chunk-HSYV4ZYT.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-EH2OPHBI.js → chunk-HTXXXF45.js} +23 -19
- package/dist/cli-bundle/chunks/chunk-HTXXXF45.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-CRVF2JDM.js → chunk-HXVHBERL.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-NU3IMIEA.js → chunk-I7DIDUSP.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-2NCIPMQP.js → chunk-I7GY4X6Y.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JYFOV7FC.js → chunk-IE5KRAKN.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-UY2ACEMF.js → chunk-ILVOOAT4.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-GOSLKLFE.js → chunk-KH6QAHME.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-J6EY5V4N.js → chunk-KOEZCHRF.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-QKECXBBG.js → chunk-KX62NMZC.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-QKECXBBG.js.map → chunk-KX62NMZC.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-WQPUU7XD.js → chunk-L337QKWJ.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-LSG2U345.js → chunk-L6FVNR7X.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-ILX33QXL.js → chunk-LLODAQMP.js} +706 -532
- package/dist/cli-bundle/chunks/chunk-LLODAQMP.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-FMBNM2EN.js → chunk-LSOWTLEM.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4223PVZT.js → chunk-M7MVOKVV.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-MNV226E4.js +834 -0
- package/dist/cli-bundle/chunks/chunk-MNV226E4.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-UMOPHQSU.js → chunk-MR4SHYR4.js} +41 -19
- package/dist/cli-bundle/chunks/chunk-MR4SHYR4.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-BKVG6XOA.js → chunk-MSGETE6I.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-3WM75PWC.js → chunk-N33FD2UI.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-UFXU44HV.js → chunk-N7I2DGLP.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-3S5QVM5H.js → chunk-NCAFUBJX.js} +13 -13
- package/dist/cli-bundle/chunks/chunk-NCAFUBJX.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-6S3YSUYG.js → chunk-NNANAWFH.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-IJIICKVW.js → chunk-NTRQLE2R.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-SDQLJWBO.js → chunk-NVZ6NVHJ.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-H2Z3FYXQ.js → chunk-OWP6QFBV.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-Q7A43DS4.js → chunk-P22HGFFI.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NLDFBC6J.js → chunk-P56LKFQX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NVPZIJVR.js → chunk-PT7MCCGD.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-P74IZQ7A.js → chunk-QKVVV6QO.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-5JLUII3O.js → chunk-QNUAZYGW.js} +321 -240
- package/dist/cli-bundle/chunks/chunk-QNUAZYGW.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-QIPLHNP7.js → chunk-QWBKN3QC.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-7PIWCHTW.js → chunk-R5XTTZSJ.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-JOUQZENX.js → chunk-RC4UOUXA.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-BEP7WJA2.js → chunk-RGMWJLXF.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-NP22ERDF.js → chunk-RTBX3C4C.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-HYB5AZ63.js → chunk-S46R2M3W.js} +117 -71
- package/dist/cli-bundle/chunks/chunk-S46R2M3W.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-H5APFTHZ.js → chunk-S6FF7VW6.js} +18 -18
- package/dist/cli-bundle/chunks/chunk-S6FF7VW6.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-UXONS674.js → chunk-SIJV365F.js} +54 -55
- package/dist/cli-bundle/chunks/chunk-SIJV365F.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-7Z4LKRS4.js → chunk-SPFZV2GR.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-ULTHRDBP.js → chunk-TM5CIO3F.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-4XQ3BDV4.js → chunk-V3VBXQQV.js} +36 -36
- package/dist/cli-bundle/chunks/chunk-V3VBXQQV.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-YAROI3PD.js → chunk-V7MP6YTN.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-OW4JWD5M.js → chunk-VAHZIPWS.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-DYH63FX7.js → chunk-VE6ZSTQW.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-3AUGG2DP.js → chunk-W5E2UUSH.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-BSEQUTQP.js → chunk-WACRQ26A.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-BSEQUTQP.js.map → chunk-WACRQ26A.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-UOHFKBUV.js → chunk-WL3SS45P.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-QKJGPFAF.js → chunk-WU3KAN6A.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-IA5FKNII.js → chunk-X2MGQMZO.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-TD3LVC7D.js → chunk-X5YCTFKT.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-B7PE22W6.js → chunk-XC2HEEOV.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-J5AOEGDC.js → chunk-XNPMDSQQ.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-K2X6U4UA.js → chunk-XXLXJL7V.js} +4 -4
- package/dist/cli-bundle/chunks/chunk-XYJK6GIQ.js +851 -0
- package/dist/cli-bundle/chunks/chunk-XYJK6GIQ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-RLCHOOHC.js → chunk-YJSURTBB.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-PGY23YTC.js → chunk-YKFHF37B.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-JFTKLTEF.js → chunk-YQCWK2MB.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-EYLCSJAI.js → chunk-YQEZWI3R.js} +2 -2
- package/dist/cli-bundle/chunks/close-BEP7MHF3.js +12 -0
- package/dist/cli-bundle/chunks/{close-CWODTPKG.js → close-Y6QFUJQN.js} +5 -5
- package/dist/cli-bundle/chunks/{close-many-CQFUY7MR.js → close-many-JJFW7KTT.js} +14 -14
- package/dist/cli-bundle/chunks/close-many-QJ6FKJUE.js +23 -0
- package/dist/cli-bundle/chunks/comments-2AOZQ5D2.js +13 -0
- package/dist/cli-bundle/chunks/{comments-WGLHR7LB.js → comments-TMHMALA5.js} +7 -7
- package/dist/cli-bundle/chunks/{copy-LXVDXH7B.js → copy-FWQA5OU4.js} +4 -4
- package/dist/cli-bundle/chunks/copy-N3LCQBMC.js +9 -0
- package/dist/cli-bundle/chunks/{create-LBVCYMEG.js → create-AQ5SIGZC.js} +9 -9
- package/dist/cli-bundle/chunks/{create-J5U6ND4K.js → create-KOGQ3JKD.js} +9 -9
- package/dist/cli-bundle/chunks/delete-6G3MBZ6S.js +10 -0
- package/dist/cli-bundle/chunks/{delete-PMJBNY5G.js → delete-YYYFOSEA.js} +4 -4
- package/dist/cli-bundle/chunks/{deps-OA26IS25.js → deps-5NC4IZH7.js} +5 -5
- package/dist/cli-bundle/chunks/{deps-JZ7TMVCB.js → deps-EVTOQMKW.js} +5 -5
- package/dist/cli-bundle/chunks/{docs-FEWB2DQB.js → docs-53NUGMIQ.js} +6 -6
- package/dist/cli-bundle/chunks/docs-OWRGDMNY.js +14 -0
- package/dist/cli-bundle/chunks/{files-EFIWKFTM.js → files-3PXGXYDB.js} +6 -6
- package/dist/cli-bundle/chunks/{files-6YFBJRBG.js → files-EGLKHD7O.js} +6 -6
- package/dist/cli-bundle/chunks/focus-KZLIA6WS.js +10 -0
- package/dist/cli-bundle/chunks/{focus-4QJR7FOQ.js → focus-SRPASFTN.js} +5 -5
- package/dist/cli-bundle/chunks/{history-compact-CKRPDTJN.js → history-compact-G4DULDCX.js} +6 -6
- package/dist/cli-bundle/chunks/history-compact-HHIUOMZ7.js +16 -0
- package/dist/cli-bundle/chunks/{history-redact-BB3TGDAE.js → history-redact-IUSJ6X3E.js} +4 -4
- package/dist/cli-bundle/chunks/{history-redact-D225BHOZ.js → history-redact-THHGRQXV.js} +4 -4
- package/dist/cli-bundle/chunks/history-repair-KG7SWXI6.js +16 -0
- package/dist/cli-bundle/chunks/{history-repair-RQXKQHL4.js → history-repair-LUQWRS7X.js} +6 -6
- package/dist/cli-bundle/chunks/{learnings-JLNLCOL5.js → learnings-2MRNBFJF.js} +7 -7
- package/dist/cli-bundle/chunks/learnings-ZVHSALJY.js +13 -0
- package/dist/cli-bundle/chunks/{notes-GB47XXQQ.js → notes-73JWKWUD.js} +7 -7
- package/dist/cli-bundle/chunks/notes-BAKUL5DJ.js +13 -0
- package/dist/cli-bundle/chunks/{plan-VDCJ2PCN.js → plan-AZPMCG37.js} +10 -10
- package/dist/cli-bundle/chunks/plan-LEAGLPGP.js +24 -0
- package/dist/cli-bundle/chunks/{profile-IVXQEL3D.js → profile-AGUKS52S.js} +9 -9
- package/dist/cli-bundle/chunks/{profile-FAU7NZML.js → profile-U2B6Y7GE.js} +9 -9
- package/dist/cli-bundle/chunks/{register-list-query-UL4UKBBN.js → register-list-query-A5KRJ5J2.js} +16 -16
- package/dist/cli-bundle/chunks/{register-list-query-DKA3EH5D.js → register-list-query-NEYP3TXO.js} +16 -16
- package/dist/cli-bundle/chunks/{register-mutation-RBBJ52DK.js → register-mutation-6LOPBAHC.js} +29 -29
- package/dist/cli-bundle/chunks/{register-mutation-ARFHRW55.js → register-mutation-GCZOALNJ.js} +29 -29
- package/dist/cli-bundle/chunks/{register-operations-ZIBBRSED.js → register-operations-6ZZIF27A.js} +35 -35
- package/dist/cli-bundle/chunks/{register-operations-ZUJ5JWPE.js → register-operations-REDIAEGI.js} +35 -35
- package/dist/cli-bundle/chunks/{register-setup-TDCGWIOS.js → register-setup-BHPMN5SK.js} +15 -15
- package/dist/cli-bundle/chunks/{register-setup-BCVLFEYS.js → register-setup-J3JS2ZVT.js} +15 -15
- package/dist/cli-bundle/chunks/{restore-25DLT2Q2.js → restore-E3PRGDN3.js} +6 -6
- package/dist/cli-bundle/chunks/restore-KIUYTAEJ.js +14 -0
- package/dist/cli-bundle/chunks/{schema-FNU3WE4O.js → schema-5JNFQFUW.js} +6 -6
- package/dist/cli-bundle/chunks/{schema-NBCM3RAD.js → schema-TMIW4XZC.js} +6 -6
- package/dist/cli-bundle/chunks/update-PQQHLYCC.js +21 -0
- package/dist/cli-bundle/chunks/{update-XHSIAIXE.js → update-SA6AG23P.js} +12 -12
- package/dist/cli-bundle/chunks/update-many-RQVTFJPD.js +36 -0
- package/dist/cli-bundle/chunks/update-many-TV3L3KBX.js +32 -0
- package/dist/cli-bundle/main.js +153 -855
- package/dist/cli-bundle/main.js.map +4 -4
- package/dist/cli-bundle/sdk-runtime.js +54 -54
- package/dist/cli-bundle/sdk-testing.js +6 -6
- package/dist/cli-bundle/sdk.js +195 -59
- package/dist/cli-bundle/sdk.js.map +3 -3
- package/dist/core/extensions/item-fields.js +2 -2
- package/dist/core/extensions/item-fields.js.map +1 -1
- package/dist/sdk/cli-bootstrap.d.ts +122 -0
- package/dist/sdk/cli-bootstrap.js +879 -0
- package/dist/sdk/cli-bootstrap.js.map +1 -0
- package/dist/sdk/eval.d.ts +66 -0
- package/dist/sdk/eval.js +186 -0
- package/dist/sdk/eval.js.map +1 -0
- package/dist/sdk/index.d.ts +16 -4
- package/dist/sdk/index.js +18 -6
- package/dist/sdk/index.js.map +1 -1
- package/dist/{cli/commands → sdk/query}/item-filter-options.d.ts +1 -1
- package/dist/{cli/commands → sdk/query}/item-filter-options.js +3 -3
- package/dist/sdk/query/item-filter-options.js.map +1 -0
- package/dist/sdk/query/list.d.ts +254 -0
- package/dist/sdk/query/list.js +1073 -0
- package/dist/sdk/query/list.js.map +1 -0
- package/dist/sdk/query/parsers.d.ts +9 -0
- package/dist/sdk/query/parsers.js +45 -0
- package/dist/sdk/query/parsers.js.map +1 -0
- package/dist/{cli/commands → sdk/query}/search-pagination.js +4 -4
- package/dist/sdk/query/search-pagination.js.map +1 -0
- package/dist/{cli/commands → sdk/query}/search-rendering.js +3 -3
- package/dist/sdk/query/search-rendering.js.map +1 -0
- package/dist/sdk/query/search.d.ts +469 -0
- package/dist/sdk/query/search.js +2247 -0
- package/dist/sdk/query/search.js.map +1 -0
- package/dist/sdk/runtime.d.ts +7 -7
- package/dist/sdk/runtime.js +13 -7
- package/dist/sdk/runtime.js.map +1 -1
- package/dist/sdk/search-refresh-worker.d.ts +2 -0
- package/dist/sdk/search-refresh-worker.js +19 -0
- package/dist/sdk/search-refresh-worker.js.map +1 -0
- package/dist/sdk/stats.d.ts +66 -0
- package/dist/sdk/stats.js +151 -0
- package/dist/sdk/stats.js.map +1 -0
- package/dist/sdk/telemetry-flush.d.ts +2 -0
- package/dist/sdk/telemetry-flush.js +14 -0
- package/dist/sdk/telemetry-flush.js.map +1 -0
- package/dist/sdk/telemetry.d.ts +14 -0
- package/dist/sdk/telemetry.js +398 -0
- package/dist/sdk/telemetry.js.map +1 -0
- package/dist/sdk/test/batch.d.ts +94 -0
- package/dist/sdk/test/batch.js +492 -0
- package/dist/sdk/test/batch.js.map +1 -0
- package/dist/sdk/test/entry.d.ts +6 -0
- package/dist/sdk/test/entry.js +74 -0
- package/dist/sdk/test/entry.js.map +1 -0
- package/dist/sdk/test/execution.d.ts +282 -0
- package/dist/sdk/test/execution.js +1817 -0
- package/dist/sdk/test/execution.js.map +1 -0
- package/dist/sdk/test/parsers.d.ts +48 -0
- package/dist/sdk/test/parsers.js +522 -0
- package/dist/sdk/test/parsers.js.map +1 -0
- package/dist/sdk/test/runs.d.ts +92 -0
- package/dist/sdk/test/runs.js +195 -0
- package/dist/sdk/test/runs.js.map +1 -0
- package/docs/SDK.md +122 -0
- package/docs/SDK_PRIMITIVE_INVENTORY.md +5 -3
- package/docs/examples/sdk-custom-tool/README.md +27 -0
- package/docs/examples/sdk-custom-tool/package.json +13 -0
- package/docs/examples/sdk-custom-tool/src/cli.ts +36 -0
- package/docs/examples/sdk-custom-tool/src/entry.ts +15 -0
- package/docs/examples/sdk-custom-tool/src/index.ts +223 -0
- package/marketplace.json +2 -2
- package/package.json +4 -4
- 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/extensions/governance-audit/comments-audit.ts +77 -57
- package/packages/pm-governance-audit/extensions/governance-audit/dedupe-audit.ts +202 -194
- package/packages/pm-governance-audit/extensions/governance-audit/dedupe-merge.ts +227 -153
- package/packages/pm-governance-audit/extensions/governance-audit/normalize.ts +169 -125
- package/packages/pm-governance-audit/extensions/governance-audit/runtime-utils.ts +130 -81
- package/packages/pm-governance-audit/extensions/governance-audit/sdk.ts +53 -4
- 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/item-filter-options.js.map +0 -1
- package/dist/cli/commands/search-pagination.js.map +0 -1
- package/dist/cli/commands/search-rendering.js.map +0 -1
- package/dist/cli-bundle/chunks/append-UZVHUO74.js +0 -11
- package/dist/cli-bundle/chunks/chunk-3S5QVM5H.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-4XQ3BDV4.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5JLUII3O.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-5ZSLZLDN.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-EH2OPHBI.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-H5APFTHZ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-HYB5AZ63.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-ILX33QXL.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-LPYWLWDS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ONG5V5CI.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-UMOPHQSU.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-UXONS674.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-XXXF6PAQ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-YBLZ2VE7.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-YXSHIAUJ.js +0 -58
- package/dist/cli-bundle/chunks/chunk-YXSHIAUJ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ZKRZY773.js +0 -68
- package/dist/cli-bundle/chunks/chunk-ZKRZY773.js.map +0 -7
- package/dist/cli-bundle/chunks/close-W6LI2PKM.js +0 -12
- package/dist/cli-bundle/chunks/close-many-DLDDVSH5.js +0 -23
- package/dist/cli-bundle/chunks/comments-E3TNTK24.js +0 -13
- package/dist/cli-bundle/chunks/copy-Q5ZJPUKR.js +0 -9
- package/dist/cli-bundle/chunks/delete-WNHB3LYW.js +0 -10
- package/dist/cli-bundle/chunks/docs-HA2AIDBB.js +0 -14
- package/dist/cli-bundle/chunks/focus-POIW5LTJ.js +0 -10
- package/dist/cli-bundle/chunks/history-compact-FWG2C7FZ.js +0 -16
- package/dist/cli-bundle/chunks/history-repair-6GEAM7HE.js +0 -16
- package/dist/cli-bundle/chunks/learnings-RSNLSWDC.js +0 -13
- package/dist/cli-bundle/chunks/notes-2WDH6DXU.js +0 -13
- package/dist/cli-bundle/chunks/plan-DOVI2VMW.js +0 -24
- package/dist/cli-bundle/chunks/restore-YPMVUUEX.js +0 -14
- package/dist/cli-bundle/chunks/update-WWBYOPXO.js +0 -21
- package/dist/cli-bundle/chunks/update-many-OUGIU5SF.js +0 -32
- package/dist/cli-bundle/chunks/update-many-TA7NGQBO.js +0 -36
- /package/dist/cli-bundle/chunks/{append-OJQFUQ4T.js.map → append-5YF3TO7I.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-UZVHUO74.js.map → append-JHO5K6RP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BCOFWYW4.js.map → chunk-2BX74BAS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-APRVSW2O.js.map → chunk-2CXL335K.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KG44YSKD.js.map → chunk-2FUOXSRN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HDH3JUGG.js.map → chunk-2IPNL3DR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GM5QHQU6.js.map → chunk-2XOSFSTH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-K3WII2ME.js.map → chunk-37DRDP2B.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2WSE6PO2.js.map → chunk-37V5MXAU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UWQHLMEB.js.map → chunk-3D4YVTNG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-PMOSXADO.js.map → chunk-47HXN6RX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6CFNAVTF.js.map → chunk-5HGZKQUL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2IFFUZLC.js.map → chunk-5UKQLQM2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DM4H7FP4.js.map → chunk-633PKXLT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XSJUSQAE.js.map → chunk-646MQXFW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZI6VQWQ7.js.map → chunk-66MKH7SZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-S6MQESFR.js.map → chunk-67RO3H4N.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-34L5OT3Y.js.map → chunk-6DYOZS6C.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RRM5JYJC.js.map → chunk-6O44IN44.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-PENXZX3U.js.map → chunk-74FKFFXO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HO4KXD6I.js.map → chunk-7H5NNCJ5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TQSZFPIS.js.map → chunk-AFGKSHAM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6N2VXVTQ.js.map → chunk-ARGDWQ4J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3U7ZR6M4.js.map → chunk-B57RJHBZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YCQET3OT.js.map → chunk-BAP7G3N2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QKXHFPYM.js.map → chunk-BIRYX32V.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RMLWNPH2.js.map → chunk-BVLOMU6O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2VPAVL7O.js.map → chunk-CKX4WOPC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TKOVBP6C.js.map → chunk-D52ZN3BF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KPMKHGEA.js.map → chunk-D53RTYVI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ODALILG3.js.map → chunk-D5XHO4Q7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YAQEBNY7.js.map → chunk-DDFGYUCQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EAB64KLB.js.map → chunk-DG2EQRIH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IG3SWA4A.js.map → chunk-EHJFUOXL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ONREO4ST.js.map → chunk-EY7ZE3TG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EJEXHTY5.js.map → chunk-FHOBCGQO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-H3EIEWGR.js.map → chunk-FL4D53ND.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WUJQK4YV.js.map → chunk-FVNWHUME.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-INU6DKT5.js.map → chunk-FXFCFL73.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QEHQ2GVG.js.map → chunk-FY4RLHSC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EACOH7AU.js.map → chunk-FZGM3PNA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FNSPG7MU.js.map → chunk-G6KM4YKY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AHVTB5I5.js.map → chunk-G6MYGULG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TSMHDIW4.js.map → chunk-GLZKZON6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2JKGO6QX.js.map → chunk-H5IOT54C.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SELVXEZK.js.map → chunk-HO4DLBNK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3CLU2XZO.js.map → chunk-HSYV4ZYT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CRVF2JDM.js.map → chunk-HXVHBERL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NU3IMIEA.js.map → chunk-I7DIDUSP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2NCIPMQP.js.map → chunk-I7GY4X6Y.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JYFOV7FC.js.map → chunk-IE5KRAKN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UY2ACEMF.js.map → chunk-ILVOOAT4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GOSLKLFE.js.map → chunk-KH6QAHME.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-J6EY5V4N.js.map → chunk-KOEZCHRF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WQPUU7XD.js.map → chunk-L337QKWJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LSG2U345.js.map → chunk-L6FVNR7X.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FMBNM2EN.js.map → chunk-LSOWTLEM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4223PVZT.js.map → chunk-M7MVOKVV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BKVG6XOA.js.map → chunk-MSGETE6I.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3WM75PWC.js.map → chunk-N33FD2UI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UFXU44HV.js.map → chunk-N7I2DGLP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6S3YSUYG.js.map → chunk-NNANAWFH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IJIICKVW.js.map → chunk-NTRQLE2R.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SDQLJWBO.js.map → chunk-NVZ6NVHJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-H2Z3FYXQ.js.map → chunk-OWP6QFBV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Q7A43DS4.js.map → chunk-P22HGFFI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NLDFBC6J.js.map → chunk-P56LKFQX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NVPZIJVR.js.map → chunk-PT7MCCGD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-P74IZQ7A.js.map → chunk-QKVVV6QO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QIPLHNP7.js.map → chunk-QWBKN3QC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7PIWCHTW.js.map → chunk-R5XTTZSJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JOUQZENX.js.map → chunk-RC4UOUXA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BEP7WJA2.js.map → chunk-RGMWJLXF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NP22ERDF.js.map → chunk-RTBX3C4C.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7Z4LKRS4.js.map → chunk-SPFZV2GR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ULTHRDBP.js.map → chunk-TM5CIO3F.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YAROI3PD.js.map → chunk-V7MP6YTN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OW4JWD5M.js.map → chunk-VAHZIPWS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DYH63FX7.js.map → chunk-VE6ZSTQW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3AUGG2DP.js.map → chunk-W5E2UUSH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UOHFKBUV.js.map → chunk-WL3SS45P.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QKJGPFAF.js.map → chunk-WU3KAN6A.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IA5FKNII.js.map → chunk-X2MGQMZO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TD3LVC7D.js.map → chunk-X5YCTFKT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-B7PE22W6.js.map → chunk-XC2HEEOV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-J5AOEGDC.js.map → chunk-XNPMDSQQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-K2X6U4UA.js.map → chunk-XXLXJL7V.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RLCHOOHC.js.map → chunk-YJSURTBB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-PGY23YTC.js.map → chunk-YKFHF37B.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JFTKLTEF.js.map → chunk-YQCWK2MB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EYLCSJAI.js.map → chunk-YQEZWI3R.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-W6LI2PKM.js.map → close-BEP7MHF3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-CWODTPKG.js.map → close-Y6QFUJQN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-CQFUY7MR.js.map → close-many-JJFW7KTT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-DLDDVSH5.js.map → close-many-QJ6FKJUE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-E3TNTK24.js.map → comments-2AOZQ5D2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-WGLHR7LB.js.map → comments-TMHMALA5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-LXVDXH7B.js.map → copy-FWQA5OU4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-Q5ZJPUKR.js.map → copy-N3LCQBMC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-LBVCYMEG.js.map → create-AQ5SIGZC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-J5U6ND4K.js.map → create-KOGQ3JKD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-WNHB3LYW.js.map → delete-6G3MBZ6S.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-PMJBNY5G.js.map → delete-YYYFOSEA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-OA26IS25.js.map → deps-5NC4IZH7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-JZ7TMVCB.js.map → deps-EVTOQMKW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-FEWB2DQB.js.map → docs-53NUGMIQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-HA2AIDBB.js.map → docs-OWRGDMNY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-EFIWKFTM.js.map → files-3PXGXYDB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-6YFBJRBG.js.map → files-EGLKHD7O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-POIW5LTJ.js.map → focus-KZLIA6WS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-4QJR7FOQ.js.map → focus-SRPASFTN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-CKRPDTJN.js.map → history-compact-G4DULDCX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-FWG2C7FZ.js.map → history-compact-HHIUOMZ7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-BB3TGDAE.js.map → history-redact-IUSJ6X3E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-D225BHOZ.js.map → history-redact-THHGRQXV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-6GEAM7HE.js.map → history-repair-KG7SWXI6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-RQXKQHL4.js.map → history-repair-LUQWRS7X.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-JLNLCOL5.js.map → learnings-2MRNBFJF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-RSNLSWDC.js.map → learnings-ZVHSALJY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-GB47XXQQ.js.map → notes-73JWKWUD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-2WDH6DXU.js.map → notes-BAKUL5DJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-VDCJ2PCN.js.map → plan-AZPMCG37.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-DOVI2VMW.js.map → plan-LEAGLPGP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{profile-IVXQEL3D.js.map → profile-AGUKS52S.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{profile-FAU7NZML.js.map → profile-U2B6Y7GE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-list-query-UL4UKBBN.js.map → register-list-query-A5KRJ5J2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-list-query-DKA3EH5D.js.map → register-list-query-NEYP3TXO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-mutation-RBBJ52DK.js.map → register-mutation-6LOPBAHC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-mutation-ARFHRW55.js.map → register-mutation-GCZOALNJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-operations-ZIBBRSED.js.map → register-operations-6ZZIF27A.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-operations-ZUJ5JWPE.js.map → register-operations-REDIAEGI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-setup-TDCGWIOS.js.map → register-setup-BHPMN5SK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-setup-BCVLFEYS.js.map → register-setup-J3JS2ZVT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-25DLT2Q2.js.map → restore-E3PRGDN3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-YPMVUUEX.js.map → restore-KIUYTAEJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-FNU3WE4O.js.map → schema-5JNFQFUW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-NBCM3RAD.js.map → schema-TMIW4XZC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-WWBYOPXO.js.map → update-PQQHLYCC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-XHSIAIXE.js.map → update-SA6AG23P.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-TA7NGQBO.js.map → update-many-RQVTFJPD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-OUGIU5SF.js.map → update-many-TV3L3KBX.js.map} +0 -0
- /package/dist/{cli/commands → sdk/query}/search-pagination.d.ts +0 -0
- /package/dist/{cli/commands → sdk/query}/search-rendering.d.ts +0 -0
|
@@ -0,0 +1,1073 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module sdk/query/list
|
|
3
|
+
*
|
|
4
|
+
* Implements the pm list command surface and its agent-facing runtime behavior.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="255af95f-1741-5e74-a528-4fa8ae65ee4c")}catch(e){}}();
|
|
8
|
+
import { pathExists } from "../../core/fs/fs-utils.js";
|
|
9
|
+
import { getActiveExtensionRegistrations } from "../../core/extensions/index.js";
|
|
10
|
+
import { toItemRecord } from "../../core/item/item-record.js";
|
|
11
|
+
import { isTerminalStatus } from "../../core/item/status.js";
|
|
12
|
+
import { isStatusAllFilterInput, parseStatusFilterCsv, } from "../../core/item/status-filter.js";
|
|
13
|
+
import { resolveItemTypeRegistry, } from "../../core/item/type-registry.js";
|
|
14
|
+
import { parseIntegerLimit, parsePriority, parseType } from "./parsers.js";
|
|
15
|
+
import { collectRuntimeFilterValues, matchesRuntimeFilters, } from "../../core/schema/runtime-field-filters.js";
|
|
16
|
+
import { hasMissingMetadataFilter, itemMatchesMissingMetadata, lifecycleClassifierFromStatusRegistry, } from "../../core/governance/metadata-coverage.js";
|
|
17
|
+
import { contentFiltersNeedBody, contentFiltersNeedCollections, hasContentFieldFilter, itemMatchesContentFilters, } from "../../core/governance/content-fields.js";
|
|
18
|
+
import { resolveRuntimeFieldRegistry, resolveRuntimeStatusRegistry, } from "../../core/schema/runtime-schema.js";
|
|
19
|
+
import { EXIT_CODE, ITEM_METADATA_KEY_ORDER, } from "../../core/shared/constants.js";
|
|
20
|
+
import { PmCliError } from "../../core/shared/errors.js";
|
|
21
|
+
import { compareTimestampStrings, matchesTimestampFilters, nowIso, resolveIsoOrRelative, } from "../../core/shared/time.js";
|
|
22
|
+
import { listAllItemMetadata, listAllItemMetadataLight, listAllItemMetadataWithBody, } from "../../core/store/item-store.js";
|
|
23
|
+
import { HEAVY_METADATA_KEYS } from "../../core/store/item-metadata-cache.js";
|
|
24
|
+
import { getSettingsPath, resolvePmRoot } from "../../core/store/paths.js";
|
|
25
|
+
import { readSettings } from "../../core/store/settings.js";
|
|
26
|
+
import { createQueryFingerprint, encodeQueryCursor, resolveQueryCursorStart, } from "../pagination.js";
|
|
27
|
+
/** Extract the missing-metadata selection filters from list/update-many options. */
|
|
28
|
+
export const resolveMissingMetadataFilters = (options) => {
|
|
29
|
+
return {
|
|
30
|
+
acMissing: options.filterAcMissing === true,
|
|
31
|
+
estimatesMissing: options.filterEstimatesMissing === true,
|
|
32
|
+
resolutionMissing: options.filterResolutionMissing === true,
|
|
33
|
+
metadataMissing: options.filterMetadataMissing === true,
|
|
34
|
+
reviewerMissing: options.filterReviewerMissing === true,
|
|
35
|
+
riskMissing: options.filterRiskMissing === true,
|
|
36
|
+
confidenceMissing: options.filterConfidenceMissing === true,
|
|
37
|
+
sprintMissing: options.filterSprintMissing === true,
|
|
38
|
+
releaseMissing: options.filterReleaseMissing === true,
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
const CONTENT_FIELD_FLAG_MAPPINGS = [
|
|
42
|
+
{
|
|
43
|
+
field: "notes",
|
|
44
|
+
presentKey: "hasNotes",
|
|
45
|
+
absentKey: "noNotes",
|
|
46
|
+
presentFlag: "--has-notes",
|
|
47
|
+
absentFlag: "--no-notes",
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
field: "learnings",
|
|
51
|
+
presentKey: "hasLearnings",
|
|
52
|
+
absentKey: "noLearnings",
|
|
53
|
+
presentFlag: "--has-learnings",
|
|
54
|
+
absentFlag: "--no-learnings",
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
field: "files",
|
|
58
|
+
presentKey: "hasFiles",
|
|
59
|
+
absentKey: "noFiles",
|
|
60
|
+
presentFlag: "--has-files",
|
|
61
|
+
absentFlag: "--no-files",
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
field: "docs",
|
|
65
|
+
presentKey: "hasDocs",
|
|
66
|
+
absentKey: "noDocs",
|
|
67
|
+
presentFlag: "--has-docs",
|
|
68
|
+
absentFlag: "--no-docs",
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
field: "tests",
|
|
72
|
+
presentKey: "hasTests",
|
|
73
|
+
absentKey: "noTests",
|
|
74
|
+
presentFlag: "--has-tests",
|
|
75
|
+
absentFlag: "--no-tests",
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
field: "comments",
|
|
79
|
+
presentKey: "hasComments",
|
|
80
|
+
absentKey: "noComments",
|
|
81
|
+
presentFlag: "--has-comments",
|
|
82
|
+
absentFlag: "--no-comments",
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
field: "deps",
|
|
86
|
+
presentKey: "hasDeps",
|
|
87
|
+
absentKey: "noDeps",
|
|
88
|
+
presentFlag: "--has-deps",
|
|
89
|
+
absentFlag: "--no-deps",
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
field: "body",
|
|
93
|
+
presentKey: "hasBody",
|
|
94
|
+
absentKey: "emptyBody",
|
|
95
|
+
presentFlag: "--has-body",
|
|
96
|
+
absentFlag: "--empty-body",
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
field: "linked_command",
|
|
100
|
+
presentKey: "hasLinkedCommand",
|
|
101
|
+
absentKey: "noLinkedCommand",
|
|
102
|
+
presentFlag: "--has-linked-command",
|
|
103
|
+
absentFlag: "--no-linked-command",
|
|
104
|
+
},
|
|
105
|
+
];
|
|
106
|
+
/** Resolve the content-field presence/absence selections from list/search options. A field requested both present AND absent is a usage error (the two selections are mutually exclusive). Returns an empty object when no content-field filter is active. */
|
|
107
|
+
export const resolveContentFieldFilters = (options) => {
|
|
108
|
+
const conflict = CONTENT_FIELD_FLAG_MAPPINGS.find((mapping) => options[mapping.presentKey] === true &&
|
|
109
|
+
options[mapping.absentKey] === true);
|
|
110
|
+
if (conflict) {
|
|
111
|
+
throw new PmCliError(`Cannot combine ${conflict.presentFlag} with ${conflict.absentFlag} for the same field.`, EXIT_CODE.USAGE);
|
|
112
|
+
}
|
|
113
|
+
return Object.fromEntries(CONTENT_FIELD_FLAG_MAPPINGS.flatMap((mapping) => {
|
|
114
|
+
if (options[mapping.presentKey] === true) {
|
|
115
|
+
return [[mapping.field, "present"]];
|
|
116
|
+
}
|
|
117
|
+
return options[mapping.absentKey] === true
|
|
118
|
+
? [[mapping.field, "absent"]]
|
|
119
|
+
: [];
|
|
120
|
+
}));
|
|
121
|
+
};
|
|
122
|
+
/** Public contract for list sort fields, shared by SDK and presentation-layer consumers. */
|
|
123
|
+
export const LIST_SORT_FIELDS = [
|
|
124
|
+
"priority",
|
|
125
|
+
"deadline",
|
|
126
|
+
"updated_at",
|
|
127
|
+
"created_at",
|
|
128
|
+
"title",
|
|
129
|
+
"parent",
|
|
130
|
+
];
|
|
131
|
+
/** Supported values accepted by the list sort order contract. */
|
|
132
|
+
export const LIST_SORT_ORDER_VALUES = ["asc", "desc"];
|
|
133
|
+
const DEFAULT_COMPACT_LIST_FIELDS = [
|
|
134
|
+
"id",
|
|
135
|
+
"title",
|
|
136
|
+
"status",
|
|
137
|
+
"type",
|
|
138
|
+
"priority",
|
|
139
|
+
"parent",
|
|
140
|
+
"updated_at",
|
|
141
|
+
];
|
|
142
|
+
const BRIEF_LIST_FIELDS = ["id", "status", "type", "title"];
|
|
143
|
+
const TREE_METADATA_FIELDS = [
|
|
144
|
+
"tree_depth",
|
|
145
|
+
"tree_parent",
|
|
146
|
+
"tree_children",
|
|
147
|
+
"tree_title",
|
|
148
|
+
];
|
|
149
|
+
// A projection that selects any heavy collection field (or `--full`, which returns
|
|
150
|
+
// items verbatim) must load the full metadata; everything else takes the light path.
|
|
151
|
+
// Sourced from the single HEAVY_METADATA_KEYS definition in the cache layer so the
|
|
152
|
+
// light/heavy split can never drift between the cache and the projection routing.
|
|
153
|
+
const HEAVY_PROJECTION_FIELDS = new Set(HEAVY_METADATA_KEYS);
|
|
154
|
+
function isNonEmptyRecord(value) {
|
|
155
|
+
return (typeof value === "object" &&
|
|
156
|
+
value !== null &&
|
|
157
|
+
!Array.isArray(value) &&
|
|
158
|
+
Object.keys(value).length > 0);
|
|
159
|
+
}
|
|
160
|
+
// Active content-field filter flags, keyed by the options dest and the snake_case
|
|
161
|
+
// summary key emitted in the filters echo (GH-242). Presence and absence are
|
|
162
|
+
// distinct echo keys (has_notes vs no_notes; has_body vs empty_body).
|
|
163
|
+
const CONTENT_FILTER_ECHO_ENTRIES = [
|
|
164
|
+
{ key: "hasNotes", summaryKey: "has_notes" },
|
|
165
|
+
{ key: "hasLearnings", summaryKey: "has_learnings" },
|
|
166
|
+
{ key: "hasFiles", summaryKey: "has_files" },
|
|
167
|
+
{ key: "hasDocs", summaryKey: "has_docs" },
|
|
168
|
+
{ key: "hasTests", summaryKey: "has_tests" },
|
|
169
|
+
{ key: "hasComments", summaryKey: "has_comments" },
|
|
170
|
+
{ key: "hasDeps", summaryKey: "has_deps" },
|
|
171
|
+
{ key: "hasBody", summaryKey: "has_body" },
|
|
172
|
+
{ key: "hasLinkedCommand", summaryKey: "has_linked_command" },
|
|
173
|
+
{ key: "noNotes", summaryKey: "no_notes" },
|
|
174
|
+
{ key: "noLearnings", summaryKey: "no_learnings" },
|
|
175
|
+
{ key: "noFiles", summaryKey: "no_files" },
|
|
176
|
+
{ key: "noDocs", summaryKey: "no_docs" },
|
|
177
|
+
{ key: "noTests", summaryKey: "no_tests" },
|
|
178
|
+
{ key: "noComments", summaryKey: "no_comments" },
|
|
179
|
+
{ key: "noDeps", summaryKey: "no_deps" },
|
|
180
|
+
{ key: "emptyBody", summaryKey: "empty_body" },
|
|
181
|
+
{ key: "noLinkedCommand", summaryKey: "no_linked_command" },
|
|
182
|
+
];
|
|
183
|
+
// Active governance-missing filter flags (GH-236), keyed by options dest and the
|
|
184
|
+
// snake_case summary key emitted in the filters echo.
|
|
185
|
+
const GOVERNANCE_MISSING_ECHO_ENTRIES = [
|
|
186
|
+
{ key: "filterReviewerMissing", summaryKey: "filter_reviewer_missing" },
|
|
187
|
+
{ key: "filterRiskMissing", summaryKey: "filter_risk_missing" },
|
|
188
|
+
{ key: "filterConfidenceMissing", summaryKey: "filter_confidence_missing" },
|
|
189
|
+
{ key: "filterSprintMissing", summaryKey: "filter_sprint_missing" },
|
|
190
|
+
{ key: "filterReleaseMissing", summaryKey: "filter_release_missing" },
|
|
191
|
+
];
|
|
192
|
+
function applyContentFilterEcho(filters, options) {
|
|
193
|
+
for (const entry of CONTENT_FILTER_ECHO_ENTRIES) {
|
|
194
|
+
if (options[entry.key] === true) {
|
|
195
|
+
filters[entry.summaryKey] = true;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
function applyGovernanceMissingFilterEcho(filters, options) {
|
|
200
|
+
for (const entry of GOVERNANCE_MISSING_ECHO_ENTRIES) {
|
|
201
|
+
if (options[entry.key] === true) {
|
|
202
|
+
filters[entry.summaryKey] = true;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Copies user-supplied option values into compact filter summaries.
|
|
208
|
+
*
|
|
209
|
+
* Compact list/search responses are optimized for agent context: they echo only
|
|
210
|
+
* filters the caller actually supplied. Keeping this helper shared prevents the
|
|
211
|
+
* list and search command summaries from drifting as new scalar filters are
|
|
212
|
+
* added.
|
|
213
|
+
*/
|
|
214
|
+
export function applyFilterValueEcho(filters, options, entries) {
|
|
215
|
+
for (const entry of entries) {
|
|
216
|
+
const value = options[entry.optionKey];
|
|
217
|
+
if (value !== undefined) {
|
|
218
|
+
filters[entry.summaryKey] = entry.normalize
|
|
219
|
+
? entry.normalize(value)
|
|
220
|
+
: value;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
/** Implements build content filter echo for the public runtime surface of this module. */
|
|
225
|
+
export function buildContentFilterEcho(options) {
|
|
226
|
+
const echo = {};
|
|
227
|
+
applyContentFilterEcho(echo, options);
|
|
228
|
+
return echo;
|
|
229
|
+
}
|
|
230
|
+
/** Implements build governance missing filter echo for the public runtime surface of this module. */
|
|
231
|
+
export function buildGovernanceMissingFilterEcho(options) {
|
|
232
|
+
const echo = {};
|
|
233
|
+
applyGovernanceMissingFilterEcho(echo, options);
|
|
234
|
+
return echo;
|
|
235
|
+
}
|
|
236
|
+
const COMPACT_LIST_VALUE_FILTER_ECHO_ENTRIES = [
|
|
237
|
+
{ optionKey: "type", summaryKey: "type" },
|
|
238
|
+
{ optionKey: "tag", summaryKey: "tag" },
|
|
239
|
+
{ optionKey: "priority", summaryKey: "priority" },
|
|
240
|
+
{ optionKey: "deadlineBefore", summaryKey: "deadline_before" },
|
|
241
|
+
{ optionKey: "deadlineAfter", summaryKey: "deadline_after" },
|
|
242
|
+
{ optionKey: "updatedAfter", summaryKey: "updated_after" },
|
|
243
|
+
{ optionKey: "updatedBefore", summaryKey: "updated_before" },
|
|
244
|
+
{ optionKey: "createdAfter", summaryKey: "created_after" },
|
|
245
|
+
{ optionKey: "createdBefore", summaryKey: "created_before" },
|
|
246
|
+
{ optionKey: "ids", summaryKey: "ids" },
|
|
247
|
+
{ optionKey: "assignee", summaryKey: "assignee" },
|
|
248
|
+
{ optionKey: "assigneeFilter", summaryKey: "assignee_filter" },
|
|
249
|
+
{ optionKey: "parent", summaryKey: "parent" },
|
|
250
|
+
{ optionKey: "sprint", summaryKey: "sprint" },
|
|
251
|
+
{ optionKey: "release", summaryKey: "release" },
|
|
252
|
+
];
|
|
253
|
+
const VERBOSE_LIST_VALUE_FILTER_ECHO_ENTRIES = [
|
|
254
|
+
{ optionKey: "type", summaryKey: "type" },
|
|
255
|
+
{ optionKey: "tag", summaryKey: "tag" },
|
|
256
|
+
{ optionKey: "priority", summaryKey: "priority" },
|
|
257
|
+
{ optionKey: "deadlineBefore", summaryKey: "deadline_before" },
|
|
258
|
+
{ optionKey: "deadlineAfter", summaryKey: "deadline_after" },
|
|
259
|
+
{ optionKey: "updatedAfter", summaryKey: "updated_after" },
|
|
260
|
+
{ optionKey: "updatedBefore", summaryKey: "updated_before" },
|
|
261
|
+
{ optionKey: "createdAfter", summaryKey: "created_after" },
|
|
262
|
+
{ optionKey: "createdBefore", summaryKey: "created_before" },
|
|
263
|
+
{ optionKey: "ids", summaryKey: "ids" },
|
|
264
|
+
{ optionKey: "assignee", summaryKey: "assignee" },
|
|
265
|
+
{ optionKey: "assigneeFilter", summaryKey: "assignee_filter" },
|
|
266
|
+
{ optionKey: "parent", summaryKey: "parent" },
|
|
267
|
+
{ optionKey: "sprint", summaryKey: "sprint" },
|
|
268
|
+
{ optionKey: "release", summaryKey: "release" },
|
|
269
|
+
{ optionKey: "limit", summaryKey: "limit" },
|
|
270
|
+
{ optionKey: "offset", summaryKey: "offset" },
|
|
271
|
+
{ optionKey: "includeBody", summaryKey: "include_body" },
|
|
272
|
+
{ optionKey: "compact", summaryKey: "compact" },
|
|
273
|
+
{ optionKey: "fields", summaryKey: "fields" },
|
|
274
|
+
];
|
|
275
|
+
const VERBOSE_LIST_BOOLEAN_FILTER_ECHO_ENTRIES = [
|
|
276
|
+
{ key: "filterAcMissing", summaryKey: "filter_ac_missing" },
|
|
277
|
+
{ key: "filterEstimatesMissing", summaryKey: "filter_estimates_missing" },
|
|
278
|
+
{ key: "filterResolutionMissing", summaryKey: "filter_resolution_missing" },
|
|
279
|
+
{ key: "filterMetadataMissing", summaryKey: "filter_metadata_missing" },
|
|
280
|
+
];
|
|
281
|
+
const LIST_RECENT_WINDOW = "-7d";
|
|
282
|
+
function buildCompactListFilterSummary(params) {
|
|
283
|
+
const { filtersStatus, options, treeEnabled, treeDepth, sortField, sortOrder, runtimeFieldFilters, } = params;
|
|
284
|
+
const filters = {};
|
|
285
|
+
if (filtersStatus !== null) {
|
|
286
|
+
filters.status = filtersStatus;
|
|
287
|
+
}
|
|
288
|
+
applyFilterValueEcho(filters, options, COMPACT_LIST_VALUE_FILTER_ECHO_ENTRIES);
|
|
289
|
+
applyListWindowFilterEcho(filters, options);
|
|
290
|
+
if (options.filterAcMissing === true) {
|
|
291
|
+
filters.filter_ac_missing = true;
|
|
292
|
+
}
|
|
293
|
+
if (options.filterEstimatesMissing === true) {
|
|
294
|
+
filters.filter_estimates_missing = true;
|
|
295
|
+
}
|
|
296
|
+
if (options.filterResolutionMissing === true) {
|
|
297
|
+
filters.filter_resolution_missing = true;
|
|
298
|
+
}
|
|
299
|
+
if (options.filterMetadataMissing === true) {
|
|
300
|
+
filters.filter_metadata_missing = true;
|
|
301
|
+
}
|
|
302
|
+
applyGovernanceMissingFilterEcho(filters, options);
|
|
303
|
+
applyContentFilterEcho(filters, options);
|
|
304
|
+
if (options.limit !== undefined) {
|
|
305
|
+
filters.limit = options.limit;
|
|
306
|
+
}
|
|
307
|
+
if (options.offset !== undefined) {
|
|
308
|
+
filters.offset = options.offset;
|
|
309
|
+
}
|
|
310
|
+
if (options.includeBody === true) {
|
|
311
|
+
filters.include_body = true;
|
|
312
|
+
}
|
|
313
|
+
if (options.fields !== undefined) {
|
|
314
|
+
filters.fields = options.fields;
|
|
315
|
+
}
|
|
316
|
+
if (treeEnabled) {
|
|
317
|
+
filters.tree = true;
|
|
318
|
+
if (treeDepth !== undefined) {
|
|
319
|
+
filters.tree_depth = treeDepth;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
if (sortField !== undefined) {
|
|
323
|
+
filters.sort = sortField;
|
|
324
|
+
filters.order = sortOrder;
|
|
325
|
+
}
|
|
326
|
+
if (isNonEmptyRecord(runtimeFieldFilters)) {
|
|
327
|
+
filters.runtime_filters = runtimeFieldFilters;
|
|
328
|
+
}
|
|
329
|
+
return filters;
|
|
330
|
+
}
|
|
331
|
+
function compareDefaultSort(left, right, statusRegistry) {
|
|
332
|
+
const leftTerminal = isTerminalStatus(left.status, statusRegistry);
|
|
333
|
+
const rightTerminal = isTerminalStatus(right.status, statusRegistry);
|
|
334
|
+
if (leftTerminal !== rightTerminal) {
|
|
335
|
+
return leftTerminal ? 1 : -1;
|
|
336
|
+
}
|
|
337
|
+
const byPriority = left.priority - right.priority;
|
|
338
|
+
if (byPriority !== 0) {
|
|
339
|
+
return byPriority;
|
|
340
|
+
}
|
|
341
|
+
const byUpdated = compareTimestampStrings(right.updated_at, left.updated_at);
|
|
342
|
+
if (byUpdated !== 0) {
|
|
343
|
+
return byUpdated;
|
|
344
|
+
}
|
|
345
|
+
return (left.id ?? "").localeCompare(right.id ?? "");
|
|
346
|
+
}
|
|
347
|
+
function sortItemsDefault(items, statusRegistry) {
|
|
348
|
+
return [...items].sort((left, right) => compareDefaultSort(left, right, statusRegistry));
|
|
349
|
+
}
|
|
350
|
+
function parseDeadline(raw, fieldLabel) {
|
|
351
|
+
if (raw === undefined)
|
|
352
|
+
return undefined;
|
|
353
|
+
return resolveIsoOrRelative(raw, new Date(), fieldLabel);
|
|
354
|
+
}
|
|
355
|
+
// updated/created date-window filters share the deadline ISO+relative resolver
|
|
356
|
+
// so agents doing incremental "what changed since my last context window" syncs
|
|
357
|
+
// can pass either an ISO timestamp (the common case — feed back the previous
|
|
358
|
+
// run's `now`) or a SIGNED relative offset where "-2h"/"-7d" reach into the
|
|
359
|
+
// past and "+1d" into the future (units h/d/w/m, m = months — there is no
|
|
360
|
+
// minutes unit, matching the deadline resolver).
|
|
361
|
+
function parseTimestampWindow(raw, fieldLabel) {
|
|
362
|
+
if (raw == null)
|
|
363
|
+
return undefined;
|
|
364
|
+
const value = String(raw).trim();
|
|
365
|
+
if (value.length === 0)
|
|
366
|
+
return undefined;
|
|
367
|
+
return resolveIsoOrRelative(value, new Date(), fieldLabel);
|
|
368
|
+
}
|
|
369
|
+
function resolveListUpdatedAfter(options) {
|
|
370
|
+
const hasUpdatedAfter = options.updatedAfter != null &&
|
|
371
|
+
String(options.updatedAfter).trim().length > 0;
|
|
372
|
+
const selectedWindows = [
|
|
373
|
+
options.today === true,
|
|
374
|
+
options.recent === true,
|
|
375
|
+
hasUpdatedAfter,
|
|
376
|
+
].filter((selected) => selected).length;
|
|
377
|
+
if (selectedWindows > 1) {
|
|
378
|
+
throw new PmCliError("Choose only one updated_at window: --today, --recent, or --updated-after.", EXIT_CODE.USAGE);
|
|
379
|
+
}
|
|
380
|
+
if (options.today === true) {
|
|
381
|
+
const today = new Date();
|
|
382
|
+
today.setHours(0, 0, 0, 0);
|
|
383
|
+
return today.toISOString();
|
|
384
|
+
}
|
|
385
|
+
if (options.recent === true) {
|
|
386
|
+
return parseTimestampWindow(LIST_RECENT_WINDOW, "recent");
|
|
387
|
+
}
|
|
388
|
+
return parseTimestampWindow(options.updatedAfter, "updated-after");
|
|
389
|
+
}
|
|
390
|
+
function applyListWindowFilterEcho(filters, options) {
|
|
391
|
+
if (options.today === true) {
|
|
392
|
+
filters.today = true;
|
|
393
|
+
}
|
|
394
|
+
if (options.recent === true) {
|
|
395
|
+
filters.recent = true;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
function parseIdsFilter(raw) {
|
|
399
|
+
if (raw == null)
|
|
400
|
+
return undefined;
|
|
401
|
+
const value = String(raw).trim();
|
|
402
|
+
if (value.length === 0) {
|
|
403
|
+
throw new PmCliError("--ids requires at least one non-empty item ID", EXIT_CODE.USAGE);
|
|
404
|
+
}
|
|
405
|
+
const ids = value
|
|
406
|
+
.split(",")
|
|
407
|
+
.map((entry) => entry.trim())
|
|
408
|
+
.filter((entry) => entry.length > 0);
|
|
409
|
+
if (ids.length === 0) {
|
|
410
|
+
throw new PmCliError("--ids requires at least one non-empty item ID", EXIT_CODE.USAGE);
|
|
411
|
+
}
|
|
412
|
+
return new Set(ids);
|
|
413
|
+
}
|
|
414
|
+
function parseOffset(raw) {
|
|
415
|
+
if (raw === undefined)
|
|
416
|
+
return undefined;
|
|
417
|
+
const normalized = String(raw).trim();
|
|
418
|
+
const parsed = normalized.length === 0 ? Number.NaN : Number(normalized);
|
|
419
|
+
if (!Number.isInteger(parsed) || parsed < 0) {
|
|
420
|
+
throw new PmCliError("Offset filter must be a non-negative integer", EXIT_CODE.USAGE);
|
|
421
|
+
}
|
|
422
|
+
return parsed;
|
|
423
|
+
}
|
|
424
|
+
function parseFieldSelectors(raw) {
|
|
425
|
+
if (raw === undefined) {
|
|
426
|
+
return undefined;
|
|
427
|
+
}
|
|
428
|
+
const selectors = raw
|
|
429
|
+
.split(",")
|
|
430
|
+
.map((entry) => entry.trim())
|
|
431
|
+
.filter((entry) => entry.length > 0);
|
|
432
|
+
if (selectors.length === 0) {
|
|
433
|
+
throw new PmCliError("List --fields requires a comma-separated list of field names", EXIT_CODE.USAGE);
|
|
434
|
+
}
|
|
435
|
+
return [...new Set(selectors)];
|
|
436
|
+
}
|
|
437
|
+
function parseProjectionConfig(options) {
|
|
438
|
+
const compactRequested = options.compact === true;
|
|
439
|
+
const briefRequested = options.brief === true;
|
|
440
|
+
const fullRequested = options.full === true;
|
|
441
|
+
const fieldSelectors = parseFieldSelectors(options.fields);
|
|
442
|
+
const enabledModes = Number(compactRequested) +
|
|
443
|
+
Number(briefRequested) +
|
|
444
|
+
Number(fullRequested) +
|
|
445
|
+
Number(fieldSelectors !== undefined);
|
|
446
|
+
if (enabledModes > 1) {
|
|
447
|
+
throw new PmCliError("List projection options are mutually exclusive. Use one of --compact, --brief, --full, or --fields.", EXIT_CODE.USAGE);
|
|
448
|
+
}
|
|
449
|
+
if (fullRequested) {
|
|
450
|
+
return {
|
|
451
|
+
mode: "full",
|
|
452
|
+
fields: [],
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
if (briefRequested) {
|
|
456
|
+
return {
|
|
457
|
+
mode: "compact",
|
|
458
|
+
fields: [...BRIEF_LIST_FIELDS],
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
if (compactRequested) {
|
|
462
|
+
return {
|
|
463
|
+
mode: "compact",
|
|
464
|
+
fields: [...DEFAULT_COMPACT_LIST_FIELDS],
|
|
465
|
+
};
|
|
466
|
+
}
|
|
467
|
+
if (fieldSelectors) {
|
|
468
|
+
return {
|
|
469
|
+
mode: "fields",
|
|
470
|
+
fields: fieldSelectors,
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
return {
|
|
474
|
+
mode: "full",
|
|
475
|
+
fields: [],
|
|
476
|
+
};
|
|
477
|
+
}
|
|
478
|
+
function normalizeProjectionField(field) {
|
|
479
|
+
return field.startsWith("item.") ? field.slice("item.".length) : field;
|
|
480
|
+
}
|
|
481
|
+
function validateListProjectionFields(projection, runtimeMetadataKeys) {
|
|
482
|
+
if (projection.mode !== "fields") {
|
|
483
|
+
return;
|
|
484
|
+
}
|
|
485
|
+
const allowed = new Set([
|
|
486
|
+
...ITEM_METADATA_KEY_ORDER,
|
|
487
|
+
"body",
|
|
488
|
+
...TREE_METADATA_FIELDS,
|
|
489
|
+
...runtimeMetadataKeys,
|
|
490
|
+
]);
|
|
491
|
+
const unknown = projection.fields.filter((field) => !allowed.has(normalizeProjectionField(field)));
|
|
492
|
+
if (unknown.length > 0) {
|
|
493
|
+
throw new PmCliError(`Unknown list --fields value(s): ${unknown.join(", ")}`, EXIT_CODE.USAGE, {
|
|
494
|
+
code: "unknown_field_projection",
|
|
495
|
+
examples: [
|
|
496
|
+
"pm list-open --fields id,title,status,type,updated_at",
|
|
497
|
+
"pm list --fields id,title,parent,priority --limit 10",
|
|
498
|
+
"pm list-all --fields id,title,body --limit 5",
|
|
499
|
+
],
|
|
500
|
+
});
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
// Convenience aliases so agents/humans who reach for the bare verb form
|
|
504
|
+
// (e.g. `--sort updated`) land on the canonical timestamp fields instead of an error.
|
|
505
|
+
// A Map (not a plain object) avoids prototype-chain lookups for keys like "__proto__".
|
|
506
|
+
const LIST_SORT_FIELD_ALIASES = new Map([
|
|
507
|
+
["updated", "updated_at"],
|
|
508
|
+
["update", "updated_at"],
|
|
509
|
+
["modified", "updated_at"],
|
|
510
|
+
["created", "created_at"],
|
|
511
|
+
["create", "created_at"],
|
|
512
|
+
]);
|
|
513
|
+
function parseSortField(raw) {
|
|
514
|
+
if (raw === undefined) {
|
|
515
|
+
return undefined;
|
|
516
|
+
}
|
|
517
|
+
const normalized = raw.trim().toLowerCase();
|
|
518
|
+
const aliased = LIST_SORT_FIELD_ALIASES.get(normalized);
|
|
519
|
+
if (aliased) {
|
|
520
|
+
return aliased;
|
|
521
|
+
}
|
|
522
|
+
if (!LIST_SORT_FIELDS.includes(normalized)) {
|
|
523
|
+
throw new PmCliError(`Sort field must be one of ${LIST_SORT_FIELDS.join("|")} (aliases: updated->updated_at, created->created_at)`, EXIT_CODE.USAGE);
|
|
524
|
+
}
|
|
525
|
+
return normalized;
|
|
526
|
+
}
|
|
527
|
+
function parseSortOrder(raw) {
|
|
528
|
+
if (raw === undefined) {
|
|
529
|
+
return undefined;
|
|
530
|
+
}
|
|
531
|
+
const normalized = raw.trim().toLowerCase();
|
|
532
|
+
if (!LIST_SORT_ORDER_VALUES.includes(normalized)) {
|
|
533
|
+
throw new PmCliError(`Sort order must be one of ${LIST_SORT_ORDER_VALUES.join("|")}`, EXIT_CODE.USAGE);
|
|
534
|
+
}
|
|
535
|
+
return normalized;
|
|
536
|
+
}
|
|
537
|
+
function parseTreeDepth(raw) {
|
|
538
|
+
return parseIntegerLimit(raw, "--tree-depth");
|
|
539
|
+
}
|
|
540
|
+
function parseAssigneeFilter(raw) {
|
|
541
|
+
if (raw === undefined) {
|
|
542
|
+
return undefined;
|
|
543
|
+
}
|
|
544
|
+
const normalized = raw.trim().toLowerCase();
|
|
545
|
+
if (!normalized) {
|
|
546
|
+
throw new PmCliError("Assignee filter must be one of assigned|unassigned", EXIT_CODE.USAGE);
|
|
547
|
+
}
|
|
548
|
+
if (normalized !== "assigned" && normalized !== "unassigned") {
|
|
549
|
+
throw new PmCliError(`Invalid assignee filter "${raw}". Allowed: assigned|unassigned`, EXIT_CODE.USAGE);
|
|
550
|
+
}
|
|
551
|
+
return normalized;
|
|
552
|
+
}
|
|
553
|
+
// Resolve built-in, runtime, and workflow-group aliases through the shared
|
|
554
|
+
// registry, rejecting typos instead of returning a misleading empty result.
|
|
555
|
+
function resolveStatusFilter(status, statusRegistry) {
|
|
556
|
+
return parseStatusFilterCsv(status, statusRegistry, { strict: true });
|
|
557
|
+
}
|
|
558
|
+
function assertListAssigneeFilters(assigneeFilter, assigneeModeFilter) {
|
|
559
|
+
if (assigneeFilter &&
|
|
560
|
+
(assigneeFilter.toLowerCase() === "none" ||
|
|
561
|
+
assigneeFilter.toLowerCase() === "null")) {
|
|
562
|
+
throw new PmCliError('--assignee no longer accepts "none" or "null". Use --assignee-filter unassigned.', EXIT_CODE.USAGE);
|
|
563
|
+
}
|
|
564
|
+
if (assigneeFilter !== undefined && assigneeModeFilter === "unassigned") {
|
|
565
|
+
throw new PmCliError("Cannot combine --assignee with --assignee-filter unassigned", EXIT_CODE.USAGE);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
function resolveListFilterSet(status, options, typeRegistry, statusRegistry) {
|
|
569
|
+
const assigneeFilter = options.assignee?.trim();
|
|
570
|
+
const assigneeModeFilter = parseAssigneeFilter(options.assigneeFilter);
|
|
571
|
+
assertListAssigneeFilters(assigneeFilter, assigneeModeFilter);
|
|
572
|
+
const missingMetadataFilters = resolveMissingMetadataFilters(options);
|
|
573
|
+
const contentFieldFilters = resolveContentFieldFilters(options);
|
|
574
|
+
return {
|
|
575
|
+
idsFilter: parseIdsFilter(options.ids),
|
|
576
|
+
statusSet: status && status.length > 0 ? new Set(status) : undefined,
|
|
577
|
+
excludeTerminal: options.excludeTerminal === true,
|
|
578
|
+
typeFilter: parseType(options.type, typeRegistry),
|
|
579
|
+
tagFilter: options.tag?.trim().toLowerCase(),
|
|
580
|
+
priorityFilter: parsePriority(options.priority),
|
|
581
|
+
deadlineBefore: parseDeadline(options.deadlineBefore, "deadline-before"),
|
|
582
|
+
deadlineAfter: parseDeadline(options.deadlineAfter, "deadline-after"),
|
|
583
|
+
updatedAfter: resolveListUpdatedAfter(options),
|
|
584
|
+
updatedBefore: parseTimestampWindow(options.updatedBefore, "updated-before"),
|
|
585
|
+
createdAfter: parseTimestampWindow(options.createdAfter, "created-after"),
|
|
586
|
+
createdBefore: parseTimestampWindow(options.createdBefore, "created-before"),
|
|
587
|
+
assigneeFilter,
|
|
588
|
+
assigneeModeFilter,
|
|
589
|
+
parentFilter: options.parent?.trim(),
|
|
590
|
+
treeEnabled: options.tree === true,
|
|
591
|
+
sprintFilter: options.sprint?.trim(),
|
|
592
|
+
releaseFilter: options.release?.trim(),
|
|
593
|
+
missingMetadataFilters,
|
|
594
|
+
missingMetadataActive: hasMissingMetadataFilter(missingMetadataFilters),
|
|
595
|
+
lifecycleClassifier: lifecycleClassifierFromStatusRegistry(statusRegistry),
|
|
596
|
+
contentFieldFilters,
|
|
597
|
+
contentFiltersActive: hasContentFieldFilter(contentFieldFilters),
|
|
598
|
+
};
|
|
599
|
+
}
|
|
600
|
+
function matchesListScalarFilters(item, filters, statusRegistry) {
|
|
601
|
+
return (matchesListIdentityFilters(item, filters, statusRegistry) &&
|
|
602
|
+
matchesListDateFilters(item, filters) &&
|
|
603
|
+
matchesListAssigneeFilterSet(item, filters) &&
|
|
604
|
+
matchesListScopeFilters(item, filters));
|
|
605
|
+
}
|
|
606
|
+
function matchesListIdentityFilters(item, filters, statusRegistry) {
|
|
607
|
+
if (filters.idsFilter && !filters.idsFilter.has(item.id))
|
|
608
|
+
return false;
|
|
609
|
+
if (filters.statusSet && !filters.statusSet.has(item.status))
|
|
610
|
+
return false;
|
|
611
|
+
if (filters.excludeTerminal && isTerminalStatus(item.status, statusRegistry))
|
|
612
|
+
return false;
|
|
613
|
+
if (filters.typeFilter && item.type !== filters.typeFilter)
|
|
614
|
+
return false;
|
|
615
|
+
if (filters.tagFilter && !(item.tags ?? []).includes(filters.tagFilter))
|
|
616
|
+
return false;
|
|
617
|
+
return (filters.priorityFilter === undefined ||
|
|
618
|
+
item.priority === filters.priorityFilter);
|
|
619
|
+
}
|
|
620
|
+
function matchesListDateFilters(item, filters) {
|
|
621
|
+
return matchesTimestampFilters(item, filters);
|
|
622
|
+
}
|
|
623
|
+
function matchesListAssigneeFilterSet(item, filters) {
|
|
624
|
+
if (filters.assigneeModeFilter === "assigned" && !item.assignee)
|
|
625
|
+
return false;
|
|
626
|
+
if (filters.assigneeModeFilter === "unassigned" && item.assignee)
|
|
627
|
+
return false;
|
|
628
|
+
return (filters.assigneeFilter === undefined ||
|
|
629
|
+
item.assignee === filters.assigneeFilter);
|
|
630
|
+
}
|
|
631
|
+
function matchesListScopeFilters(item, filters) {
|
|
632
|
+
if (filters.parentFilter !== undefined &&
|
|
633
|
+
!filters.treeEnabled &&
|
|
634
|
+
item.parent !== filters.parentFilter)
|
|
635
|
+
return false;
|
|
636
|
+
if (filters.sprintFilter !== undefined &&
|
|
637
|
+
item.sprint !== filters.sprintFilter)
|
|
638
|
+
return false;
|
|
639
|
+
return (filters.releaseFilter === undefined ||
|
|
640
|
+
item.release === filters.releaseFilter);
|
|
641
|
+
}
|
|
642
|
+
function matchesListFilterSet(item, filters, statusRegistry, runtimeFieldFilters) {
|
|
643
|
+
if (!matchesListScalarFilters(item, filters, statusRegistry)) {
|
|
644
|
+
return false;
|
|
645
|
+
}
|
|
646
|
+
if (filters.missingMetadataActive &&
|
|
647
|
+
!itemMatchesMissingMetadata(item, filters.missingMetadataFilters, filters.lifecycleClassifier)) {
|
|
648
|
+
return false;
|
|
649
|
+
}
|
|
650
|
+
if (filters.contentFiltersActive &&
|
|
651
|
+
!itemMatchesContentFilters(item, filters.contentFieldFilters)) {
|
|
652
|
+
return false;
|
|
653
|
+
}
|
|
654
|
+
if (!matchesRuntimeFilters(item, runtimeFieldFilters)) {
|
|
655
|
+
return false;
|
|
656
|
+
}
|
|
657
|
+
return true;
|
|
658
|
+
}
|
|
659
|
+
function applyFilters(items, status, options, typeRegistry, statusRegistry, runtimeFieldFilters) {
|
|
660
|
+
const filters = resolveListFilterSet(status, options, typeRegistry, statusRegistry);
|
|
661
|
+
return items.filter((item) => matchesListFilterSet(item, filters, statusRegistry, runtimeFieldFilters));
|
|
662
|
+
}
|
|
663
|
+
function trimNonEmpty(value) {
|
|
664
|
+
if (typeof value !== "string") {
|
|
665
|
+
return undefined;
|
|
666
|
+
}
|
|
667
|
+
const trimmed = value.trim();
|
|
668
|
+
return trimmed.length > 0 ? trimmed : undefined;
|
|
669
|
+
}
|
|
670
|
+
function withTreeMetadata(item, depth, childCount) {
|
|
671
|
+
const itemRecord = toItemRecord(item);
|
|
672
|
+
const title = typeof itemRecord.title === "string" ? itemRecord.title : "";
|
|
673
|
+
const parent = trimNonEmpty(typeof itemRecord.parent === "string" ? itemRecord.parent : undefined) ?? null;
|
|
674
|
+
return {
|
|
675
|
+
...item,
|
|
676
|
+
tree_depth: depth,
|
|
677
|
+
tree_parent: parent,
|
|
678
|
+
tree_children: childCount,
|
|
679
|
+
tree_title: `${" ".repeat(depth)}${title}`,
|
|
680
|
+
};
|
|
681
|
+
}
|
|
682
|
+
function orderItemsAsTree(sortedItems, parentRoot, maxDepth) {
|
|
683
|
+
const byId = new Map();
|
|
684
|
+
const childrenByParent = new Map();
|
|
685
|
+
for (const item of sortedItems) {
|
|
686
|
+
byId.set(item.id, item);
|
|
687
|
+
const parentId = trimNonEmpty(item.parent);
|
|
688
|
+
if (!parentId) {
|
|
689
|
+
continue;
|
|
690
|
+
}
|
|
691
|
+
const bucket = childrenByParent.get(parentId);
|
|
692
|
+
if (bucket) {
|
|
693
|
+
bucket.push(item);
|
|
694
|
+
}
|
|
695
|
+
else {
|
|
696
|
+
childrenByParent.set(parentId, [item]);
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
const roots = parentRoot
|
|
700
|
+
? [...(childrenByParent.get(parentRoot) ?? [])]
|
|
701
|
+
: sortedItems.filter((item) => {
|
|
702
|
+
const parentId = trimNonEmpty(item.parent);
|
|
703
|
+
return !parentId || !byId.has(parentId);
|
|
704
|
+
});
|
|
705
|
+
const ordered = [];
|
|
706
|
+
const visited = new Set();
|
|
707
|
+
const pushNode = (node, depth) => {
|
|
708
|
+
if (visited.has(node.id)) {
|
|
709
|
+
return;
|
|
710
|
+
}
|
|
711
|
+
visited.add(node.id);
|
|
712
|
+
const children = childrenByParent.get(node.id) ?? [];
|
|
713
|
+
ordered.push(withTreeMetadata(node, depth, children.length));
|
|
714
|
+
if (maxDepth !== undefined && depth >= maxDepth) {
|
|
715
|
+
return;
|
|
716
|
+
}
|
|
717
|
+
for (const child of children) {
|
|
718
|
+
pushNode(child, depth + 1);
|
|
719
|
+
}
|
|
720
|
+
};
|
|
721
|
+
for (const root of roots) {
|
|
722
|
+
pushNode(root, 0);
|
|
723
|
+
}
|
|
724
|
+
return ordered;
|
|
725
|
+
}
|
|
726
|
+
function compareNullableString(left, right) {
|
|
727
|
+
if (left === right) {
|
|
728
|
+
return 0;
|
|
729
|
+
}
|
|
730
|
+
if (left === null) {
|
|
731
|
+
return 1;
|
|
732
|
+
}
|
|
733
|
+
if (right === null) {
|
|
734
|
+
return -1;
|
|
735
|
+
}
|
|
736
|
+
return left.localeCompare(right);
|
|
737
|
+
}
|
|
738
|
+
function compareNullableTimestamp(left, right) {
|
|
739
|
+
if (left === right) {
|
|
740
|
+
return 0;
|
|
741
|
+
}
|
|
742
|
+
if (left === null) {
|
|
743
|
+
return 1;
|
|
744
|
+
}
|
|
745
|
+
if (right === null) {
|
|
746
|
+
return -1;
|
|
747
|
+
}
|
|
748
|
+
return compareTimestampStrings(left, right);
|
|
749
|
+
}
|
|
750
|
+
function compareBySortField(left, right, field) {
|
|
751
|
+
switch (field) {
|
|
752
|
+
case "priority":
|
|
753
|
+
return left.priority - right.priority;
|
|
754
|
+
case "deadline":
|
|
755
|
+
return compareNullableTimestamp(left.deadline ?? null, right.deadline ?? null);
|
|
756
|
+
case "updated_at":
|
|
757
|
+
return compareTimestampStrings(left.updated_at, right.updated_at);
|
|
758
|
+
case "created_at":
|
|
759
|
+
return compareTimestampStrings(left.created_at, right.created_at);
|
|
760
|
+
case "title":
|
|
761
|
+
return (left.title ?? "").localeCompare(right.title ?? "");
|
|
762
|
+
case "parent":
|
|
763
|
+
return compareNullableString(left.parent ?? null, right.parent ?? null);
|
|
764
|
+
default:
|
|
765
|
+
return 0;
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
function sortItems(items, sortField, sortOrder, statusRegistry) {
|
|
769
|
+
if (!sortField) {
|
|
770
|
+
return sortItemsDefault(items, statusRegistry);
|
|
771
|
+
}
|
|
772
|
+
return [...items].sort((left, right) => {
|
|
773
|
+
const byField = compareBySortField(left, right, sortField);
|
|
774
|
+
if (byField !== 0) {
|
|
775
|
+
return sortOrder === "desc" ? -byField : byField;
|
|
776
|
+
}
|
|
777
|
+
const fallback = compareDefaultSort(left, right, statusRegistry);
|
|
778
|
+
return sortOrder === "desc" ? -fallback : fallback;
|
|
779
|
+
});
|
|
780
|
+
}
|
|
781
|
+
function readListFieldValue(item, field, treeMode = false) {
|
|
782
|
+
const normalized = normalizeProjectionField(field.trim());
|
|
783
|
+
if (normalized.length === 0) {
|
|
784
|
+
return null;
|
|
785
|
+
}
|
|
786
|
+
const itemRecord = toItemRecord(item);
|
|
787
|
+
if (treeMode &&
|
|
788
|
+
normalized === "title" &&
|
|
789
|
+
typeof itemRecord.tree_title === "string") {
|
|
790
|
+
return itemRecord.tree_title;
|
|
791
|
+
}
|
|
792
|
+
if (Object.prototype.hasOwnProperty.call(itemRecord, normalized)) {
|
|
793
|
+
return itemRecord[normalized] ?? null;
|
|
794
|
+
}
|
|
795
|
+
return null;
|
|
796
|
+
}
|
|
797
|
+
function projectListItems(items, projection, treeMode = false) {
|
|
798
|
+
if (projection.mode === "full") {
|
|
799
|
+
return items;
|
|
800
|
+
}
|
|
801
|
+
return items.map((item) => {
|
|
802
|
+
const projected = {};
|
|
803
|
+
for (const field of projection.fields) {
|
|
804
|
+
projected[field] = readListFieldValue(item, field, treeMode);
|
|
805
|
+
}
|
|
806
|
+
return projected;
|
|
807
|
+
});
|
|
808
|
+
}
|
|
809
|
+
function runtimeMetadataKeysForProjection(definitions) {
|
|
810
|
+
const keys = [];
|
|
811
|
+
for (const field of definitions) {
|
|
812
|
+
keys.push(field.metadata_key);
|
|
813
|
+
}
|
|
814
|
+
return keys;
|
|
815
|
+
}
|
|
816
|
+
function resolveListPageLimit(options, totalRows) {
|
|
817
|
+
if (options.noTruncate === true) {
|
|
818
|
+
return undefined;
|
|
819
|
+
}
|
|
820
|
+
return (parseIntegerLimit(options.limit) ?? (totalRows >= 10_000 ? 20 : undefined));
|
|
821
|
+
}
|
|
822
|
+
function resolveListPageStart(ordered, options, cursorFingerprint) {
|
|
823
|
+
if (options.after === undefined) {
|
|
824
|
+
return parseOffset(options.offset) ?? 0;
|
|
825
|
+
}
|
|
826
|
+
return resolveQueryCursorStart(ordered, options.after, cursorFingerprint, (item) => item.id);
|
|
827
|
+
}
|
|
828
|
+
function buildListPageExtras(limit, hasMore, nextCursor) {
|
|
829
|
+
return {
|
|
830
|
+
...(limit !== undefined ? { applied_limit: limit } : {}),
|
|
831
|
+
...(hasMore ? { has_more: true, truncated: true } : {}),
|
|
832
|
+
...(nextCursor ? { next_cursor: nextCursor } : {}),
|
|
833
|
+
};
|
|
834
|
+
}
|
|
835
|
+
async function resolveListRuntimeContext(options, global) {
|
|
836
|
+
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
837
|
+
if (!(await pathExists(getSettingsPath(pmRoot)))) {
|
|
838
|
+
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
839
|
+
}
|
|
840
|
+
const settings = await readSettings(pmRoot);
|
|
841
|
+
const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);
|
|
842
|
+
const runtimeFieldRegistry = resolveRuntimeFieldRegistry(settings.schema);
|
|
843
|
+
const projection = parseProjectionConfig(options);
|
|
844
|
+
validateListProjectionFields(projection, runtimeMetadataKeysForProjection(runtimeFieldRegistry.definitions));
|
|
845
|
+
return {
|
|
846
|
+
pmRoot,
|
|
847
|
+
settings,
|
|
848
|
+
statusRegistry,
|
|
849
|
+
runtimeFieldFilters: collectRuntimeFilterValues(options, runtimeFieldRegistry, "list"),
|
|
850
|
+
typeRegistry: resolveItemTypeRegistry(settings, getActiveExtensionRegistrations()),
|
|
851
|
+
projection,
|
|
852
|
+
};
|
|
853
|
+
}
|
|
854
|
+
async function loadListItems(options, runtime, listWarnings) {
|
|
855
|
+
const projectionNeedsBody = runtime.projection.fields.some((field) => normalizeProjectionField(field) === "body");
|
|
856
|
+
const projectionNeedsCollections = runtime.projection.mode === "full" ||
|
|
857
|
+
runtime.projection.fields.some((field) => HEAVY_PROJECTION_FIELDS.has(normalizeProjectionField(field)));
|
|
858
|
+
const contentFieldFilters = resolveContentFieldFilters(options);
|
|
859
|
+
const contentNeedsCollections = contentFiltersNeedCollections(contentFieldFilters);
|
|
860
|
+
const contentNeedsBody = contentFiltersNeedBody(contentFieldFilters);
|
|
861
|
+
if (options.includeBody || projectionNeedsBody || contentNeedsBody) {
|
|
862
|
+
return await listAllItemMetadataWithBody(runtime.pmRoot, runtime.settings.item_format, runtime.typeRegistry.type_to_folder, listWarnings, runtime.settings.schema);
|
|
863
|
+
}
|
|
864
|
+
if (projectionNeedsCollections || contentNeedsCollections) {
|
|
865
|
+
return await listAllItemMetadata(runtime.pmRoot, runtime.settings.item_format, runtime.typeRegistry.type_to_folder, listWarnings, runtime.settings.schema);
|
|
866
|
+
}
|
|
867
|
+
return await listAllItemMetadataLight(runtime.pmRoot, runtime.settings.item_format, runtime.typeRegistry.type_to_folder, listWarnings, runtime.settings.schema);
|
|
868
|
+
}
|
|
869
|
+
function resolveListOrderingOptions(options) {
|
|
870
|
+
const sortField = parseSortField(options.sort);
|
|
871
|
+
const sortOrder = parseSortOrder(options.order) ?? "asc";
|
|
872
|
+
const treeEnabled = options.tree === true;
|
|
873
|
+
if (!treeEnabled && options.treeDepth !== undefined) {
|
|
874
|
+
throw new PmCliError("List --tree-depth requires --tree", EXIT_CODE.USAGE);
|
|
875
|
+
}
|
|
876
|
+
if (!sortField && options.order !== undefined) {
|
|
877
|
+
throw new PmCliError("List --order requires --sort", EXIT_CODE.USAGE);
|
|
878
|
+
}
|
|
879
|
+
return {
|
|
880
|
+
sortField,
|
|
881
|
+
sortOrder,
|
|
882
|
+
treeEnabled,
|
|
883
|
+
treeDepth: treeEnabled ? parseTreeDepth(options.treeDepth) : undefined,
|
|
884
|
+
parentRoot: treeEnabled ? trimNonEmpty(options.parent) : undefined,
|
|
885
|
+
};
|
|
886
|
+
}
|
|
887
|
+
function resolveListStatusSelection(status, options, statusRegistry) {
|
|
888
|
+
const explicitStatus = resolveStatusFilter(options.status, statusRegistry);
|
|
889
|
+
const resolvedStatus = explicitStatus ?? resolveStatusFilter(status, statusRegistry);
|
|
890
|
+
const explicitAllStatuses = isStatusAllFilterInput(options.status);
|
|
891
|
+
const effectiveOptions = explicitStatus || explicitAllStatuses
|
|
892
|
+
? { ...options, excludeTerminal: false }
|
|
893
|
+
: options;
|
|
894
|
+
const filtersStatus = explicitAllStatuses
|
|
895
|
+
? "all"
|
|
896
|
+
: resolvedStatus === undefined
|
|
897
|
+
? null
|
|
898
|
+
: resolvedStatus.length === 1
|
|
899
|
+
? resolvedStatus[0]
|
|
900
|
+
: resolvedStatus;
|
|
901
|
+
return {
|
|
902
|
+
resolvedStatus,
|
|
903
|
+
explicitAllStatuses,
|
|
904
|
+
effectiveOptions,
|
|
905
|
+
filtersStatus,
|
|
906
|
+
};
|
|
907
|
+
}
|
|
908
|
+
function pageAndProjectListItems(ordered, options, projection, treeEnabled, cursorFingerprint) {
|
|
909
|
+
if (options.after !== undefined && options.offset !== undefined) {
|
|
910
|
+
throw new PmCliError("List --after cannot be combined with --offset.", EXIT_CODE.USAGE);
|
|
911
|
+
}
|
|
912
|
+
const limit = resolveListPageLimit(options, ordered.length);
|
|
913
|
+
const offset = resolveListPageStart(ordered, options, cursorFingerprint);
|
|
914
|
+
const limited = limit === undefined
|
|
915
|
+
? ordered.slice(offset)
|
|
916
|
+
: ordered.slice(offset, offset + limit);
|
|
917
|
+
const projected = projectListItems(limited, projection, treeEnabled);
|
|
918
|
+
const totalMatched = ordered.length;
|
|
919
|
+
const hasMore = limited.length > 0 && offset + limited.length < totalMatched;
|
|
920
|
+
const nextCursor = hasMore && limited.length > 0
|
|
921
|
+
? encodeQueryCursor(cursorFingerprint, limited[limited.length - 1].id, offset + limited.length - 1)
|
|
922
|
+
: undefined;
|
|
923
|
+
return {
|
|
924
|
+
projected,
|
|
925
|
+
totalMatched,
|
|
926
|
+
truncationExtras: projected.length < totalMatched || offset > 0
|
|
927
|
+
? { total: totalMatched }
|
|
928
|
+
: {},
|
|
929
|
+
pageExtras: buildListPageExtras(limit, hasMore, nextCursor),
|
|
930
|
+
};
|
|
931
|
+
}
|
|
932
|
+
function buildListCursorFingerprint(status, options, ordering) {
|
|
933
|
+
const normalizedOptions = { ...options };
|
|
934
|
+
delete normalizedOptions.after;
|
|
935
|
+
delete normalizedOptions.limit;
|
|
936
|
+
delete normalizedOptions.offset;
|
|
937
|
+
delete normalizedOptions.noTruncate;
|
|
938
|
+
delete normalizedOptions.includeBody;
|
|
939
|
+
delete normalizedOptions.compact;
|
|
940
|
+
delete normalizedOptions.brief;
|
|
941
|
+
delete normalizedOptions.full;
|
|
942
|
+
delete normalizedOptions.fields;
|
|
943
|
+
return createQueryFingerprint("list", {
|
|
944
|
+
status,
|
|
945
|
+
options: normalizedOptions,
|
|
946
|
+
sort: ordering.sortField ?? "default",
|
|
947
|
+
order: ordering.sortOrder,
|
|
948
|
+
tree: ordering.treeEnabled,
|
|
949
|
+
tree_depth: ordering.treeDepth ?? null,
|
|
950
|
+
});
|
|
951
|
+
}
|
|
952
|
+
function buildVerboseListFilters(params) {
|
|
953
|
+
const { filtersStatus, options, noTruncate, treeEnabled, treeDepth, sortField, sortOrder, runtimeFieldFilters, } = params;
|
|
954
|
+
const filters = { status: filtersStatus };
|
|
955
|
+
const optionRecord = options;
|
|
956
|
+
for (const entry of VERBOSE_LIST_VALUE_FILTER_ECHO_ENTRIES) {
|
|
957
|
+
filters[entry.summaryKey] = optionRecord[entry.optionKey] ?? null;
|
|
958
|
+
}
|
|
959
|
+
for (const entry of VERBOSE_LIST_BOOLEAN_FILTER_ECHO_ENTRIES) {
|
|
960
|
+
if (optionRecord[entry.key] === true) {
|
|
961
|
+
filters[entry.summaryKey] = true;
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
Object.assign(filters, buildGovernanceMissingFilterEcho(options), buildContentFilterEcho(options));
|
|
965
|
+
applyListWindowFilterEcho(filters, options);
|
|
966
|
+
if (noTruncate) {
|
|
967
|
+
filters.no_truncate = true;
|
|
968
|
+
}
|
|
969
|
+
if (treeEnabled) {
|
|
970
|
+
filters.tree = true;
|
|
971
|
+
filters.tree_depth = treeDepth ?? null;
|
|
972
|
+
}
|
|
973
|
+
filters.sort = sortField ?? null;
|
|
974
|
+
filters.order = sortField ? sortOrder : null;
|
|
975
|
+
filters.runtime_filters = runtimeFieldFilters;
|
|
976
|
+
return filters;
|
|
977
|
+
}
|
|
978
|
+
/** Execute a list query with projection-aware public result typing. */
|
|
979
|
+
export async function runList(status, options, global) {
|
|
980
|
+
const runtime = await resolveListRuntimeContext(options, global);
|
|
981
|
+
const listWarnings = [];
|
|
982
|
+
const items = await loadListItems(options, runtime, listWarnings);
|
|
983
|
+
const ordering = resolveListOrderingOptions(options);
|
|
984
|
+
const statusSelection = resolveListStatusSelection(status, options, runtime.statusRegistry);
|
|
985
|
+
const filtered = applyFilters(items, statusSelection.resolvedStatus, statusSelection.effectiveOptions, runtime.typeRegistry, runtime.statusRegistry, runtime.runtimeFieldFilters);
|
|
986
|
+
const sorted = sortItems(filtered, ordering.sortField, ordering.sortOrder, runtime.statusRegistry);
|
|
987
|
+
const ordered = ordering.treeEnabled
|
|
988
|
+
? orderItemsAsTree(sorted, ordering.parentRoot, ordering.treeDepth)
|
|
989
|
+
: sorted;
|
|
990
|
+
const noTruncate = options.noTruncate === true;
|
|
991
|
+
const page = pageAndProjectListItems(ordered, options, runtime.projection, ordering.treeEnabled, buildListCursorFingerprint(statusSelection.filtersStatus, options, ordering));
|
|
992
|
+
const now = nowIso();
|
|
993
|
+
const warnings = [...new Set(listWarnings)].sort((left, right) => left.localeCompare(right));
|
|
994
|
+
const projectionFields = runtime.projection.mode === "full" ? null : [...runtime.projection.fields];
|
|
995
|
+
const compactSummaryMode = runtime.projection.mode === "compact" && options.compact === true;
|
|
996
|
+
if (compactSummaryMode) {
|
|
997
|
+
const compactFilters = buildCompactListFilterSummary({
|
|
998
|
+
filtersStatus: statusSelection.filtersStatus,
|
|
999
|
+
options,
|
|
1000
|
+
treeEnabled: ordering.treeEnabled,
|
|
1001
|
+
treeDepth: ordering.treeDepth,
|
|
1002
|
+
sortField: ordering.sortField,
|
|
1003
|
+
sortOrder: ordering.sortOrder,
|
|
1004
|
+
runtimeFieldFilters: runtime.runtimeFieldFilters,
|
|
1005
|
+
});
|
|
1006
|
+
return {
|
|
1007
|
+
items: page.projected,
|
|
1008
|
+
count: page.projected.length,
|
|
1009
|
+
...page.truncationExtras,
|
|
1010
|
+
...page.pageExtras,
|
|
1011
|
+
filters: compactFilters,
|
|
1012
|
+
...(warnings.length > 0 ? { warnings } : {}),
|
|
1013
|
+
};
|
|
1014
|
+
}
|
|
1015
|
+
return {
|
|
1016
|
+
items: page.projected,
|
|
1017
|
+
count: page.projected.length,
|
|
1018
|
+
...page.truncationExtras,
|
|
1019
|
+
...page.pageExtras,
|
|
1020
|
+
filters: buildVerboseListFilters({
|
|
1021
|
+
filtersStatus: statusSelection.filtersStatus,
|
|
1022
|
+
options,
|
|
1023
|
+
noTruncate,
|
|
1024
|
+
treeEnabled: ordering.treeEnabled,
|
|
1025
|
+
treeDepth: ordering.treeDepth,
|
|
1026
|
+
sortField: ordering.sortField,
|
|
1027
|
+
sortOrder: ordering.sortOrder,
|
|
1028
|
+
runtimeFieldFilters: runtime.runtimeFieldFilters,
|
|
1029
|
+
}),
|
|
1030
|
+
projection: {
|
|
1031
|
+
mode: runtime.projection.mode,
|
|
1032
|
+
fields: projectionFields,
|
|
1033
|
+
},
|
|
1034
|
+
sorting: {
|
|
1035
|
+
sort: ordering.sortField ?? "default",
|
|
1036
|
+
order: ordering.sortField ? ordering.sortOrder : "asc",
|
|
1037
|
+
},
|
|
1038
|
+
now,
|
|
1039
|
+
...(warnings.length > 0 ? { warnings } : {}),
|
|
1040
|
+
};
|
|
1041
|
+
}
|
|
1042
|
+
/** Public contract for test only, shared by SDK and presentation-layer consumers. */
|
|
1043
|
+
export const _testOnly = {
|
|
1044
|
+
applyFilters,
|
|
1045
|
+
buildCompactListFilterSummary,
|
|
1046
|
+
buildContentFilterEcho,
|
|
1047
|
+
buildGovernanceMissingFilterEcho,
|
|
1048
|
+
resolveContentFieldFilters,
|
|
1049
|
+
resolveMissingMetadataFilters,
|
|
1050
|
+
compareBySortField,
|
|
1051
|
+
compareDefaultSort,
|
|
1052
|
+
compareNullableString,
|
|
1053
|
+
compareNullableTimestamp,
|
|
1054
|
+
normalizeProjectionField,
|
|
1055
|
+
parseAssigneeFilter,
|
|
1056
|
+
parseFieldSelectors,
|
|
1057
|
+
parseIdsFilter,
|
|
1058
|
+
parseOffset,
|
|
1059
|
+
parseProjectionConfig,
|
|
1060
|
+
resolveListUpdatedAfter,
|
|
1061
|
+
resolveListPageLimit,
|
|
1062
|
+
parseSortField,
|
|
1063
|
+
parseSortOrder,
|
|
1064
|
+
orderItemsAsTree,
|
|
1065
|
+
projectListItems,
|
|
1066
|
+
readListFieldValue,
|
|
1067
|
+
runtimeMetadataKeysForProjection,
|
|
1068
|
+
sortItems,
|
|
1069
|
+
trimNonEmpty,
|
|
1070
|
+
withTreeMetadata,
|
|
1071
|
+
};
|
|
1072
|
+
//# sourceMappingURL=list.js.map
|
|
1073
|
+
//# debugId=255af95f-1741-5e74-a528-4fa8ae65ee4c
|