@unbrained/pm-cli 2026.7.11 → 2026.7.12
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 +36 -2
- package/README.md +0 -33
- package/dist/cli/commands/claim.d.ts +32 -1
- package/dist/cli/commands/claim.js +52 -15
- package/dist/cli/commands/claim.js.map +1 -1
- package/dist/cli/commands/completion.js +11 -2
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/create.js +4 -65
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/index.d.ts +1 -1
- package/dist/cli/commands/index.js +3 -3
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.js +18 -2
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/legacy-none-tokens.d.ts +49 -1
- package/dist/cli/commands/legacy-none-tokens.js +73 -2
- package/dist/cli/commands/legacy-none-tokens.js.map +1 -1
- package/dist/cli/commands/next.d.ts +14 -2
- package/dist/cli/commands/next.js +39 -11
- package/dist/cli/commands/next.js.map +1 -1
- package/dist/cli/commands/plan.d.ts +5 -0
- package/dist/cli/commands/plan.js +44 -2
- package/dist/cli/commands/plan.js.map +1 -1
- package/dist/cli/commands/update.js +7 -67
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/extension-command-help.d.ts +13 -1
- package/dist/cli/extension-command-help.js +79 -5
- package/dist/cli/extension-command-help.js.map +1 -1
- package/dist/cli/main.js +9 -6
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.js +3 -2
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.js +3 -2
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.js +24 -3
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli-bundle/chunks/append-RH3G5RAV.js +11 -0
- package/dist/cli-bundle/chunks/{append-464PHZ65.js → append-T5DTS4NU.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-YMP6AKGU.js → chunk-2XWRFOPR.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-HT5P3WC6.js → chunk-2Z36LSAT.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-WQ5227PH.js → chunk-33O5P6KT.js} +135 -41
- package/dist/cli-bundle/chunks/chunk-33O5P6KT.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-DBV6QRYT.js → chunk-3KJ3FG5O.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-AQLKMQQA.js → chunk-3M5BWYUA.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-GPBKJERW.js → chunk-3WASQS5G.js} +42 -6
- package/dist/cli-bundle/chunks/chunk-3WASQS5G.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-47CCRGRH.js → chunk-47TKJR3D.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-YCSDMIQW.js → chunk-4MO4PPR2.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-WCRAUCJO.js → chunk-546WPG33.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-RLOWK5EQ.js → chunk-5754C5XS.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-7U5INZ2C.js → chunk-5V746BN3.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-7324AI5M.js → chunk-66YL6RR5.js} +30 -20
- package/dist/cli-bundle/chunks/{chunk-7324AI5M.js.map → chunk-66YL6RR5.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ZLQDOBZL.js → chunk-6OK5QSGH.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-ROH64TST.js → chunk-6XNMSLBT.js} +78 -72
- package/dist/cli-bundle/chunks/chunk-6XNMSLBT.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2HNZKLHV.js → chunk-7SHFQB2A.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-6APTSPP5.js → chunk-7SIWW7C3.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-7HQQT6AT.js → chunk-7TYZTBEV.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-VTOQH22Y.js → chunk-A2HZUSEA.js} +8 -6
- package/dist/cli-bundle/chunks/{chunk-VTOQH22Y.js.map → chunk-A2HZUSEA.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-YCHJLOO2.js → chunk-A6AK7W5M.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WBKZAO3P.js → chunk-A6AVSYRJ.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-L7C6RTGH.js → chunk-ACDIA6NP.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-AX3BJLPV.js → chunk-ACRC3HI4.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-QCKPSFII.js → chunk-AHIEDSW2.js} +30 -20
- package/dist/cli-bundle/chunks/{chunk-QCKPSFII.js.map → chunk-AHIEDSW2.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-B6JBI7JX.js → chunk-ANLHBXAE.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-2KQG6L3J.js → chunk-AS62PEJE.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-OJ64VYGO.js → chunk-BAK2VLTQ.js} +62 -33
- package/dist/cli-bundle/chunks/chunk-BAK2VLTQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-J3EXRK2H.js → chunk-BLRO2POO.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-KDNZSVCK.js → chunk-CDR2A3VI.js} +15 -74
- package/dist/cli-bundle/chunks/chunk-CDR2A3VI.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2WGV5WRW.js → chunk-DJI5IS46.js} +42 -20
- package/dist/cli-bundle/chunks/{chunk-2WGV5WRW.js.map → chunk-DJI5IS46.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-VOXOXART.js → chunk-DLZ3RXAL.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-H6YDNW46.js → chunk-DNH44IKP.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-QI5KTH6A.js → chunk-EBBROE54.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-GC5ME4ZU.js → chunk-FF523THY.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-5OBMSBWX.js → chunk-FIZUJWXQ.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-HLBSL5KE.js → chunk-FVWQFTTW.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-YIWYD7TC.js → chunk-FVZEIWTL.js} +10 -10
- package/dist/cli-bundle/chunks/{chunk-E72ZO34Z.js → chunk-G6B5XGNV.js} +97 -32
- package/dist/cli-bundle/chunks/{chunk-E72ZO34Z.js.map → chunk-G6B5XGNV.js.map} +4 -4
- package/dist/cli-bundle/chunks/{chunk-4DC5XNMS.js → chunk-GFBV2254.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-OKZ35F3Y.js → chunk-GRB3TFOC.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-TZFULSN4.js → chunk-GVGFLZQS.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-RTG2LHQ7.js → chunk-HLZXQKGZ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-5F7UJHFY.js → chunk-HO6CDURZ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-MN2YMU55.js → chunk-HOE3UV3G.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-XQLLRYOX.js → chunk-HRCJGQXL.js} +134 -40
- package/dist/cli-bundle/chunks/chunk-HRCJGQXL.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-I535LTZ2.js → chunk-IS6M4ETF.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-K7HEURQ4.js → chunk-J2XEW4YL.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-GZNB5V5J.js → chunk-J2ZDZG4A.js} +44 -12
- package/dist/cli-bundle/chunks/chunk-J2ZDZG4A.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-O2Q7YQGO.js → chunk-J7XSQCJO.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-RA2LPP6E.js → chunk-JM4Z53DN.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JR6FIX53.js → chunk-JNNPTGXR.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-I5VZGPS2.js → chunk-K7CGOZK5.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-B6OANV3G.js → chunk-KDH62ECD.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-LIY2ILWI.js → chunk-KXFY6AI4.js} +41 -5
- package/dist/cli-bundle/chunks/chunk-KXFY6AI4.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-NR7PTIR7.js → chunk-L23NAJHL.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-FCZ6WYSR.js → chunk-LEXFDABF.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-GP54I36Z.js → chunk-LNAGQRIL.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-DD2WZD6L.js → chunk-LU4Z7POS.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-FEVEIX53.js → chunk-LX265XY7.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-NJABR6EB.js → chunk-MQAGSAMS.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-MRMS62WQ.js → chunk-N4NKVLPY.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-RY57ESL2.js → chunk-ND3MDD6L.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-Y476SA4V.js → chunk-NEJKKTCG.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-Q3EW4RE5.js → chunk-NGL3X3XM.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-ENJDRDDP.js → chunk-NK54BSL7.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-KHQYX2QB.js → chunk-NN57FRRN.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-VNCQ7SSG.js → chunk-NNRXTZ7Y.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-KZQHMDS6.js → chunk-NOIIRLCO.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-CTAPVM6C.js → chunk-O5ELBOEJ.js} +14 -73
- package/dist/cli-bundle/chunks/chunk-O5ELBOEJ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-K2PDZYUF.js → chunk-OC2CLNMS.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-SN7Q7M4U.js → chunk-OKUFGORG.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ZLWBLI5R.js → chunk-OOK6V7BF.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-DDEYJ3BH.js → chunk-OUQ4I6HC.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-C4FIA5U6.js → chunk-OYCZDDUC.js} +61 -32
- package/dist/cli-bundle/chunks/chunk-OYCZDDUC.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-X7ZXLB3C.js → chunk-PDOJRPYR.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-HDNEQAHV.js → chunk-PHQPQNAT.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-FMFSUTTD.js → chunk-PTJ7NVUU.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-5URFS7C4.js → chunk-PUMGO764.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-RPZ57GQ7.js → chunk-QFCCN4JO.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-RAC2UXLT.js → chunk-QPWXNK56.js} +43 -11
- package/dist/cli-bundle/chunks/chunk-QPWXNK56.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-35YNX7RQ.js → chunk-QYIDXRRX.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-ITIUEWD5.js → chunk-RFDT674H.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-2BUNV627.js → chunk-SJ2DADDH.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-MSPZSUKQ.js → chunk-SV7PEWKW.js} +41 -19
- package/dist/cli-bundle/chunks/{chunk-MSPZSUKQ.js.map → chunk-SV7PEWKW.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ZYDUOY54.js → chunk-TKD4NESJ.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-BU2CV5ZU.js → chunk-TMNQV4EK.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-GJNBKU6G.js → chunk-TWELUDDF.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-A3AIKEYC.js → chunk-TYCM65DJ.js} +78 -72
- package/dist/cli-bundle/chunks/chunk-TYCM65DJ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-Y5E6FCAL.js → chunk-U3S22BOJ.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-MORRAQXQ.js → chunk-UAZ6W3H3.js} +91 -33
- package/dist/cli-bundle/chunks/chunk-UAZ6W3H3.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2BKRMFGK.js → chunk-UFY4ETU6.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-EEUIIDWF.js → chunk-UGQENMKM.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-XK5CTXMB.js → chunk-UGSHP6SR.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-2JWIRG4V.js → chunk-VF24O6TV.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-PZBRTJ3Y.js → chunk-VLVTXEGG.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-X6HT3FP3.js → chunk-VMGK6ESD.js} +7 -5
- package/dist/cli-bundle/chunks/{chunk-X6HT3FP3.js.map → chunk-VMGK6ESD.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NAGOH4YJ.js → chunk-VXUWCJS7.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ETGRUM64.js → chunk-WBMARQCV.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-L6C62S4V.js → chunk-WZDABROA.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-P63GUQK5.js → chunk-XG5GVZRX.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-6UWHAJEX.js → chunk-XGCPTS6L.js} +10 -10
- package/dist/cli-bundle/chunks/{chunk-XGUXU4IQ.js → chunk-Y44B5FBE.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-C3QR2DPR.js → chunk-YP6DWEWQ.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-TB6364F7.js → chunk-Z7XTVIN5.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-XSJZF3TO.js → chunk-ZEKVLV6P.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-SNFLSFFH.js → chunk-ZFPOBSPC.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-RYASC6U3.js → chunk-ZUB725AA.js} +7 -7
- package/dist/cli-bundle/chunks/{close-A77IGXNC.js → close-CQHW3WMK.js} +5 -5
- package/dist/cli-bundle/chunks/close-ZZW5FLTB.js +12 -0
- package/dist/cli-bundle/chunks/{close-many-P2YOWN52.js → close-many-AR2YH3SJ.js} +12 -12
- package/dist/cli-bundle/chunks/close-many-IKCEGBLQ.js +21 -0
- package/dist/cli-bundle/chunks/comments-NV4SIY5Z.js +13 -0
- package/dist/cli-bundle/chunks/{comments-FNLKE3TW.js → comments-UV4HMI2K.js} +7 -7
- package/dist/cli-bundle/chunks/{copy-U6H22S7E.js → copy-OUFWOHVG.js} +4 -4
- package/dist/cli-bundle/chunks/copy-X7HJFWIH.js +9 -0
- package/dist/cli-bundle/chunks/{create-HS64DHTL.js → create-QEDL4KKT.js} +9 -9
- package/dist/cli-bundle/chunks/create-R6MMMMJS.js +25 -0
- package/dist/cli-bundle/chunks/{delete-4XPF5XLP.js → delete-MJGZFDHZ.js} +4 -4
- package/dist/cli-bundle/chunks/delete-OOJRG4HF.js +10 -0
- package/dist/cli-bundle/chunks/{deps-TMOF765V.js → deps-4OP6Q76N.js} +4 -4
- package/dist/cli-bundle/chunks/{deps-R44LVZTU.js → deps-Y5X6NFT5.js} +4 -4
- package/dist/cli-bundle/chunks/docs-SILTBWSO.js +14 -0
- package/dist/cli-bundle/chunks/{docs-HN6QKGEU.js → docs-UKTQVUHS.js} +6 -6
- package/dist/cli-bundle/chunks/{files-RNFWG435.js → files-2QEI2V3C.js} +6 -6
- package/dist/cli-bundle/chunks/{files-NX4LNOPL.js → files-7OIKZPI3.js} +6 -6
- package/dist/cli-bundle/chunks/focus-3YC5LFCG.js +10 -0
- package/dist/cli-bundle/chunks/{focus-OBSDVVI7.js → focus-FFWH32BF.js} +5 -5
- package/dist/cli-bundle/chunks/{history-compact-RZMMFSTO.js → history-compact-AAA4W6LY.js} +8 -8
- package/dist/cli-bundle/chunks/{history-compact-CKNRN637.js → history-compact-PIURAPW5.js} +8 -8
- package/dist/cli-bundle/chunks/history-redact-KWZ7LKQB.js +16 -0
- package/dist/cli-bundle/chunks/{history-redact-W7TTAEX2.js → history-redact-NTO74EIV.js} +6 -6
- package/dist/cli-bundle/chunks/history-repair-QWZJYYOJ.js +18 -0
- package/dist/cli-bundle/chunks/{history-repair-RGAQBOIS.js → history-repair-ROV5TD3L.js} +8 -8
- package/dist/cli-bundle/chunks/learnings-25TJCVON.js +13 -0
- package/dist/cli-bundle/chunks/{learnings-VDRTXWTF.js → learnings-3WJFJT7E.js} +7 -7
- package/dist/cli-bundle/chunks/{notes-UXXTI3J5.js → notes-FM53JJ5C.js} +7 -7
- package/dist/cli-bundle/chunks/notes-IAHGNCYQ.js +13 -0
- package/dist/cli-bundle/chunks/{plan-H3OPE2RP.js → plan-EJ4USP2S.js} +10 -10
- package/dist/cli-bundle/chunks/plan-WHV4H2RW.js +24 -0
- package/dist/cli-bundle/chunks/{profile-PFNN3CBJ.js → profile-SZQVKHUQ.js} +9 -9
- package/dist/cli-bundle/chunks/{profile-FCZWT5LE.js → profile-TXE673DR.js} +9 -9
- package/dist/cli-bundle/chunks/{register-list-query-BGEGWQ6S.js → register-list-query-LSR2G2SJ.js} +16 -16
- package/dist/cli-bundle/chunks/{register-list-query-BGEGWQ6S.js.map → register-list-query-LSR2G2SJ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-list-query-ODDZVR6N.js → register-list-query-S6I73L5W.js} +15 -15
- package/dist/cli-bundle/chunks/{register-list-query-ODDZVR6N.js.map → register-list-query-S6I73L5W.js.map} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-OAJXSNWK.js → register-mutation-77GYER52.js} +32 -32
- package/dist/cli-bundle/chunks/{register-mutation-OAJXSNWK.js.map → register-mutation-77GYER52.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-mutation-2APBEHTJ.js → register-mutation-A2SC3K5G.js} +31 -31
- package/dist/cli-bundle/chunks/{register-mutation-2APBEHTJ.js.map → register-mutation-A2SC3K5G.js.map} +2 -2
- package/dist/cli-bundle/chunks/{register-operations-3TYKCKEZ.js → register-operations-KSAIBSZH.js} +43 -33
- package/dist/cli-bundle/chunks/register-operations-KSAIBSZH.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-operations-WKZSX4QP.js → register-operations-W6Z5LVI5.js} +42 -32
- package/dist/cli-bundle/chunks/register-operations-W6Z5LVI5.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-setup-HSVJDV3R.js → register-setup-KB5U3RES.js} +15 -15
- package/dist/cli-bundle/chunks/{register-setup-KE5L3H7U.js → register-setup-ZG7YXPHJ.js} +15 -15
- package/dist/cli-bundle/chunks/{restore-MDNVYUDD.js → restore-F5HPTRBR.js} +6 -6
- package/dist/cli-bundle/chunks/restore-LN57EB5H.js +14 -0
- package/dist/cli-bundle/chunks/{schema-AJCAANMB.js → schema-3DKXA4KR.js} +6 -6
- package/dist/cli-bundle/chunks/{schema-2B37DMM2.js → schema-QLTOK23S.js} +6 -6
- package/dist/cli-bundle/chunks/update-2T5EWMXD.js +21 -0
- package/dist/cli-bundle/chunks/{update-ZCDGTSNL.js → update-IKMNH3W4.js} +12 -12
- package/dist/cli-bundle/chunks/{update-many-6E2DDBE4.js → update-many-3Q6Z2Q4Y.js} +19 -19
- package/dist/cli-bundle/chunks/update-many-OTAS4BWH.js +30 -0
- package/dist/cli-bundle/main.js +75 -20
- package/dist/cli-bundle/main.js.map +2 -2
- package/dist/cli-bundle/sdk-runtime.js +63 -52
- package/dist/cli-bundle/sdk-testing.js +6 -6
- package/dist/cli-bundle/sdk.js +63 -54
- package/dist/cli-bundle/sdk.js.map +2 -2
- package/dist/core/extensions/item-fields.js +3 -3
- package/dist/core/extensions/item-fields.js.map +1 -1
- package/dist/core/extensions/loader.js +29 -20
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/schema/fields-file.js +5 -3
- package/dist/core/schema/fields-file.js.map +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.js +12 -2
- package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +14 -2
- package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-schema.d.ts +1 -1
- package/dist/sdk/cli-contracts/tool-schema.js +18 -6
- package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
- package/dist/sdk/index.d.ts +3 -1
- package/dist/sdk/index.js +4 -3
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/runtime.d.ts +51 -1
- package/dist/sdk/runtime.js +91 -4
- package/dist/sdk/runtime.js.map +1 -1
- package/dist/sdk/workspace.d.ts +15 -0
- package/dist/sdk/workspace.js +50 -0
- package/dist/sdk/workspace.js.map +1 -0
- package/docs/AGENT_GUIDE.md +1 -0
- package/docs/CHATGPT_CODEX_PLUGIN_IMPLEMENTATION.md +775 -0
- package/docs/CODEX_PLUGIN.md +11 -1
- package/docs/COMMANDS.md +3 -1
- package/docs/README.md +3 -0
- package/docs/SDK.md +204 -71
- package/marketplace.json +2 -2
- package/package.json +3 -2
- package/packages/pm-beads/extensions/beads/runtime-loader.ts +3 -0
- 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/extensions/todos/runtime-loader.ts +3 -0
- 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-bundle/chunks/append-425YGJMY.js +0 -11
- package/dist/cli-bundle/chunks/chunk-A3AIKEYC.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-C4FIA5U6.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-CTAPVM6C.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-GPBKJERW.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-GZNB5V5J.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-KDNZSVCK.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-LIY2ILWI.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-MORRAQXQ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-OJ64VYGO.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-RAC2UXLT.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ROH64TST.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-WQ5227PH.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-XQLLRYOX.js.map +0 -1
- package/dist/cli-bundle/chunks/close-II7JKV32.js +0 -12
- package/dist/cli-bundle/chunks/close-many-FD46X4WK.js +0 -21
- package/dist/cli-bundle/chunks/comments-OAU2E7RK.js +0 -13
- package/dist/cli-bundle/chunks/copy-5MOERABQ.js +0 -9
- package/dist/cli-bundle/chunks/create-DOMKSBHN.js +0 -25
- package/dist/cli-bundle/chunks/delete-BMOQWZRQ.js +0 -10
- package/dist/cli-bundle/chunks/docs-J4OI4PWM.js +0 -14
- package/dist/cli-bundle/chunks/focus-7H5B4PKZ.js +0 -10
- package/dist/cli-bundle/chunks/history-redact-ZNS2QTMI.js +0 -16
- package/dist/cli-bundle/chunks/history-repair-LQ5IU4ZX.js +0 -18
- package/dist/cli-bundle/chunks/learnings-AHMJNIQZ.js +0 -13
- package/dist/cli-bundle/chunks/notes-GJI26GJR.js +0 -13
- package/dist/cli-bundle/chunks/plan-ZHJH6VMF.js +0 -24
- package/dist/cli-bundle/chunks/register-operations-3TYKCKEZ.js.map +0 -1
- package/dist/cli-bundle/chunks/register-operations-WKZSX4QP.js.map +0 -7
- package/dist/cli-bundle/chunks/restore-AR77QSO6.js +0 -14
- package/dist/cli-bundle/chunks/update-D3ZZ2V7Z.js +0 -21
- package/dist/cli-bundle/chunks/update-many-2Q2PRSSB.js +0 -30
- /package/dist/cli-bundle/chunks/{append-425YGJMY.js.map → append-RH3G5RAV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-464PHZ65.js.map → append-T5DTS4NU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YMP6AKGU.js.map → chunk-2XWRFOPR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HT5P3WC6.js.map → chunk-2Z36LSAT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DBV6QRYT.js.map → chunk-3KJ3FG5O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AQLKMQQA.js.map → chunk-3M5BWYUA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-47CCRGRH.js.map → chunk-47TKJR3D.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YCSDMIQW.js.map → chunk-4MO4PPR2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WCRAUCJO.js.map → chunk-546WPG33.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RLOWK5EQ.js.map → chunk-5754C5XS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7U5INZ2C.js.map → chunk-5V746BN3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZLQDOBZL.js.map → chunk-6OK5QSGH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2HNZKLHV.js.map → chunk-7SHFQB2A.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6APTSPP5.js.map → chunk-7SIWW7C3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7HQQT6AT.js.map → chunk-7TYZTBEV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YCHJLOO2.js.map → chunk-A6AK7W5M.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WBKZAO3P.js.map → chunk-A6AVSYRJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-L7C6RTGH.js.map → chunk-ACDIA6NP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AX3BJLPV.js.map → chunk-ACRC3HI4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-B6JBI7JX.js.map → chunk-ANLHBXAE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2KQG6L3J.js.map → chunk-AS62PEJE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-J3EXRK2H.js.map → chunk-BLRO2POO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VOXOXART.js.map → chunk-DLZ3RXAL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-H6YDNW46.js.map → chunk-DNH44IKP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QI5KTH6A.js.map → chunk-EBBROE54.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GC5ME4ZU.js.map → chunk-FF523THY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5OBMSBWX.js.map → chunk-FIZUJWXQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HLBSL5KE.js.map → chunk-FVWQFTTW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YIWYD7TC.js.map → chunk-FVZEIWTL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4DC5XNMS.js.map → chunk-GFBV2254.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OKZ35F3Y.js.map → chunk-GRB3TFOC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TZFULSN4.js.map → chunk-GVGFLZQS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RTG2LHQ7.js.map → chunk-HLZXQKGZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5F7UJHFY.js.map → chunk-HO6CDURZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MN2YMU55.js.map → chunk-HOE3UV3G.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-I535LTZ2.js.map → chunk-IS6M4ETF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-K7HEURQ4.js.map → chunk-J2XEW4YL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-O2Q7YQGO.js.map → chunk-J7XSQCJO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RA2LPP6E.js.map → chunk-JM4Z53DN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JR6FIX53.js.map → chunk-JNNPTGXR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-I5VZGPS2.js.map → chunk-K7CGOZK5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-B6OANV3G.js.map → chunk-KDH62ECD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NR7PTIR7.js.map → chunk-L23NAJHL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FCZ6WYSR.js.map → chunk-LEXFDABF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GP54I36Z.js.map → chunk-LNAGQRIL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DD2WZD6L.js.map → chunk-LU4Z7POS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FEVEIX53.js.map → chunk-LX265XY7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NJABR6EB.js.map → chunk-MQAGSAMS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MRMS62WQ.js.map → chunk-N4NKVLPY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RY57ESL2.js.map → chunk-ND3MDD6L.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Y476SA4V.js.map → chunk-NEJKKTCG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Q3EW4RE5.js.map → chunk-NGL3X3XM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ENJDRDDP.js.map → chunk-NK54BSL7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KHQYX2QB.js.map → chunk-NN57FRRN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VNCQ7SSG.js.map → chunk-NNRXTZ7Y.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KZQHMDS6.js.map → chunk-NOIIRLCO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-K2PDZYUF.js.map → chunk-OC2CLNMS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SN7Q7M4U.js.map → chunk-OKUFGORG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZLWBLI5R.js.map → chunk-OOK6V7BF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DDEYJ3BH.js.map → chunk-OUQ4I6HC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-X7ZXLB3C.js.map → chunk-PDOJRPYR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HDNEQAHV.js.map → chunk-PHQPQNAT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FMFSUTTD.js.map → chunk-PTJ7NVUU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5URFS7C4.js.map → chunk-PUMGO764.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RPZ57GQ7.js.map → chunk-QFCCN4JO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-35YNX7RQ.js.map → chunk-QYIDXRRX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ITIUEWD5.js.map → chunk-RFDT674H.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2BUNV627.js.map → chunk-SJ2DADDH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZYDUOY54.js.map → chunk-TKD4NESJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BU2CV5ZU.js.map → chunk-TMNQV4EK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GJNBKU6G.js.map → chunk-TWELUDDF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Y5E6FCAL.js.map → chunk-U3S22BOJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2BKRMFGK.js.map → chunk-UFY4ETU6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EEUIIDWF.js.map → chunk-UGQENMKM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XK5CTXMB.js.map → chunk-UGSHP6SR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2JWIRG4V.js.map → chunk-VF24O6TV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-PZBRTJ3Y.js.map → chunk-VLVTXEGG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NAGOH4YJ.js.map → chunk-VXUWCJS7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ETGRUM64.js.map → chunk-WBMARQCV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-L6C62S4V.js.map → chunk-WZDABROA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-P63GUQK5.js.map → chunk-XG5GVZRX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6UWHAJEX.js.map → chunk-XGCPTS6L.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XGUXU4IQ.js.map → chunk-Y44B5FBE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-C3QR2DPR.js.map → chunk-YP6DWEWQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TB6364F7.js.map → chunk-Z7XTVIN5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XSJZF3TO.js.map → chunk-ZEKVLV6P.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SNFLSFFH.js.map → chunk-ZFPOBSPC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RYASC6U3.js.map → chunk-ZUB725AA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-A77IGXNC.js.map → close-CQHW3WMK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-II7JKV32.js.map → close-ZZW5FLTB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-P2YOWN52.js.map → close-many-AR2YH3SJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-FD46X4WK.js.map → close-many-IKCEGBLQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-OAU2E7RK.js.map → comments-NV4SIY5Z.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-FNLKE3TW.js.map → comments-UV4HMI2K.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-U6H22S7E.js.map → copy-OUFWOHVG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-5MOERABQ.js.map → copy-X7HJFWIH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-HS64DHTL.js.map → create-QEDL4KKT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-DOMKSBHN.js.map → create-R6MMMMJS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-4XPF5XLP.js.map → delete-MJGZFDHZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-BMOQWZRQ.js.map → delete-OOJRG4HF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-TMOF765V.js.map → deps-4OP6Q76N.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-R44LVZTU.js.map → deps-Y5X6NFT5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-J4OI4PWM.js.map → docs-SILTBWSO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-HN6QKGEU.js.map → docs-UKTQVUHS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-RNFWG435.js.map → files-2QEI2V3C.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-NX4LNOPL.js.map → files-7OIKZPI3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-7H5B4PKZ.js.map → focus-3YC5LFCG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-OBSDVVI7.js.map → focus-FFWH32BF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-RZMMFSTO.js.map → history-compact-AAA4W6LY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-CKNRN637.js.map → history-compact-PIURAPW5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-ZNS2QTMI.js.map → history-redact-KWZ7LKQB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-W7TTAEX2.js.map → history-redact-NTO74EIV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-LQ5IU4ZX.js.map → history-repair-QWZJYYOJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-RGAQBOIS.js.map → history-repair-ROV5TD3L.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-AHMJNIQZ.js.map → learnings-25TJCVON.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-VDRTXWTF.js.map → learnings-3WJFJT7E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-UXXTI3J5.js.map → notes-FM53JJ5C.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-GJI26GJR.js.map → notes-IAHGNCYQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-H3OPE2RP.js.map → plan-EJ4USP2S.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-ZHJH6VMF.js.map → plan-WHV4H2RW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{profile-PFNN3CBJ.js.map → profile-SZQVKHUQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{profile-FCZWT5LE.js.map → profile-TXE673DR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-setup-HSVJDV3R.js.map → register-setup-KB5U3RES.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-setup-KE5L3H7U.js.map → register-setup-ZG7YXPHJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-MDNVYUDD.js.map → restore-F5HPTRBR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-AR77QSO6.js.map → restore-LN57EB5H.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-AJCAANMB.js.map → schema-3DKXA4KR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-2B37DMM2.js.map → schema-QLTOK23S.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-D3ZZ2V7Z.js.map → update-2T5EWMXD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-ZCDGTSNL.js.map → update-IKMNH3W4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-6E2DDBE4.js.map → update-many-3Q6Z2Q4Y.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-2Q2PRSSB.js.map → update-many-OTAS4BWH.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legacy-none-tokens.js","sources":["cli/commands/legacy-none-tokens.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module cli/commands/legacy-none-tokens\n *\n * Implements the pm legacy none tokens command surface and its agent-facing runtime behavior.\n */\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\n\n/**\n * Shared legacy \"none\"/\"null\" sentinel handling for the create and update\n * commands. These tokens used to mean \"clear this field\"; they are now\n * rejected in favour of explicit --unset / --clear-* flags.\n *\n * Extracted verbatim from create.ts and update.ts (pm-why9) — behaviour and\n * error strings are identical to the previous per-command copies.\n */\nconst LEGACY_NONE_TOKENS = new Set([\"none\", \"null\"]);\n\n/** Describes a repeatable option whose legacy none/null token maps to a clear flag. */\nexport interface LegacyNoneCollectionNormalizer<\n TOptions extends Record<string, unknown>,\n> {\n /** Value that configures or reports option key for this contract. */\n optionKey: keyof TOptions;\n /** Value that configures or reports clear flag key for this contract. */\n clearFlagKey: keyof TOptions;\n /** Value that configures or reports value flag for this contract. */\n valueFlag: string;\n /** Value that configures or reports clear flag for this contract. */\n clearFlag: string;\n /** Value that configures or reports disable flag key for this contract. */\n disableFlagKey?: keyof TOptions;\n}\n\n/** Implements check whether legacy none token for the public runtime surface of this module. */\nexport function isLegacyNoneToken(value: string | undefined): boolean {\n if (value === undefined) {\n return false;\n }\n return LEGACY_NONE_TOKENS.has(value.trim().toLowerCase());\n}\n\n/** Implements assert no legacy none token for the public runtime surface of this module. */\nexport function assertNoLegacyNoneToken(\n value: string | undefined,\n flag: string,\n replacementHint?: string,\n): void {\n if (!isLegacyNoneToken(value)) {\n return;\n }\n const suffix = replacementHint ? ` ${replacementHint}` : \"\";\n throw new PmCliError(\n `${flag} no longer accepts \"none\" or \"null\".${suffix}`.trim(),\n EXIT_CODE.USAGE,\n );\n}\n\n/** Implements assert no legacy none tokens for the public runtime surface of this module. */\nexport function assertNoLegacyNoneTokens(\n values: string[] | undefined,\n flag: string,\n replacementHint?: string,\n): void {\n if (!values || values.length === 0) {\n return;\n }\n const hasLegacyToken = values.some((value) => isLegacyNoneToken(value));\n if (!hasLegacyToken) {\n return;\n }\n const suffix = replacementHint ? ` ${replacementHint}` : \"\";\n throw new PmCliError(\n `${flag} no longer accepts \"none\" or \"null\".${suffix}`.trim(),\n EXIT_CODE.USAGE,\n );\n}\n\n/** Convert collection-level legacy none/null tokens into their explicit clear flags. */\nexport function applyLegacyNoneCollectionNormalizers<\n TOptions extends Record<string, unknown>,\n>(\n normalized: TOptions,\n definitions: ReadonlyArray<LegacyNoneCollectionNormalizer<TOptions>>,\n): TOptions {\n for (const definition of definitions) {\n const candidate = normalized[definition.optionKey];\n if (!Array.isArray(candidate) || candidate.length === 0) {\n continue;\n }\n if (\n !candidate.every((entry): entry is string => typeof entry === \"string\")\n ) {\n throw new PmCliError(\n `${definition.valueFlag} entries must be strings.`,\n EXIT_CODE.USAGE,\n );\n }\n const entries = candidate;\n const hasLegacy = entries.some((entry) => isLegacyNoneToken(entry));\n if (!hasLegacy) {\n continue;\n }\n const concreteEntries = entries.filter(\n (entry) => !isLegacyNoneToken(entry),\n );\n if (concreteEntries.length > 0) {\n throw new PmCliError(\n `Cannot mix legacy clear token \"none\"/\"null\" with concrete ${definition.valueFlag} entries. Use ${definition.clearFlag} to clear or provide explicit entries.`,\n EXIT_CODE.USAGE,\n );\n }\n normalized[definition.optionKey] = undefined as TOptions[keyof TOptions];\n normalized[definition.clearFlagKey] = true as TOptions[keyof TOptions];\n if (definition.disableFlagKey) {\n normalized[definition.disableFlagKey] = false as TOptions[keyof TOptions];\n }\n }\n return normalized;\n}\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAEzD;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G,IAAgC,CAAC;QACvE,IAAI,UAAU,CAAC,cAAc,EAAE,CAAC;YAC9B,UAAU,CAAC,UAAU,CAAC,cAAc,CAAC,GAAG,KAAiC,CAAC;QAC5E,CAAC;IACH,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC","debugId":"af642aea-a253-5bd0-bc0d-e2e01d4be025"}
|
|
1
|
+
{"version":3,"file":"legacy-none-tokens.js","sources":["cli/commands/legacy-none-tokens.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module cli/commands/legacy-none-tokens\n *\n * Implements the pm legacy none tokens command surface and its agent-facing runtime behavior.\n */\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\n\n/**\n * Shared legacy \"none\"/\"null\" sentinel handling for the create and update\n * commands. These tokens used to mean \"clear this field\"; they are now\n * rejected in favour of explicit --unset / --clear-* flags.\n *\n * Extracted verbatim from create.ts and update.ts (pm-why9) — behaviour and\n * error strings are identical to the previous per-command copies.\n */\nconst LEGACY_NONE_TOKENS = new Set([\"none\", \"null\"]);\n\n/** Describes a repeatable option whose legacy none/null token maps to a clear flag. */\nexport interface LegacyNoneCollectionNormalizer<\n TOptions extends object,\n> {\n /** Value that configures or reports option key for this contract. */\n optionKey: keyof TOptions;\n /** Value that configures or reports clear flag key for this contract. */\n clearFlagKey: keyof TOptions;\n /** Value that configures or reports value flag for this contract. */\n valueFlag: string;\n /** Value that configures or reports clear flag for this contract. */\n clearFlag: string;\n /** Value that configures or reports disable flag key for this contract. */\n disableFlagKey?: keyof TOptions;\n}\n\n/** Collection and clear options shared by create and update legacy-token normalization. */\nexport interface LegacyNoneCollectionOptions {\n /** Dependency entries accepted by create and update. */\n dep?: string[];\n /** Whether dependency entries should be cleared. */\n clearDeps?: boolean;\n /** Comment entries accepted by create and update. */\n comment?: string[];\n /** Whether comment entries should be cleared. */\n clearComments?: boolean;\n /** Note entries accepted by create and update. */\n note?: string[];\n /** Whether note entries should be cleared. */\n clearNotes?: boolean;\n /** Learning entries accepted by create and update. */\n learning?: string[];\n /** Whether learning entries should be cleared. */\n clearLearnings?: boolean;\n /** Linked-file entries accepted by create and update. */\n file?: string[];\n /** Whether linked-file entries should be cleared. */\n clearFiles?: boolean;\n /** Linked-test entries accepted by create and update. */\n test?: string[];\n /** Whether linked-test entries should be cleared. */\n clearTests?: boolean;\n /** Linked-document entries accepted by create and update. */\n doc?: string[];\n /** Whether linked-document entries should be cleared. */\n clearDocs?: boolean;\n /** Reminder entries accepted by create and update. */\n reminder?: string[];\n /** Whether reminder entries should be cleared. */\n clearReminders?: boolean;\n /** Event entries accepted by create and update. */\n event?: string[];\n /** Whether event entries should be cleared. */\n clearEvents?: boolean;\n /** Custom type-option entries accepted by create and update. */\n typeOption?: string[];\n /** Whether custom type-option entries should be cleared. */\n clearTypeOptions?: boolean;\n}\n\n/** Build the shared create/update collection normalizer table with optional replacement-mode guards. */\nexport function createLegacyNoneCollectionNormalizers<\n TOptions extends LegacyNoneCollectionOptions,\n>(\n options: {\n depDisableFlagKey?: keyof TOptions;\n testDisableFlagKey?: keyof TOptions;\n } = {},\n): ReadonlyArray<LegacyNoneCollectionNormalizer<TOptions>> {\n return [\n {\n optionKey: \"dep\",\n clearFlagKey: \"clearDeps\",\n valueFlag: \"--dep\",\n clearFlag: \"--clear-deps\",\n ...(options.depDisableFlagKey === undefined\n ? {}\n : { disableFlagKey: options.depDisableFlagKey }),\n },\n {\n optionKey: \"comment\",\n clearFlagKey: \"clearComments\",\n valueFlag: \"--comment\",\n clearFlag: \"--clear-comments\",\n },\n {\n optionKey: \"note\",\n clearFlagKey: \"clearNotes\",\n valueFlag: \"--note\",\n clearFlag: \"--clear-notes\",\n },\n {\n optionKey: \"learning\",\n clearFlagKey: \"clearLearnings\",\n valueFlag: \"--learning\",\n clearFlag: \"--clear-learnings\",\n },\n {\n optionKey: \"file\",\n clearFlagKey: \"clearFiles\",\n valueFlag: \"--file\",\n clearFlag: \"--clear-files\",\n },\n {\n optionKey: \"test\",\n clearFlagKey: \"clearTests\",\n valueFlag: \"--test\",\n clearFlag: \"--clear-tests\",\n ...(options.testDisableFlagKey === undefined\n ? {}\n : { disableFlagKey: options.testDisableFlagKey }),\n },\n {\n optionKey: \"doc\",\n clearFlagKey: \"clearDocs\",\n valueFlag: \"--doc\",\n clearFlag: \"--clear-docs\",\n },\n {\n optionKey: \"reminder\",\n clearFlagKey: \"clearReminders\",\n valueFlag: \"--reminder\",\n clearFlag: \"--clear-reminders\",\n },\n {\n optionKey: \"event\",\n clearFlagKey: \"clearEvents\",\n valueFlag: \"--event\",\n clearFlag: \"--clear-events\",\n },\n {\n optionKey: \"typeOption\",\n clearFlagKey: \"clearTypeOptions\",\n valueFlag: \"--type-option\",\n clearFlag: \"--clear-type-options\",\n },\n ];\n}\n\n/** Implements check whether legacy none token for the public runtime surface of this module. */\nexport function isLegacyNoneToken(value: string | undefined): boolean {\n if (value === undefined) {\n return false;\n }\n return LEGACY_NONE_TOKENS.has(value.trim().toLowerCase());\n}\n\n/** Implements assert no legacy none token for the public runtime surface of this module. */\nexport function assertNoLegacyNoneToken(\n value: string | undefined,\n flag: string,\n replacementHint?: string,\n): void {\n if (!isLegacyNoneToken(value)) {\n return;\n }\n const suffix = replacementHint ? ` ${replacementHint}` : \"\";\n throw new PmCliError(\n `${flag} no longer accepts \"none\" or \"null\".${suffix}`.trim(),\n EXIT_CODE.USAGE,\n );\n}\n\n/** Implements assert no legacy none tokens for the public runtime surface of this module. */\nexport function assertNoLegacyNoneTokens(\n values: string[] | undefined,\n flag: string,\n replacementHint?: string,\n): void {\n if (!values || values.length === 0) {\n return;\n }\n const hasLegacyToken = values.some((value) => isLegacyNoneToken(value));\n if (!hasLegacyToken) {\n return;\n }\n const suffix = replacementHint ? ` ${replacementHint}` : \"\";\n throw new PmCliError(\n `${flag} no longer accepts \"none\" or \"null\".${suffix}`.trim(),\n EXIT_CODE.USAGE,\n );\n}\n\n/** Convert collection-level legacy none/null tokens into their explicit clear flags. */\nexport function applyLegacyNoneCollectionNormalizers<\n TOptions extends Record<string, unknown>,\n>(\n normalized: TOptions,\n definitions: ReadonlyArray<LegacyNoneCollectionNormalizer<TOptions>>,\n): TOptions {\n for (const definition of definitions) {\n const candidate = normalized[definition.optionKey];\n if (!Array.isArray(candidate) || candidate.length === 0) {\n continue;\n }\n if (\n !candidate.every((entry): entry is string => typeof entry === \"string\")\n ) {\n throw new PmCliError(\n `${definition.valueFlag} entries must be strings.`,\n EXIT_CODE.USAGE,\n );\n }\n const entries = candidate;\n const hasLegacy = entries.some((entry) => isLegacyNoneToken(entry));\n if (!hasLegacy) {\n continue;\n }\n const concreteEntries = entries.filter(\n (entry) => !isLegacyNoneToken(entry),\n );\n if (concreteEntries.length > 0) {\n throw new PmCliError(\n `Cannot mix legacy clear token \"none\"/\"null\" with concrete ${definition.valueFlag} entries. Use ${definition.clearFlag} to clear or provide explicit entries.`,\n EXIT_CODE.USAGE,\n );\n }\n normalized[definition.optionKey] = undefined as TOptions[keyof TOptions];\n normalized[definition.clearFlagKey] = true as TOptions[keyof TOptions];\n if (definition.disableFlagKey) {\n normalized[definition.disableFlagKey] = false as TOptions[keyof TOptions];\n }\n }\n return normalized;\n}\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAEzD;;;;;;;GAOG;AACH,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AA8DrD,wGAAwG;AACxG,MAAM,UAAU,qCAAqC,CAGnD,UAGI,EAAE;IAEN,OAAO;QACL;YACE,SAAS,EAAE,KAAK;YAChB,YAAY,EAAE,WAAW;YACzB,SAAS,EAAE,OAAO;YAClB,SAAS,EAAE,cAAc;YACzB,GAAG,CAAC,OAAO,CAAC,iBAAiB,KAAK,SAAS;gBACzC,CAAC,C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CAAC,cAAc,CAAC,GAAG,KAAiC,CAAC;QAC5E,CAAC;IACH,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC","debugId":"66cfe799-e16b-5591-93ac-c022ecd71609"}
|
|
@@ -23,7 +23,7 @@ export interface NextOptions {
|
|
|
23
23
|
/** Value that configures or reports tag for this contract. */
|
|
24
24
|
tag?: string;
|
|
25
25
|
/** Value that configures or reports priority for this contract. */
|
|
26
|
-
priority?: string;
|
|
26
|
+
priority?: string | number;
|
|
27
27
|
/** Value that configures or reports assignee for this contract. */
|
|
28
28
|
assignee?: string;
|
|
29
29
|
/** Value that configures or reports assignee filter for this contract. */
|
|
@@ -44,6 +44,8 @@ export interface NextOptions {
|
|
|
44
44
|
format?: string;
|
|
45
45
|
/** Value that configures or reports explain ranking for this contract. */
|
|
46
46
|
explainRanking?: boolean;
|
|
47
|
+
/** Include human-gated Decision items in the claimable ready queue. */
|
|
48
|
+
includeDecisions?: boolean;
|
|
47
49
|
/** Internal caller override used to align claim-next ranking with --author. */
|
|
48
50
|
callerAuthor?: string;
|
|
49
51
|
[key: string]: unknown;
|
|
@@ -63,6 +65,8 @@ export interface NextBlockerRef {
|
|
|
63
65
|
* would unblock.
|
|
64
66
|
*/
|
|
65
67
|
export interface NextActionableItem extends ContextFocusItem {
|
|
68
|
+
/** One-based position in the complete ranked actionable queue. */
|
|
69
|
+
rank: number;
|
|
66
70
|
/** Number of open blocker entries represented by this result. */
|
|
67
71
|
open_blocker_count: number;
|
|
68
72
|
/** Value that configures or reports blockers for this contract. */
|
|
@@ -93,6 +97,8 @@ export interface NextResult {
|
|
|
93
97
|
recommended: NextRecommendation | null;
|
|
94
98
|
/** Value that configures or reports ready for this contract. */
|
|
95
99
|
ready: NextActionableItem[];
|
|
100
|
+
/** Human-gated decisions kept visible without dispatching them to agents. */
|
|
101
|
+
decision_needed: NextActionableItem[];
|
|
96
102
|
/** Value that configures or reports blocked for this contract. */
|
|
97
103
|
blocked: NextActionableItem[];
|
|
98
104
|
/** Value that configures or reports held by others for this contract. */
|
|
@@ -106,7 +112,7 @@ export interface NextResult {
|
|
|
106
112
|
filters: {
|
|
107
113
|
type: string | null;
|
|
108
114
|
tag: string | null;
|
|
109
|
-
priority: string | null;
|
|
115
|
+
priority: string | number | null;
|
|
110
116
|
assignee: string | null;
|
|
111
117
|
assignee_filter: string | null;
|
|
112
118
|
sprint: string | null;
|
|
@@ -115,6 +121,7 @@ export interface NextResult {
|
|
|
115
121
|
limit: number;
|
|
116
122
|
blocked_limit: number;
|
|
117
123
|
ready_only: boolean;
|
|
124
|
+
include_decisions: boolean;
|
|
118
125
|
};
|
|
119
126
|
/** Value that configures or reports suggestions for this contract. */
|
|
120
127
|
suggestions?: string[];
|
|
@@ -136,6 +143,11 @@ declare function partitionCallerOwnedReady(ready: ActionableEntry[], fallbackAut
|
|
|
136
143
|
export declare const _testOnlyNextCommand: {
|
|
137
144
|
partitionCallerOwnedReady: typeof partitionCallerOwnedReady;
|
|
138
145
|
};
|
|
146
|
+
/** Separates human-gated decisions from autonomous agent work unless the caller explicitly opts into decision claims. */
|
|
147
|
+
export declare function partitionDecisionEntries(ready: ActionableEntry[], includeDecisions: boolean): {
|
|
148
|
+
agent: ActionableEntry[];
|
|
149
|
+
decisions: ActionableEntry[];
|
|
150
|
+
};
|
|
139
151
|
/** Implements `pm next`: computes the ranked ready/blocked actionable queues and a single recommended next item with rationale for the public runtime surface. */
|
|
140
152
|
export declare function runNext(options: NextOptions, global: GlobalOptions): Promise<NextResult>;
|
|
141
153
|
/**
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* re-deriving readiness from a full `pm context` snapshot every turn.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
!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]="
|
|
12
|
+
!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]="36ef6d7f-a1ec-5dd9-a3df-9ff03156dc87")}catch(e){}}();
|
|
13
13
|
import { collectBlockedByIds, computeActionabilityReport, } from "../../core/item/actionability.js";
|
|
14
14
|
import { resolveRuntimeStatusRegistry, } from "../../core/schema/runtime-schema.js";
|
|
15
15
|
import { EXIT_CODE } from "../../core/shared/constants.js";
|
|
@@ -56,7 +56,7 @@ function parseNextLimit(raw, flag, fallback) {
|
|
|
56
56
|
}
|
|
57
57
|
// Projects an actionable entry onto its output row. Ready entries carry no
|
|
58
58
|
// blockers; blocked entries surface their unresolved blockers for the agent.
|
|
59
|
-
function toNextActionableItem(entry, statusRegistry, childrenByParent) {
|
|
59
|
+
function toNextActionableItem(entry, statusRegistry, childrenByParent, rank) {
|
|
60
60
|
return {
|
|
61
61
|
...toContextFocusItem(entry.item, statusRegistry, childrenByParent),
|
|
62
62
|
open_blocker_count: entry.open_blockers.length,
|
|
@@ -66,6 +66,7 @@ function toNextActionableItem(entry, statusRegistry, childrenByParent) {
|
|
|
66
66
|
status: blocker.status,
|
|
67
67
|
})),
|
|
68
68
|
unblocks: entry.unblocks,
|
|
69
|
+
rank,
|
|
69
70
|
};
|
|
70
71
|
}
|
|
71
72
|
// Builds the human+agent readable rationale for the recommended item, ordering
|
|
@@ -113,6 +114,16 @@ function partitionCallerOwnedReady(ready, fallbackAuthor, explicitAuthor) {
|
|
|
113
114
|
}
|
|
114
115
|
/** Test-only access to deterministic next-work partitioning edge cases. */
|
|
115
116
|
export const _testOnlyNextCommand = { partitionCallerOwnedReady };
|
|
117
|
+
/** Separates human-gated decisions from autonomous agent work unless the caller explicitly opts into decision claims. */
|
|
118
|
+
export function partitionDecisionEntries(ready, includeDecisions) {
|
|
119
|
+
const decisions = ready.filter((entry) => entry.item.type.trim().toLowerCase() === "decision");
|
|
120
|
+
return {
|
|
121
|
+
agent: includeDecisions
|
|
122
|
+
? ready
|
|
123
|
+
: ready.filter((entry) => entry.item.type.trim().toLowerCase() !== "decision"),
|
|
124
|
+
decisions: includeDecisions ? [] : decisions,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
116
127
|
// Renders a deadline as a date token plus a relative tag (overdue/today/in Nd).
|
|
117
128
|
// The relative delta is computed on UTC calendar dates (both sides normalized to
|
|
118
129
|
// midnight) so a deadline due today never reads as "overdue 1d" just because the
|
|
@@ -151,7 +162,9 @@ function nextListOptions(options, extra) {
|
|
|
151
162
|
return {
|
|
152
163
|
type: options.type,
|
|
153
164
|
tag: options.tag,
|
|
154
|
-
priority: options.priority
|
|
165
|
+
priority: typeof options.priority === "number"
|
|
166
|
+
? String(options.priority)
|
|
167
|
+
: options.priority,
|
|
155
168
|
assignee: options.assignee,
|
|
156
169
|
assigneeFilter: options.assigneeFilter,
|
|
157
170
|
sprint: options.sprint,
|
|
@@ -209,10 +222,10 @@ function filterCandidatesByParentScope(candidates, corpus, parentScope) {
|
|
|
209
222
|
}
|
|
210
223
|
return candidates.filter((item) => subtree.ids.has(item.id.trim().toLowerCase()));
|
|
211
224
|
}
|
|
212
|
-
async function rankReadyEntriesWithRelevance(rankedReady, childrenByParent, statusRegistry, now) {
|
|
225
|
+
async function rankReadyEntriesWithRelevance(rankedReady, childrenByParent, statusRegistry, now, callerAuthor) {
|
|
213
226
|
const concreteReady = rankedReady.filter((entry) => !hasCompletedDescendants(entry.item, childrenByParent));
|
|
214
227
|
const structuralReady = concreteReady.length > 0 ? concreteReady : rankedReady;
|
|
215
|
-
const ranking = await scoreContextCandidatesWithActiveExtensions("next", buildItemContextRelevanceCandidates(structuralReady.map((entry) => entry.item), statusRegistry, now, process.env.PM_AUTHOR));
|
|
228
|
+
const ranking = await scoreContextCandidatesWithActiveExtensions("next", buildItemContextRelevanceCandidates(structuralReady.map((entry) => entry.item), statusRegistry, now, callerAuthor ?? process.env.PM_AUTHOR));
|
|
216
229
|
const readyById = new Map(structuralReady.map((entry) => [entry.item.id, entry]));
|
|
217
230
|
const projectedReady = ranking.ranked
|
|
218
231
|
.map((entry) => readyById.get(entry.id))
|
|
@@ -244,12 +257,14 @@ export async function runNext(options, global) {
|
|
|
244
257
|
const corpus = corpusList.items;
|
|
245
258
|
const report = computeActionabilityReport(candidates, corpus, statusRegistry);
|
|
246
259
|
const childrenByParent = buildChildrenByParent(corpus);
|
|
247
|
-
const
|
|
260
|
+
const partitionedByDecision = partitionDecisionEntries(report.ready, options.includeDecisions === true);
|
|
261
|
+
const callerPartition = partitionCallerOwnedReady(partitionedByDecision.agent, settings.author_default, options.callerAuthor);
|
|
248
262
|
const rankedReady = rankNextReadyEntries(callerPartition.available, childrenByParent, statusRegistry);
|
|
249
263
|
const rankedBlocked = [...report.blocked].sort((left, right) => compareCriticalItems(left.item, right.item, statusRegistry));
|
|
250
|
-
const { projectedReady, ranking: readyRanking, completedContainer, } = await rankReadyEntriesWithRelevance(rankedReady, childrenByParent, statusRegistry, now);
|
|
251
|
-
const readyRows = projectedReady.map((entry) => toNextActionableItem(entry, statusRegistry, childrenByParent));
|
|
252
|
-
const blockedRows = rankedBlocked.map((entry) => toNextActionableItem(entry, statusRegistry, childrenByParent));
|
|
264
|
+
const { projectedReady, ranking: readyRanking, completedContainer, } = await rankReadyEntriesWithRelevance(rankedReady, childrenByParent, statusRegistry, now, options.callerAuthor);
|
|
265
|
+
const readyRows = projectedReady.map((entry, index) => toNextActionableItem(entry, statusRegistry, childrenByParent, index + 1));
|
|
266
|
+
const blockedRows = rankedBlocked.map((entry, index) => toNextActionableItem(entry, statusRegistry, childrenByParent, index + 1));
|
|
267
|
+
const decisionRows = rankNextReadyEntries(partitionedByDecision.decisions, childrenByParent, statusRegistry).map((entry, index) => toNextActionableItem(entry, statusRegistry, childrenByParent, index + 1));
|
|
253
268
|
const recommended = buildNextRecommendation({
|
|
254
269
|
projectedReady,
|
|
255
270
|
readyRows,
|
|
@@ -262,6 +277,7 @@ export async function runNext(options, global) {
|
|
|
262
277
|
now,
|
|
263
278
|
recommended,
|
|
264
279
|
ready: readyRows.slice(1, limit + 1),
|
|
280
|
+
decision_needed: decisionRows,
|
|
265
281
|
blocked: readyOnly ? [] : blockedRows.slice(0, blockedLimit),
|
|
266
282
|
held_by_others: callerPartition.held,
|
|
267
283
|
summary: {
|
|
@@ -284,6 +300,7 @@ export async function runNext(options, global) {
|
|
|
284
300
|
limit,
|
|
285
301
|
blocked_limit: blockedLimit,
|
|
286
302
|
ready_only: readyOnly,
|
|
303
|
+
include_decisions: options.includeDecisions === true,
|
|
287
304
|
},
|
|
288
305
|
};
|
|
289
306
|
const warnings = [
|
|
@@ -322,6 +339,16 @@ export function renderNextMarkdown(result) {
|
|
|
322
339
|
lines.push("No ready work.");
|
|
323
340
|
}
|
|
324
341
|
lines.push("");
|
|
342
|
+
lines.push("## Decision needed");
|
|
343
|
+
const decisionNeeded = result.decision_needed ?? [];
|
|
344
|
+
if (decisionNeeded.length === 0) {
|
|
345
|
+
lines.push("No human-gated decisions.");
|
|
346
|
+
}
|
|
347
|
+
else {
|
|
348
|
+
for (const item of decisionNeeded)
|
|
349
|
+
lines.push(`- ${formatNextLine(item)}`);
|
|
350
|
+
}
|
|
351
|
+
lines.push("");
|
|
325
352
|
lines.push("## Ready");
|
|
326
353
|
if (result.ready.length === 0) {
|
|
327
354
|
lines.push("No ready items.");
|
|
@@ -361,7 +388,8 @@ function formatNextLine(item) {
|
|
|
361
388
|
const deadlineToken = item.deadline ?? "-";
|
|
362
389
|
const parentToken = item.parent ? ` parent:${item.parent}` : "";
|
|
363
390
|
const unblocksToken = item.unblocks.length > 0 ? ` unblocks:${item.unblocks.length}` : "";
|
|
364
|
-
|
|
391
|
+
const rankToken = Number.isInteger(item.rank) ? `#${item.rank} ` : "";
|
|
392
|
+
return `${rankToken}${item.id} p${item.priority} ${item.status} ${item.type} deadline:${deadlineToken}${parentToken}${unblocksToken} ${item.title}`;
|
|
365
393
|
}
|
|
366
394
|
//# sourceMappingURL=next.js.map
|
|
367
|
-
//# debugId=
|
|
395
|
+
//# debugId=36ef6d7f-a1ec-5dd9-a3df-9ff03156dc87
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next.js","sources":["cli/commands/next.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module cli/commands/next\n *\n * Implements the `pm next` command: the distilled \"what should I work on now?\"\n * query. It loads the active corpus, computes dependency-aware actionability\n * (ready vs blocked leaf work), and returns a single ranked recommendation with a\n * deterministic rationale plus the ranked ready/blocked queues — so an agent gets\n * the next action and the reason for it in one token-efficient read instead of\n * re-deriving readiness from a full `pm context` snapshot every turn.\n */\nimport {\n collectBlockedByIds,\n computeActionabilityReport,\n type ActionableEntry,\n} from \"../../core/item/actionability.js\";\nimport {\n resolveRuntimeStatusRegistry,\n type RuntimeStatusRegistry,\n} from \"../../core/schema/runtime-schema.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\nimport {\n normalizeStatusInput,\n normalizeStatusForRegistry,\n} from \"../../core/item/status.js\";\nimport { resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport type { ItemFrontMatter, ItemStatus } from \"../../types/index.js\";\nimport { parseIntegerLimit } from \"../shared-parsers.js\";\nimport {\n buildChildrenByParent,\n buildItemContextRelevanceCandidates,\n collectSubtreeIds,\n compareCriticalItems,\n toContextRankingSummary,\n toContextFocusItem,\n type ContextFocusItem,\n type ContextRankingSummary,\n} from \"./context.js\";\nimport { runList, type ListOptions } from \"./list.js\";\nimport { scoreContextCandidatesWithActiveExtensions } from \"../../sdk/context-relevance.js\";\n\n/** Supported values accepted by the next output contract. */\nexport const NEXT_OUTPUT_VALUES = [\"markdown\", \"toon\", \"json\"] as const;\n/** Restricts `pm next` output format values accepted by command, SDK, and storage contracts. */\nexport type NextOutputFormat = (typeof NEXT_OUTPUT_VALUES)[number];\n\nconst DEFAULT_NEXT_LIMIT = 5;\nconst MS_PER_DAY = 24 * 60 * 60 * 1000;\n\n/** Documents the `pm next` options payload exchanged by command, SDK, and package integrations. */\nexport interface NextOptions {\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 parent for this contract. */\n parent?: string;\n /** Value that configures or reports limit for this contract. */\n limit?: string;\n /** Value that configures or reports blocked limit for this contract. */\n blockedLimit?: string;\n /** Value that configures or reports ready only for this contract. */\n readyOnly?: boolean;\n /** Value that configures or reports format for this contract. */\n format?: string;\n /** Value that configures or reports explain ranking for this contract. */\n explainRanking?: boolean;\n /** Internal caller override used to align claim-next ranking with --author. */\n callerAuthor?: string;\n [key: string]: unknown;\n}\n\n/** A blocker reference projected onto the `pm next` output. */\nexport interface NextBlockerRef {\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 | null;\n /** Lifecycle state reported for status. */\n status: ItemStatus | null;\n}\n\n/**\n * A classified actionable item on the `pm next` output: a {@link ContextFocusItem}\n * focus row augmented with its open-blocker references and the downstream items it\n * would unblock.\n */\nexport interface NextActionableItem extends ContextFocusItem {\n /** Number of open blocker entries represented by this result. */\n open_blocker_count: number;\n /** Value that configures or reports blockers for this contract. */\n blockers: NextBlockerRef[];\n /** Value that configures or reports unblocks for this contract. */\n unblocks: string[];\n}\n\n/** The single recommended next item: an actionable row plus its rationale. */\nexport interface NextRecommendation extends NextActionableItem {\n /** Value that configures or reports reasons for this contract. */\n reasons: string[];\n}\n\ninterface NextSummary {\n recommended: boolean;\n ready: number;\n blocked: number;\n in_progress: number;\n candidates: number;\n containers: number;\n}\n\n/** Documents the `pm next` result payload exchanged by command, SDK, and package integrations. */\nexport interface NextResult {\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 recommended for this contract. */\n recommended: NextRecommendation | null;\n /** Value that configures or reports ready for this contract. */\n ready: NextActionableItem[];\n /** Value that configures or reports blocked for this contract. */\n blocked: NextActionableItem[];\n /** Value that configures or reports held by others for this contract. */\n held_by_others: Array<{ id: string; assignee: string }>;\n /** Value that configures or reports summary for this contract. */\n summary: NextSummary;\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 parent: string | null;\n limit: number;\n blocked_limit: number;\n ready_only: boolean;\n };\n /** Value that configures or reports suggestions for this contract. */\n suggestions?: 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}\n\nfunction parseNextOutputFormat(\n raw: string | undefined,\n): NextOutputFormat | undefined {\n if (!raw) return undefined;\n const normalized = raw.trim().toLowerCase();\n if (!NEXT_OUTPUT_VALUES.includes(normalized as NextOutputFormat)) {\n throw new PmCliError(\n \"Next format must be one of markdown|toon|json\",\n EXIT_CODE.USAGE,\n );\n }\n return normalized as NextOutputFormat;\n}\n\n/** Resolves the effective `pm next` output format from the command `--format` flag and the global `--json` switch, rejecting the contradictory `--json --format markdown|toon` combination. Defaults to `toon`. */\nexport function resolveNextOutputFormat(\n options: NextOptions,\n global: GlobalOptions,\n): NextOutputFormat {\n const commandFormat = parseNextOutputFormat(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// Per-section row cap. A non-positive or absent value falls back to the default;\n// invalid (non-integer) values throw via parseIntegerLimit.\nfunction parseNextLimit(\n raw: string | undefined,\n flag: string,\n fallback: number,\n): number {\n const parsed = parseIntegerLimit(raw, flag);\n if (parsed === undefined || parsed <= 0) return fallback;\n return parsed;\n}\n\n// Projects an actionable entry onto its output row. Ready entries carry no\n// blockers; blocked entries surface their unresolved blockers for the agent.\nfunction toNextActionableItem(\n entry: ActionableEntry,\n statusRegistry: RuntimeStatusRegistry,\n childrenByParent: Map<string, ItemFrontMatter[]>,\n): NextActionableItem {\n return {\n ...toContextFocusItem(entry.item, statusRegistry, childrenByParent),\n open_blocker_count: entry.open_blockers.length,\n blockers: entry.open_blockers.map((blocker) => ({\n id: blocker.id,\n title: blocker.title,\n status: blocker.status,\n })),\n unblocks: entry.unblocks,\n };\n}\n\n// Builds the human+agent readable rationale for the recommended item, ordering\n// clauses from most to least decisive (status, priority, deadline, blocker\n// clearance, parent advancement, downstream unblocks).\nfunction buildRecommendationReasons(\n entry: ActionableEntry,\n statusRegistry: RuntimeStatusRegistry,\n now: string,\n completedContainer: boolean,\n): string[] {\n const item = entry.item;\n const reasons: string[] = [];\n const inProgressStatus = normalizeStatusInput(\"in_progress\", statusRegistry);\n reasons.push(\n normalizeStatusForRegistry(item.status, statusRegistry) === inProgressStatus\n ? \"in progress — resume to finish\"\n : \"open and ready to start\",\n );\n if (completedContainer) {\n reasons.push(\"completed container — governance closeout\");\n }\n reasons.push(\n `priority p${item.priority}${item.priority === 0 ? \" (highest)\" : \"\"}`,\n );\n if (typeof item.deadline === \"string\" && item.deadline.trim().length > 0) {\n reasons.push(describeDeadline(item.deadline, now));\n }\n reasons.push(\n collectBlockedByIds(item).length > 0\n ? \"all blockers resolved\"\n : \"no blockers\",\n );\n if (typeof item.parent === \"string\" && item.parent.trim().length > 0) {\n reasons.push(`advances ${item.parent.trim()}`);\n }\n if (entry.unblocks.length > 0) {\n reasons.push(\n `unblocks ${entry.unblocks.length} item(s): ${entry.unblocks.join(\", \")}`,\n );\n }\n return reasons;\n}\n\nfunction partitionCallerOwnedReady(\n ready: ActionableEntry[],\n fallbackAuthor: string,\n explicitAuthor?: string,\n): {\n available: ActionableEntry[];\n held: Array<{ id: string; assignee: string }>;\n} {\n const caller =\n (explicitAuthor ?? process.env.PM_AUTHOR ?? fallbackAuthor).trim() ||\n \"unknown\";\n const available: ActionableEntry[] = [];\n const held: Array<{ id: string; assignee: string }> = [];\n for (const entry of ready) {\n const assignee =\n typeof entry.item.assignee === \"string\" ? entry.item.assignee.trim() : \"\";\n const isForeignWork = assignee.length > 0 && assignee !== caller;\n if (isForeignWork) held.push({ id: entry.item.id, assignee });\n else available.push(entry);\n }\n return { available, held };\n}\n\n/** Test-only access to deterministic next-work partitioning edge cases. */\nexport const _testOnlyNextCommand = { partitionCallerOwnedReady };\n\n// Renders a deadline as a date token plus a relative tag (overdue/today/in Nd).\n// The relative delta is computed on UTC calendar dates (both sides normalized to\n// midnight) so a deadline due today never reads as \"overdue 1d\" just because the\n// wall-clock time of `now` has passed midnight. Unparseable deadlines degrade to\n// the raw token (defensive — stored deadlines are always valid ISO).\nfunction describeDeadline(deadline: string, now: string): string {\n const deadlineMs = Date.parse(deadline);\n /* c8 ignore start -- defensive: a stored deadline that fails Date.parse still surfaces its raw token */\n if (!Number.isFinite(deadlineMs)) {\n return `deadline ${deadline.trim()}`;\n }\n /* c8 ignore stop */\n const dateToken = new Date(deadlineMs).toISOString().slice(0, 10);\n const nowToken = new Date(Date.parse(now)).toISOString().slice(0, 10);\n const days = Math.round(\n (Date.parse(dateToken) - Date.parse(nowToken)) / MS_PER_DAY,\n );\n if (days < 0) return `deadline ${dateToken} (overdue ${-days}d)`;\n if (days === 0) return `deadline ${dateToken} (due today)`;\n return `deadline ${dateToken} (in ${days}d)`;\n}\n\nfunction inProgressReadyCount(\n ready: NextActionableItem[],\n statusRegistry: RuntimeStatusRegistry,\n): number {\n const inProgressStatus = normalizeStatusInput(\"in_progress\", statusRegistry);\n return ready.filter(\n (item) =>\n normalizeStatusForRegistry(item.status, statusRegistry) ===\n inProgressStatus,\n ).length;\n}\n\n// Returns true when an otherwise-ready item still has terminal descendants. Such\n// rows are useful governance closeout context, but concrete leaf work should rank\n// ahead of them in the default agent loop.\nfunction hasCompletedDescendants(\n item: ItemFrontMatter,\n childrenByParent: Map<string, ItemFrontMatter[]>,\n): boolean {\n return (childrenByParent.get(item.id.trim().toLowerCase()) ?? []).length > 0;\n}\n\n// Strips projection/pagination flags so the corpus reads stay full: limits are\n// per-section display caps applied after classification, never corpus filters.\nfunction nextListOptions(\n options: NextOptions,\n extra: Partial<ListOptions>,\n): ListOptions {\n return {\n type: options.type,\n tag: options.tag,\n priority: options.priority,\n assignee: options.assignee,\n assigneeFilter: options.assigneeFilter,\n sprint: options.sprint,\n release: options.release,\n noTruncate: true,\n ...extra,\n };\n}\n\nfunction rankNextReadyEntries(\n ready: ActionableEntry[],\n childrenByParent: Map<string, ItemFrontMatter[]>,\n statusRegistry: RuntimeStatusRegistry,\n): ActionableEntry[] {\n return [...ready].sort((left, right) => {\n const leftCompletedContainer = hasCompletedDescendants(\n left.item,\n childrenByParent,\n );\n const rightCompletedContainer = hasCompletedDescendants(\n right.item,\n childrenByParent,\n );\n if (leftCompletedContainer !== rightCompletedContainer) {\n return Number(leftCompletedContainer) - Number(rightCompletedContainer);\n }\n return compareCriticalItems(left.item, right.item, statusRegistry);\n });\n}\n\nfunction buildNextRecommendation(params: {\n projectedReady: ActionableEntry[];\n readyRows: NextActionableItem[];\n statusRegistry: RuntimeStatusRegistry;\n now: string;\n completedContainer: boolean;\n}): NextRecommendation | null {\n if (params.projectedReady.length === 0) {\n return null;\n }\n return {\n ...params.readyRows[0],\n reasons: buildRecommendationReasons(\n params.projectedReady[0],\n params.statusRegistry,\n params.now,\n params.completedContainer,\n ),\n };\n}\n\nfunction buildNextSuggestions(\n recommended: NextRecommendation | null,\n blockedRows: NextActionableItem[],\n): string[] | undefined {\n if (recommended !== null) {\n return undefined;\n }\n if (blockedRows.length > 0) {\n const blockedWithReferences = blockedRows.find(\n (item) => item.blockers.length > 0,\n );\n return [\n blockedWithReferences\n ? `${blockedRows.length} item(s) are blocked; unblock the top one by closing ${blockedWithReferences.blockers.map((blocker) => blocker.id).join(\", \")}`\n : `${blockedRows.length} item(s) are blocked; add blocker context or move the top item back to an active status`,\n \"pm next --ready-only after a blocker closes to re-check ready work\",\n 'pm create --type Task --title \"...\" to add new ready work',\n ];\n }\n return [\n 'pm create --type Task --title \"...\" to add a new work item',\n \"pm list --status in_progress to review work already underway\",\n \"pm context --depth deep for the full project snapshot\",\n ];\n}\n\nfunction filterCandidatesByParentScope(\n candidates: ItemFrontMatter[],\n corpus: ItemFrontMatter[],\n parentScope: string,\n): ItemFrontMatter[] {\n if (!parentScope) {\n return candidates;\n }\n const subtree = collectSubtreeIds(corpus, parentScope);\n if (!subtree.found) {\n throw new PmCliError(\n `Next --parent item not found: ${parentScope}`,\n EXIT_CODE.NOT_FOUND,\n );\n }\n return candidates.filter((item) =>\n subtree.ids.has(item.id.trim().toLowerCase()),\n );\n}\n\nasync function rankReadyEntriesWithRelevance(\n rankedReady: ActionableEntry[],\n childrenByParent: Map<string, ItemFrontMatter[]>,\n statusRegistry: RuntimeStatusRegistry,\n now: string,\n): Promise<{\n projectedReady: ActionableEntry[];\n ranking: Awaited<\n ReturnType<\n typeof scoreContextCandidatesWithActiveExtensions<ItemFrontMatter>\n >\n >;\n completedContainer: boolean;\n}> {\n const concreteReady = rankedReady.filter(\n (entry) => !hasCompletedDescendants(entry.item, childrenByParent),\n );\n const structuralReady =\n concreteReady.length > 0 ? concreteReady : rankedReady;\n const ranking = await scoreContextCandidatesWithActiveExtensions(\n \"next\",\n buildItemContextRelevanceCandidates(\n structuralReady.map((entry) => entry.item),\n statusRegistry,\n now,\n process.env.PM_AUTHOR,\n ),\n );\n const readyById = new Map(\n structuralReady.map((entry) => [entry.item.id, entry]),\n );\n const projectedReady = ranking.ranked\n .map((entry) => readyById.get(entry.id))\n .filter((entry): entry is ActionableEntry => entry !== undefined);\n return {\n projectedReady,\n ranking,\n completedContainer: concreteReady.length === 0,\n };\n}\n\n/** Implements `pm next`: computes the ranked ready/blocked actionable queues and a single recommended next item with rationale for the public runtime surface. */\nexport async function runNext(\n options: NextOptions,\n global: GlobalOptions,\n): Promise<NextResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n const settings = await readSettings(pmRoot);\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const now = nowIso();\n const limit = parseNextLimit(options.limit, \"--limit\", DEFAULT_NEXT_LIMIT);\n const blockedLimit = parseNextLimit(\n options.blockedLimit,\n \"--blocked-limit\",\n limit,\n );\n const readyOnly = options.readyOnly === true;\n const parentScope =\n typeof options.parent === \"string\" ? options.parent.trim() : \"\";\n\n // Active (non-terminal) candidates honor the caller's filters; the corpus is the\n // FULL, UNFILTERED set (every status, every item) so blocker and descendant\n // resolution still sees items outside the caller's filters or --parent subtree —\n // otherwise a real blocker assigned to someone else (or a parent of a different\n // type) would be missing and the blocked item misread as ready.\n const candidatesList = await runList(\n undefined,\n nextListOptions(options, { excludeTerminal: true }),\n global,\n );\n const corpusList = await runList(\n undefined,\n { excludeTerminal: false, noTruncate: true },\n global,\n );\n const candidates = filterCandidatesByParentScope(\n candidatesList.items as ItemFrontMatter[],\n corpusList.items as ItemFrontMatter[],\n parentScope,\n );\n const corpus = corpusList.items as ItemFrontMatter[];\n\n const report = computeActionabilityReport(candidates, corpus, statusRegistry);\n const childrenByParent = buildChildrenByParent(corpus);\n const callerPartition = partitionCallerOwnedReady(\n report.ready,\n settings.author_default,\n options.callerAuthor,\n );\n const rankedReady = rankNextReadyEntries(\n callerPartition.available,\n childrenByParent,\n statusRegistry,\n );\n const rankedBlocked = [...report.blocked].sort((left, right) =>\n compareCriticalItems(left.item, right.item, statusRegistry),\n );\n const {\n projectedReady,\n ranking: readyRanking,\n completedContainer,\n } = await rankReadyEntriesWithRelevance(\n rankedReady,\n childrenByParent,\n statusRegistry,\n now,\n );\n\n const readyRows = projectedReady.map((entry) =>\n toNextActionableItem(entry, statusRegistry, childrenByParent),\n );\n const blockedRows = rankedBlocked.map((entry) =>\n toNextActionableItem(entry, statusRegistry, childrenByParent),\n );\n\n const recommended = buildNextRecommendation({\n projectedReady,\n readyRows,\n statusRegistry,\n now,\n completedContainer,\n });\n\n const result: NextResult = {\n output_default: \"toon\",\n now,\n recommended,\n ready: readyRows.slice(1, limit + 1),\n blocked: readyOnly ? [] : blockedRows.slice(0, blockedLimit),\n held_by_others: callerPartition.held,\n summary: {\n recommended: recommended !== null,\n ready: readyRows.length,\n blocked: blockedRows.length,\n in_progress: inProgressReadyCount(readyRows, statusRegistry),\n candidates: report.active_count,\n containers: report.container_count,\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 parent: parentScope.length > 0 ? parentScope : null,\n limit,\n blocked_limit: blockedLimit,\n ready_only: readyOnly,\n },\n };\n\n const warnings = [\n ...new Set([\n ...(candidatesList.warnings ?? []),\n ...(corpusList.warnings ?? []),\n ...(readyRanking.warnings ?? []),\n ]),\n ].sort((a, b) => a.localeCompare(b));\n if (warnings.length > 0) result.warnings = warnings;\n if (options.explainRanking === true)\n result.ranking = toContextRankingSummary(readyRanking);\n\n result.suggestions = buildNextSuggestions(recommended, blockedRows);\n\n return result;\n}\n\n/**\n * Renders a {@link NextResult} as compact agent-readable markdown: the\n * recommendation with its rationale, the ranked ready queue, and (unless\n * `--ready-only`) the blocked queue annotated with each item's open blockers.\n */\nexport function renderNextMarkdown(result: NextResult): string {\n const lines: string[] = [\"# pm next\", \"\"];\n lines.push(`- now: ${result.now}`);\n lines.push(\n `- ready: ${result.summary.ready} (in_progress: ${result.summary.in_progress}), blocked: ${result.summary.blocked}, candidates: ${result.summary.candidates}`,\n );\n if (result.filters.parent) {\n lines.push(`- scope: subtree of ${result.filters.parent}`);\n }\n lines.push(\"\");\n\n lines.push(\"## Recommended\");\n if (result.recommended) {\n lines.push(`- ${formatNextLine(result.recommended)}`);\n lines.push(` why: ${result.recommended.reasons.join(\"; \")}`);\n } else {\n lines.push(\"No ready work.\");\n }\n lines.push(\"\");\n\n lines.push(\"## Ready\");\n if (result.ready.length === 0) {\n lines.push(\"No ready items.\");\n } else {\n for (const item of result.ready) {\n lines.push(`- ${formatNextLine(item)}`);\n }\n }\n lines.push(\"\");\n\n if (!result.filters.ready_only) {\n lines.push(\"## Blocked\");\n if (result.blocked.length === 0) {\n lines.push(\"No blocked items.\");\n } else {\n for (const item of result.blocked) {\n const by = item.blockers\n .map((blocker) => `${blocker.id}(${blocker.status ?? \"?\"})`)\n .join(\", \");\n lines.push(`- ${formatNextLine(item)} blocked_by:${by}`);\n }\n }\n lines.push(\"\");\n }\n\n if (result.suggestions && result.suggestions.length > 0) {\n lines.push(\"## Suggestions\");\n for (const suggestion of result.suggestions) {\n lines.push(`- ${suggestion}`);\n }\n }\n\n return lines.join(\"\\n\").trimEnd();\n}\n\n// Formats a single actionable row: id, priority, status, type, deadline, parent,\n// downstream-unblock count, and title. Mirrors the context focus-line shape.\nfunction formatNextLine(item: NextActionableItem): string {\n const deadlineToken = item.deadline ?? \"-\";\n const parentToken = item.parent ? ` parent:${item.parent}` : \"\";\n const unblocksToken =\n item.unblocks.length > 0 ? ` unblocks:${item.unblocks.length}` : \"\";\n return `${item.id} p${item.priority} ${item.status} ${item.type} deadline:${deadlineToken}${parentToken}${unblocksToken} ${item.title}`;\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;;;AACH,OAAO,EACL,mBAAmB,EACnB,0BAA0B,GAE3B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,4BAA4B,GAE7B,MAAM,qCAAqC,CAA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
|
+
{"version":3,"file":"next.js","sources":["cli/commands/next.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module cli/commands/next\n *\n * Implements the `pm next` command: the distilled \"what should I work on now?\"\n * query. It loads the active corpus, computes dependency-aware actionability\n * (ready vs blocked leaf work), and returns a single ranked recommendation with a\n * deterministic rationale plus the ranked ready/blocked queues — so an agent gets\n * the next action and the reason for it in one token-efficient read instead of\n * re-deriving readiness from a full `pm context` snapshot every turn.\n */\nimport {\n collectBlockedByIds,\n computeActionabilityReport,\n type ActionableEntry,\n} from \"../../core/item/actionability.js\";\nimport {\n resolveRuntimeStatusRegistry,\n type RuntimeStatusRegistry,\n} from \"../../core/schema/runtime-schema.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\nimport {\n normalizeStatusInput,\n normalizeStatusForRegistry,\n} from \"../../core/item/status.js\";\nimport { resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport type { ItemFrontMatter, ItemStatus } from \"../../types/index.js\";\nimport { parseIntegerLimit } from \"../shared-parsers.js\";\nimport {\n buildChildrenByParent,\n buildItemContextRelevanceCandidates,\n collectSubtreeIds,\n compareCriticalItems,\n toContextRankingSummary,\n toContextFocusItem,\n type ContextFocusItem,\n type ContextRankingSummary,\n} from \"./context.js\";\nimport { runList, type ListOptions } from \"./list.js\";\nimport { scoreContextCandidatesWithActiveExtensions } from \"../../sdk/context-relevance.js\";\n\n/** Supported values accepted by the next output contract. */\nexport const NEXT_OUTPUT_VALUES = [\"markdown\", \"toon\", \"json\"] as const;\n/** Restricts `pm next` output format values accepted by command, SDK, and storage contracts. */\nexport type NextOutputFormat = (typeof NEXT_OUTPUT_VALUES)[number];\n\nconst DEFAULT_NEXT_LIMIT = 5;\nconst MS_PER_DAY = 24 * 60 * 60 * 1000;\n\n/** Documents the `pm next` options payload exchanged by command, SDK, and package integrations. */\nexport interface NextOptions {\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 | number;\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 parent for this contract. */\n parent?: string;\n /** Value that configures or reports limit for this contract. */\n limit?: string;\n /** Value that configures or reports blocked limit for this contract. */\n blockedLimit?: string;\n /** Value that configures or reports ready only for this contract. */\n readyOnly?: boolean;\n /** Value that configures or reports format for this contract. */\n format?: string;\n /** Value that configures or reports explain ranking for this contract. */\n explainRanking?: boolean;\n /** Include human-gated Decision items in the claimable ready queue. */\n includeDecisions?: boolean;\n /** Internal caller override used to align claim-next ranking with --author. */\n callerAuthor?: string;\n [key: string]: unknown;\n}\n\n/** A blocker reference projected onto the `pm next` output. */\nexport interface NextBlockerRef {\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 | null;\n /** Lifecycle state reported for status. */\n status: ItemStatus | null;\n}\n\n/**\n * A classified actionable item on the `pm next` output: a {@link ContextFocusItem}\n * focus row augmented with its open-blocker references and the downstream items it\n * would unblock.\n */\nexport interface NextActionableItem extends ContextFocusItem {\n /** One-based position in the complete ranked actionable queue. */\n rank: number;\n /** Number of open blocker entries represented by this result. */\n open_blocker_count: number;\n /** Value that configures or reports blockers for this contract. */\n blockers: NextBlockerRef[];\n /** Value that configures or reports unblocks for this contract. */\n unblocks: string[];\n}\n\n/** The single recommended next item: an actionable row plus its rationale. */\nexport interface NextRecommendation extends NextActionableItem {\n /** Value that configures or reports reasons for this contract. */\n reasons: string[];\n}\n\ninterface NextSummary {\n recommended: boolean;\n ready: number;\n blocked: number;\n in_progress: number;\n candidates: number;\n containers: number;\n}\n\n/** Documents the `pm next` result payload exchanged by command, SDK, and package integrations. */\nexport interface NextResult {\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 recommended for this contract. */\n recommended: NextRecommendation | null;\n /** Value that configures or reports ready for this contract. */\n ready: NextActionableItem[];\n /** Human-gated decisions kept visible without dispatching them to agents. */\n decision_needed: NextActionableItem[];\n /** Value that configures or reports blocked for this contract. */\n blocked: NextActionableItem[];\n /** Value that configures or reports held by others for this contract. */\n held_by_others: Array<{ id: string; assignee: string }>;\n /** Value that configures or reports summary for this contract. */\n summary: NextSummary;\n /** Value that configures or reports filters for this contract. */\n filters: {\n type: string | null;\n tag: string | null;\n priority: string | number | null;\n assignee: string | null;\n assignee_filter: string | null;\n sprint: string | null;\n release: string | null;\n parent: string | null;\n limit: number;\n blocked_limit: number;\n ready_only: boolean;\n include_decisions: boolean;\n };\n /** Value that configures or reports suggestions for this contract. */\n suggestions?: 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}\n\nfunction parseNextOutputFormat(\n raw: string | undefined,\n): NextOutputFormat | undefined {\n if (!raw) return undefined;\n const normalized = raw.trim().toLowerCase();\n if (!NEXT_OUTPUT_VALUES.includes(normalized as NextOutputFormat)) {\n throw new PmCliError(\n \"Next format must be one of markdown|toon|json\",\n EXIT_CODE.USAGE,\n );\n }\n return normalized as NextOutputFormat;\n}\n\n/** Resolves the effective `pm next` output format from the command `--format` flag and the global `--json` switch, rejecting the contradictory `--json --format markdown|toon` combination. Defaults to `toon`. */\nexport function resolveNextOutputFormat(\n options: NextOptions,\n global: GlobalOptions,\n): NextOutputFormat {\n const commandFormat = parseNextOutputFormat(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// Per-section row cap. A non-positive or absent value falls back to the default;\n// invalid (non-integer) values throw via parseIntegerLimit.\nfunction parseNextLimit(\n raw: string | undefined,\n flag: string,\n fallback: number,\n): number {\n const parsed = parseIntegerLimit(raw, flag);\n if (parsed === undefined || parsed <= 0) return fallback;\n return parsed;\n}\n\n// Projects an actionable entry onto its output row. Ready entries carry no\n// blockers; blocked entries surface their unresolved blockers for the agent.\nfunction toNextActionableItem(\n entry: ActionableEntry,\n statusRegistry: RuntimeStatusRegistry,\n childrenByParent: Map<string, ItemFrontMatter[]>,\n rank: number,\n): NextActionableItem {\n return {\n ...toContextFocusItem(entry.item, statusRegistry, childrenByParent),\n open_blocker_count: entry.open_blockers.length,\n blockers: entry.open_blockers.map((blocker) => ({\n id: blocker.id,\n title: blocker.title,\n status: blocker.status,\n })),\n unblocks: entry.unblocks,\n rank,\n };\n}\n\n// Builds the human+agent readable rationale for the recommended item, ordering\n// clauses from most to least decisive (status, priority, deadline, blocker\n// clearance, parent advancement, downstream unblocks).\nfunction buildRecommendationReasons(\n entry: ActionableEntry,\n statusRegistry: RuntimeStatusRegistry,\n now: string,\n completedContainer: boolean,\n): string[] {\n const item = entry.item;\n const reasons: string[] = [];\n const inProgressStatus = normalizeStatusInput(\"in_progress\", statusRegistry);\n reasons.push(\n normalizeStatusForRegistry(item.status, statusRegistry) === inProgressStatus\n ? \"in progress — resume to finish\"\n : \"open and ready to start\",\n );\n if (completedContainer) {\n reasons.push(\"completed container — governance closeout\");\n }\n reasons.push(\n `priority p${item.priority}${item.priority === 0 ? \" (highest)\" : \"\"}`,\n );\n if (typeof item.deadline === \"string\" && item.deadline.trim().length > 0) {\n reasons.push(describeDeadline(item.deadline, now));\n }\n reasons.push(\n collectBlockedByIds(item).length > 0\n ? \"all blockers resolved\"\n : \"no blockers\",\n );\n if (typeof item.parent === \"string\" && item.parent.trim().length > 0) {\n reasons.push(`advances ${item.parent.trim()}`);\n }\n if (entry.unblocks.length > 0) {\n reasons.push(\n `unblocks ${entry.unblocks.length} item(s): ${entry.unblocks.join(\", \")}`,\n );\n }\n return reasons;\n}\n\nfunction partitionCallerOwnedReady(\n ready: ActionableEntry[],\n fallbackAuthor: string,\n explicitAuthor?: string,\n): {\n available: ActionableEntry[];\n held: Array<{ id: string; assignee: string }>;\n} {\n const caller =\n (explicitAuthor ?? process.env.PM_AUTHOR ?? fallbackAuthor).trim() ||\n \"unknown\";\n const available: ActionableEntry[] = [];\n const held: Array<{ id: string; assignee: string }> = [];\n for (const entry of ready) {\n const assignee =\n typeof entry.item.assignee === \"string\" ? entry.item.assignee.trim() : \"\";\n const isForeignWork = assignee.length > 0 && assignee !== caller;\n if (isForeignWork) held.push({ id: entry.item.id, assignee });\n else available.push(entry);\n }\n return { available, held };\n}\n\n/** Test-only access to deterministic next-work partitioning edge cases. */\nexport const _testOnlyNextCommand = { partitionCallerOwnedReady };\n\n/** Separates human-gated decisions from autonomous agent work unless the caller explicitly opts into decision claims. */\nexport function partitionDecisionEntries(\n ready: ActionableEntry[],\n includeDecisions: boolean,\n): { agent: ActionableEntry[]; decisions: ActionableEntry[] } {\n const decisions = ready.filter(\n (entry) => entry.item.type.trim().toLowerCase() === \"decision\",\n );\n return {\n agent: includeDecisions\n ? ready\n : ready.filter(\n (entry) => entry.item.type.trim().toLowerCase() !== \"decision\",\n ),\n decisions: includeDecisions ? [] : decisions,\n };\n}\n\n// Renders a deadline as a date token plus a relative tag (overdue/today/in Nd).\n// The relative delta is computed on UTC calendar dates (both sides normalized to\n// midnight) so a deadline due today never reads as \"overdue 1d\" just because the\n// wall-clock time of `now` has passed midnight. Unparseable deadlines degrade to\n// the raw token (defensive — stored deadlines are always valid ISO).\nfunction describeDeadline(deadline: string, now: string): string {\n const deadlineMs = Date.parse(deadline);\n /* c8 ignore start -- defensive: a stored deadline that fails Date.parse still surfaces its raw token */\n if (!Number.isFinite(deadlineMs)) {\n return `deadline ${deadline.trim()}`;\n }\n /* c8 ignore stop */\n const dateToken = new Date(deadlineMs).toISOString().slice(0, 10);\n const nowToken = new Date(Date.parse(now)).toISOString().slice(0, 10);\n const days = Math.round(\n (Date.parse(dateToken) - Date.parse(nowToken)) / MS_PER_DAY,\n );\n if (days < 0) return `deadline ${dateToken} (overdue ${-days}d)`;\n if (days === 0) return `deadline ${dateToken} (due today)`;\n return `deadline ${dateToken} (in ${days}d)`;\n}\n\nfunction inProgressReadyCount(\n ready: NextActionableItem[],\n statusRegistry: RuntimeStatusRegistry,\n): number {\n const inProgressStatus = normalizeStatusInput(\"in_progress\", statusRegistry);\n return ready.filter(\n (item) =>\n normalizeStatusForRegistry(item.status, statusRegistry) ===\n inProgressStatus,\n ).length;\n}\n\n// Returns true when an otherwise-ready item still has terminal descendants. Such\n// rows are useful governance closeout context, but concrete leaf work should rank\n// ahead of them in the default agent loop.\nfunction hasCompletedDescendants(\n item: ItemFrontMatter,\n childrenByParent: Map<string, ItemFrontMatter[]>,\n): boolean {\n return (childrenByParent.get(item.id.trim().toLowerCase()) ?? []).length > 0;\n}\n\n// Strips projection/pagination flags so the corpus reads stay full: limits are\n// per-section display caps applied after classification, never corpus filters.\nfunction nextListOptions(\n options: NextOptions,\n extra: Partial<ListOptions>,\n): ListOptions {\n return {\n type: options.type,\n tag: options.tag,\n priority:\n typeof options.priority === \"number\"\n ? String(options.priority)\n : options.priority,\n assignee: options.assignee,\n assigneeFilter: options.assigneeFilter,\n sprint: options.sprint,\n release: options.release,\n noTruncate: true,\n ...extra,\n };\n}\n\nfunction rankNextReadyEntries(\n ready: ActionableEntry[],\n childrenByParent: Map<string, ItemFrontMatter[]>,\n statusRegistry: RuntimeStatusRegistry,\n): ActionableEntry[] {\n return [...ready].sort((left, right) => {\n const leftCompletedContainer = hasCompletedDescendants(\n left.item,\n childrenByParent,\n );\n const rightCompletedContainer = hasCompletedDescendants(\n right.item,\n childrenByParent,\n );\n if (leftCompletedContainer !== rightCompletedContainer) {\n return Number(leftCompletedContainer) - Number(rightCompletedContainer);\n }\n return compareCriticalItems(left.item, right.item, statusRegistry);\n });\n}\n\nfunction buildNextRecommendation(params: {\n projectedReady: ActionableEntry[];\n readyRows: NextActionableItem[];\n statusRegistry: RuntimeStatusRegistry;\n now: string;\n completedContainer: boolean;\n}): NextRecommendation | null {\n if (params.projectedReady.length === 0) {\n return null;\n }\n return {\n ...params.readyRows[0],\n reasons: buildRecommendationReasons(\n params.projectedReady[0],\n params.statusRegistry,\n params.now,\n params.completedContainer,\n ),\n };\n}\n\nfunction buildNextSuggestions(\n recommended: NextRecommendation | null,\n blockedRows: NextActionableItem[],\n): string[] | undefined {\n if (recommended !== null) {\n return undefined;\n }\n if (blockedRows.length > 0) {\n const blockedWithReferences = blockedRows.find(\n (item) => item.blockers.length > 0,\n );\n return [\n blockedWithReferences\n ? `${blockedRows.length} item(s) are blocked; unblock the top one by closing ${blockedWithReferences.blockers.map((blocker) => blocker.id).join(\", \")}`\n : `${blockedRows.length} item(s) are blocked; add blocker context or move the top item back to an active status`,\n \"pm next --ready-only after a blocker closes to re-check ready work\",\n 'pm create --type Task --title \"...\" to add new ready work',\n ];\n }\n return [\n 'pm create --type Task --title \"...\" to add a new work item',\n \"pm list --status in_progress to review work already underway\",\n \"pm context --depth deep for the full project snapshot\",\n ];\n}\n\nfunction filterCandidatesByParentScope(\n candidates: ItemFrontMatter[],\n corpus: ItemFrontMatter[],\n parentScope: string,\n): ItemFrontMatter[] {\n if (!parentScope) {\n return candidates;\n }\n const subtree = collectSubtreeIds(corpus, parentScope);\n if (!subtree.found) {\n throw new PmCliError(\n `Next --parent item not found: ${parentScope}`,\n EXIT_CODE.NOT_FOUND,\n );\n }\n return candidates.filter((item) =>\n subtree.ids.has(item.id.trim().toLowerCase()),\n );\n}\n\nasync function rankReadyEntriesWithRelevance(\n rankedReady: ActionableEntry[],\n childrenByParent: Map<string, ItemFrontMatter[]>,\n statusRegistry: RuntimeStatusRegistry,\n now: string,\n callerAuthor: string | undefined,\n): Promise<{\n projectedReady: ActionableEntry[];\n ranking: Awaited<\n ReturnType<\n typeof scoreContextCandidatesWithActiveExtensions<ItemFrontMatter>\n >\n >;\n completedContainer: boolean;\n}> {\n const concreteReady = rankedReady.filter(\n (entry) => !hasCompletedDescendants(entry.item, childrenByParent),\n );\n const structuralReady =\n concreteReady.length > 0 ? concreteReady : rankedReady;\n const ranking = await scoreContextCandidatesWithActiveExtensions(\n \"next\",\n buildItemContextRelevanceCandidates(\n structuralReady.map((entry) => entry.item),\n statusRegistry,\n now,\n callerAuthor ?? process.env.PM_AUTHOR,\n ),\n );\n const readyById = new Map(\n structuralReady.map((entry) => [entry.item.id, entry]),\n );\n const projectedReady = ranking.ranked\n .map((entry) => readyById.get(entry.id))\n .filter((entry): entry is ActionableEntry => entry !== undefined);\n return {\n projectedReady,\n ranking,\n completedContainer: concreteReady.length === 0,\n };\n}\n\n/** Implements `pm next`: computes the ranked ready/blocked actionable queues and a single recommended next item with rationale for the public runtime surface. */\nexport async function runNext(\n options: NextOptions,\n global: GlobalOptions,\n): Promise<NextResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n const settings = await readSettings(pmRoot);\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const now = nowIso();\n const limit = parseNextLimit(options.limit, \"--limit\", DEFAULT_NEXT_LIMIT);\n const blockedLimit = parseNextLimit(\n options.blockedLimit,\n \"--blocked-limit\",\n limit,\n );\n const readyOnly = options.readyOnly === true;\n const parentScope =\n typeof options.parent === \"string\" ? options.parent.trim() : \"\";\n\n // Active (non-terminal) candidates honor the caller's filters; the corpus is the\n // FULL, UNFILTERED set (every status, every item) so blocker and descendant\n // resolution still sees items outside the caller's filters or --parent subtree —\n // otherwise a real blocker assigned to someone else (or a parent of a different\n // type) would be missing and the blocked item misread as ready.\n const candidatesList = await runList(\n undefined,\n nextListOptions(options, { excludeTerminal: true }),\n global,\n );\n const corpusList = await runList(\n undefined,\n { excludeTerminal: false, noTruncate: true },\n global,\n );\n const candidates = filterCandidatesByParentScope(\n candidatesList.items as ItemFrontMatter[],\n corpusList.items as ItemFrontMatter[],\n parentScope,\n );\n const corpus = corpusList.items as ItemFrontMatter[];\n\n const report = computeActionabilityReport(candidates, corpus, statusRegistry);\n const childrenByParent = buildChildrenByParent(corpus);\n const partitionedByDecision = partitionDecisionEntries(\n report.ready,\n options.includeDecisions === true,\n );\n const callerPartition = partitionCallerOwnedReady(\n partitionedByDecision.agent,\n settings.author_default,\n options.callerAuthor,\n );\n const rankedReady = rankNextReadyEntries(\n callerPartition.available,\n childrenByParent,\n statusRegistry,\n );\n const rankedBlocked = [...report.blocked].sort((left, right) =>\n compareCriticalItems(left.item, right.item, statusRegistry),\n );\n const {\n projectedReady,\n ranking: readyRanking,\n completedContainer,\n } = await rankReadyEntriesWithRelevance(\n rankedReady,\n childrenByParent,\n statusRegistry,\n now,\n options.callerAuthor,\n );\n\n const readyRows = projectedReady.map((entry, index) =>\n toNextActionableItem(entry, statusRegistry, childrenByParent, index + 1),\n );\n const blockedRows = rankedBlocked.map((entry, index) =>\n toNextActionableItem(entry, statusRegistry, childrenByParent, index + 1),\n );\n const decisionRows = rankNextReadyEntries(\n partitionedByDecision.decisions,\n childrenByParent,\n statusRegistry,\n ).map((entry, index) =>\n toNextActionableItem(entry, statusRegistry, childrenByParent, index + 1),\n );\n\n const recommended = buildNextRecommendation({\n projectedReady,\n readyRows,\n statusRegistry,\n now,\n completedContainer,\n });\n\n const result: NextResult = {\n output_default: \"toon\",\n now,\n recommended,\n ready: readyRows.slice(1, limit + 1),\n decision_needed: decisionRows,\n blocked: readyOnly ? [] : blockedRows.slice(0, blockedLimit),\n held_by_others: callerPartition.held,\n summary: {\n recommended: recommended !== null,\n ready: readyRows.length,\n blocked: blockedRows.length,\n in_progress: inProgressReadyCount(readyRows, statusRegistry),\n candidates: report.active_count,\n containers: report.container_count,\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 parent: parentScope.length > 0 ? parentScope : null,\n limit,\n blocked_limit: blockedLimit,\n ready_only: readyOnly,\n include_decisions: options.includeDecisions === true,\n },\n };\n\n const warnings = [\n ...new Set([\n ...(candidatesList.warnings ?? []),\n ...(corpusList.warnings ?? []),\n ...(readyRanking.warnings ?? []),\n ]),\n ].sort((a, b) => a.localeCompare(b));\n if (warnings.length > 0) result.warnings = warnings;\n if (options.explainRanking === true)\n result.ranking = toContextRankingSummary(readyRanking);\n\n result.suggestions = buildNextSuggestions(recommended, blockedRows);\n\n return result;\n}\n\n/**\n * Renders a {@link NextResult} as compact agent-readable markdown: the\n * recommendation with its rationale, the ranked ready queue, and (unless\n * `--ready-only`) the blocked queue annotated with each item's open blockers.\n */\nexport function renderNextMarkdown(result: NextResult): string {\n const lines: string[] = [\"# pm next\", \"\"];\n lines.push(`- now: ${result.now}`);\n lines.push(\n `- ready: ${result.summary.ready} (in_progress: ${result.summary.in_progress}), blocked: ${result.summary.blocked}, candidates: ${result.summary.candidates}`,\n );\n if (result.filters.parent) {\n lines.push(`- scope: subtree of ${result.filters.parent}`);\n }\n lines.push(\"\");\n\n lines.push(\"## Recommended\");\n if (result.recommended) {\n lines.push(`- ${formatNextLine(result.recommended)}`);\n lines.push(` why: ${result.recommended.reasons.join(\"; \")}`);\n } else {\n lines.push(\"No ready work.\");\n }\n lines.push(\"\");\n\n lines.push(\"## Decision needed\");\n const decisionNeeded = result.decision_needed ?? [];\n if (decisionNeeded.length === 0) {\n lines.push(\"No human-gated decisions.\");\n } else {\n for (const item of decisionNeeded) lines.push(`- ${formatNextLine(item)}`);\n }\n lines.push(\"\");\n\n lines.push(\"## Ready\");\n if (result.ready.length === 0) {\n lines.push(\"No ready items.\");\n } else {\n for (const item of result.ready) {\n lines.push(`- ${formatNextLine(item)}`);\n }\n }\n lines.push(\"\");\n\n if (!result.filters.ready_only) {\n lines.push(\"## Blocked\");\n if (result.blocked.length === 0) {\n lines.push(\"No blocked items.\");\n } else {\n for (const item of result.blocked) {\n const by = item.blockers\n .map((blocker) => `${blocker.id}(${blocker.status ?? \"?\"})`)\n .join(\", \");\n lines.push(`- ${formatNextLine(item)} blocked_by:${by}`);\n }\n }\n lines.push(\"\");\n }\n\n if (result.suggestions && result.suggestions.length > 0) {\n lines.push(\"## Suggestions\");\n for (const suggestion of result.suggestions) {\n lines.push(`- ${suggestion}`);\n }\n }\n\n return lines.join(\"\\n\").trimEnd();\n}\n\n// Formats a single actionable row: id, priority, status, type, deadline, parent,\n// downstream-unblock count, and title. Mirrors the context focus-line shape.\nfunction formatNextLine(item: NextActionableItem): string {\n const deadlineToken = item.deadline ?? \"-\";\n const parentToken = item.parent ? ` parent:${item.parent}` : \"\";\n const unblocksToken =\n item.unblocks.length > 0 ? ` unblocks:${item.unblocks.length}` : \"\";\n const rankToken = Number.isInteger(item.rank) ? `#${item.rank} ` : \"\";\n return `${rankToken}${item.id} p${item.priority} ${item.status} ${item.type} deadline:${deadlineToken}${parentToken}${unblocksToken} ${item.title}`;\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;;;AACH,OAAO,EACL,mBAAmB,EACnB,0BAA0B,GAE3B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,4BAA4B,GAE7B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EACL,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD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C,QAAQ,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,IAAI,aAAa,aAAa,GAAG,WAAW,GAAG,aAAa,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;AACtJ,CAAC","debugId":"36ef6d7f-a1ec-5dd9-a3df-9ff03156dc87"}
|
|
@@ -108,6 +108,8 @@ export interface PlanCommandOptions {
|
|
|
108
108
|
materializeParent?: string;
|
|
109
109
|
/** Value that configures or reports materialize tags for this contract. */
|
|
110
110
|
materializeTags?: string;
|
|
111
|
+
/** Custom field values forwarded to every materialized item as `name=value` pairs. */
|
|
112
|
+
field?: string | string[];
|
|
111
113
|
/** Value that configures or reports author for this contract. */
|
|
112
114
|
author?: string;
|
|
113
115
|
/** Human-readable explanation suitable for logs and agent-facing output. */
|
|
@@ -130,7 +132,10 @@ export interface PlanCommandResult {
|
|
|
130
132
|
/** Value that configures or reports materialized for this contract. */
|
|
131
133
|
materialized?: {
|
|
132
134
|
id: string;
|
|
135
|
+
title: string;
|
|
133
136
|
type: string;
|
|
137
|
+
parent?: string;
|
|
138
|
+
tags: string[];
|
|
134
139
|
from_step: string;
|
|
135
140
|
}[];
|
|
136
141
|
/** Value that configures or reports materialize skipped for this contract. */
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Implements the pm plan command surface and its agent-facing runtime behavior.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
7
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="5ec672ec-6e36-5040-aa20-ef02ed65ee3a")}catch(e){}}();
|
|
8
8
|
import { pathExists } from "../../core/fs/fs-utils.js";
|
|
9
9
|
import { getActiveExtensionRegistrations } from "../../core/extensions/index.js";
|
|
10
10
|
import { resolveItemTypeRegistry, resolveTypeName, } from "../../core/item/type-registry.js";
|
|
@@ -1330,8 +1330,47 @@ function buildMaterializeDependencies(parent, planItemId, step) {
|
|
|
1330
1330
|
}
|
|
1331
1331
|
async function createMaterializedStepItems(params) {
|
|
1332
1332
|
const materialized = [];
|
|
1333
|
+
const materializeFields = {};
|
|
1334
|
+
const reservedMaterializeKeys = new Set([
|
|
1335
|
+
"title",
|
|
1336
|
+
"description",
|
|
1337
|
+
"type",
|
|
1338
|
+
"parent",
|
|
1339
|
+
"tags",
|
|
1340
|
+
"author",
|
|
1341
|
+
"message",
|
|
1342
|
+
"dep",
|
|
1343
|
+
]);
|
|
1344
|
+
for (const specification of toSpecArray(params.options.field)) {
|
|
1345
|
+
const separator = specification.indexOf("=");
|
|
1346
|
+
if (separator <= 0) {
|
|
1347
|
+
throw new PmCliError(`Invalid --field entry "${specification}"; expected name=value`, EXIT_CODE.USAGE);
|
|
1348
|
+
}
|
|
1349
|
+
const name = specification.slice(0, separator).trim();
|
|
1350
|
+
const value = specification.slice(separator + 1).trim();
|
|
1351
|
+
if (name.length === 0) {
|
|
1352
|
+
throw new PmCliError(`Invalid --field entry "${specification}"; expected name=value`, EXIT_CODE.USAGE);
|
|
1353
|
+
}
|
|
1354
|
+
const segments = name
|
|
1355
|
+
.trim()
|
|
1356
|
+
.replaceAll(/([a-z0-9])([A-Z])/g, "$1 $2")
|
|
1357
|
+
.replaceAll(/[^A-Za-z0-9]+/g, " ")
|
|
1358
|
+
.split(/\s+/)
|
|
1359
|
+
.filter(Boolean)
|
|
1360
|
+
.map((segment) => segment.toLowerCase());
|
|
1361
|
+
if (segments.length === 0) {
|
|
1362
|
+
throw new PmCliError(`Invalid --field entry "${specification}"; expected name=value`, EXIT_CODE.USAGE);
|
|
1363
|
+
}
|
|
1364
|
+
const [first, ...rest] = segments;
|
|
1365
|
+
const fieldKey = `${first}${rest.map((segment) => `${segment.slice(0, 1).toUpperCase()}${segment.slice(1)}`).join("")}`;
|
|
1366
|
+
if (reservedMaterializeKeys.has(fieldKey)) {
|
|
1367
|
+
throw new PmCliError(`Invalid --field entry "${specification}"; "${fieldKey}" is reserved by materialize and cannot be overridden`, EXIT_CODE.USAGE);
|
|
1368
|
+
}
|
|
1369
|
+
materializeFields[fieldKey] = value;
|
|
1370
|
+
}
|
|
1333
1371
|
for (const step of params.targets) {
|
|
1334
1372
|
const created = await runCreate({
|
|
1373
|
+
...materializeFields,
|
|
1335
1374
|
title: step.title,
|
|
1336
1375
|
description: step.body?.trim() || step.title,
|
|
1337
1376
|
type: params.resolvedTypeName,
|
|
@@ -1344,7 +1383,10 @@ async function createMaterializedStepItems(params) {
|
|
|
1344
1383
|
}, { ...{}, path: params.pmRoot });
|
|
1345
1384
|
materialized.push({
|
|
1346
1385
|
id: created.item.id,
|
|
1386
|
+
title: created.item.title,
|
|
1347
1387
|
type: params.resolvedTypeName,
|
|
1388
|
+
parent: created.item.parent,
|
|
1389
|
+
tags: created.item.tags ?? [],
|
|
1348
1390
|
from_step: step.id,
|
|
1349
1391
|
});
|
|
1350
1392
|
}
|
|
@@ -1525,4 +1567,4 @@ export async function runPlan(input) {
|
|
|
1525
1567
|
return resolvePlanDispatcher(normalizedInput.subcommand)(normalizedInput, ctx);
|
|
1526
1568
|
}
|
|
1527
1569
|
//# sourceMappingURL=plan.js.map
|
|
1528
|
-
//# debugId=
|
|
1570
|
+
//# debugId=5ec672ec-6e36-5040-aa20-ef02ed65ee3a
|