@unbrained/pm-cli 2026.7.18 → 2026.7.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +17 -0
- package/dist/cli/commands/claim.js +6 -4
- package/dist/cli/commands/claim.js.map +1 -1
- package/dist/cli/commands/comments.js +5 -2
- package/dist/cli/commands/comments.js.map +1 -1
- package/dist/cli/commands/context.d.ts +10 -1
- package/dist/cli/commands/context.js +44 -6
- package/dist/cli/commands/context.js.map +1 -1
- package/dist/cli/commands/create.js +15 -4
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/next.js +13 -3
- package/dist/cli/commands/next.js.map +1 -1
- package/dist/cli/commands/update.js +14 -3
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/error-guidance.js +23 -4
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/extension-command-help.d.ts +11 -0
- package/dist/cli/extension-command-help.js +62 -2
- package/dist/cli/extension-command-help.js.map +1 -1
- package/dist/cli/main.d.ts +1 -0
- package/dist/cli/main.js +16 -11
- package/dist/cli/main.js.map +1 -1
- package/dist/cli-bundle/bundle-manifest.json +326 -350
- package/dist/cli-bundle/chunks/{append-5YF3TO7I.js → append-MBXHNWSX.js} +5 -5
- package/dist/cli-bundle/chunks/append-XUYF7NON.js +11 -0
- package/dist/cli-bundle/chunks/{chunk-BIRYX32V.js → chunk-2UCG5H6B.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-VE6ZSTQW.js → chunk-2XPDCXK5.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-I3INI567.js → chunk-3EZZTFL2.js} +909 -124
- package/dist/cli-bundle/chunks/chunk-3EZZTFL2.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-GLZKZON6.js → chunk-3HSRP6T2.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-XWBD6DSR.js → chunk-3KPNOZOH.js} +23 -23
- package/dist/cli-bundle/chunks/{chunk-MR4SHYR4.js → chunk-3QNUDDY2.js} +104 -23
- package/dist/cli-bundle/chunks/chunk-3QNUDDY2.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-SIPOACV5.js → chunk-46Z6FAVP.js} +888 -124
- package/dist/cli-bundle/chunks/chunk-46Z6FAVP.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-HO4DLBNK.js → chunk-4M6RZJXF.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-RXPQ5Q23.js → chunk-4PSJVGRE.js} +11 -11
- package/dist/cli-bundle/chunks/{chunk-ADXDCAKP.js → chunk-5S6IZXK7.js} +146 -32
- package/dist/cli-bundle/chunks/{chunk-IL5SPRMH.js.map → chunk-5S6IZXK7.js.map} +7 -1
- package/dist/cli-bundle/chunks/chunk-66SRNEBK.js +143 -0
- package/dist/cli-bundle/chunks/chunk-66SRNEBK.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-YFE7JHX3.js → chunk-6BNV3G6C.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-43UMFKCK.js → chunk-6V4T4RD3.js} +23 -23
- package/dist/cli-bundle/chunks/chunk-77XFQRTD.js +140 -0
- package/dist/cli-bundle/chunks/chunk-77XFQRTD.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-EHJFUOXL.js → chunk-7B7IHMLH.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-I7DIDUSP.js → chunk-7CHWLT2J.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-L6FVNR7X.js → chunk-A3GAQLBH.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-B57RJHBZ.js → chunk-A4FVWFZY.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-D52ZN3BF.js → chunk-A5EQPNV7.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-TZAE66GQ.js → chunk-AGEBQRBG.js} +15 -15
- package/dist/cli-bundle/chunks/{chunk-WU3KAN6A.js → chunk-AQUNTB7G.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-OGVTB5VO.js → chunk-AR24KW26.js} +237 -36
- package/dist/cli-bundle/chunks/chunk-AR24KW26.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-XWYQ2LT4.js → chunk-BBGR4FKQ.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-HTXXXF45.js → chunk-BDC4TW4B.js} +98 -24
- package/dist/cli-bundle/chunks/chunk-BDC4TW4B.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2FUOXSRN.js → chunk-BFJP4VYC.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-633PKXLT.js → chunk-BZKE2O5V.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-XPUTSGJU.js → chunk-CZA2DXCV.js} +230 -36
- package/dist/cli-bundle/chunks/chunk-CZA2DXCV.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-KX62NMZC.js → chunk-D35WYXWC.js} +626 -5
- package/dist/cli-bundle/chunks/chunk-D35WYXWC.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-DOASIOQR.js +289 -0
- package/dist/cli-bundle/chunks/chunk-DOASIOQR.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-L337QKWJ.js → chunk-DUDLSQFG.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-BVLOMU6O.js → chunk-E7KBMWEF.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3QDR6ZLU.js → chunk-EAV3P54W.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-3QDR6ZLU.js.map → chunk-EAV3P54W.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WQXRZMFN.js → chunk-EEECAV5M.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-35FHWD4C.js → chunk-EI3UIMZM.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-RGMWJLXF.js → chunk-EVAN5VJA.js} +8 -5
- package/dist/cli-bundle/chunks/{chunk-RGMWJLXF.js.map → chunk-EVAN5VJA.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-PT7MCCGD.js → chunk-FIUTBFC6.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-7H5NNCJ5.js → chunk-FQF6VVPH.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-6DYOZS6C.js → chunk-FQO5THHM.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-5HGZKQUL.js → chunk-FQODDTE7.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-67RO3H4N.js → chunk-G33XIMRT.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-D53RTYVI.js → chunk-GFZB5CLP.js} +20 -10
- package/dist/cli-bundle/chunks/chunk-GFZB5CLP.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-QWBKN3QC.js → chunk-GKCEEXMA.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-DG2EQRIH.js → chunk-GRDK25BN.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-FXFCFL73.js → chunk-H3YKUVDR.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-IL5SPRMH.js → chunk-IEMXESIS.js} +123 -16
- package/dist/cli-bundle/chunks/chunk-IEMXESIS.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ARGDWQ4J.js → chunk-IGBBTPM5.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-QPGQNLPI.js → chunk-IR3GOO6E.js} +3842 -4109
- package/dist/cli-bundle/chunks/chunk-IR3GOO6E.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-FY4RLHSC.js → chunk-IRJ6F23W.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-66MKH7SZ.js → chunk-IXG5CMBR.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-F3VC3GOV.js → chunk-JBW2S2C6.js} +2090 -253
- package/dist/cli-bundle/chunks/chunk-JBW2S2C6.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-7UCY6DR5.js → chunk-JPWUZOMR.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-FVNWHUME.js → chunk-K2L6FZBX.js} +8 -8
- package/dist/cli-bundle/chunks/chunk-KGPLSHJD.js +286 -0
- package/dist/cli-bundle/chunks/chunk-KGPLSHJD.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-YQEZWI3R.js → chunk-KZ5AC6B5.js} +5 -3
- package/dist/cli-bundle/chunks/chunk-KZ5AC6B5.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-X2MGQMZO.js → chunk-LT5UWU7H.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-KH6QAHME.js → chunk-M4B4RK4J.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-QRZNCRNA.js → chunk-MI3346YW.js} +377 -240
- package/dist/cli-bundle/chunks/chunk-MI3346YW.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2XOSFSTH.js → chunk-MQOSMBWV.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-YIIIAKCE.js → chunk-MRXAHR4B.js} +28 -22
- package/dist/cli-bundle/chunks/chunk-MRXAHR4B.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-7R6UIHYY.js → chunk-N2TEEOXJ.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-NTRQLE2R.js → chunk-N7FCFJ76.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-37DRDP2B.js → chunk-NPEYH6CE.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-GKPCTQYG.js → chunk-NTS2RKHN.js} +3942 -4216
- package/dist/cli-bundle/chunks/chunk-NTS2RKHN.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-6VHUGVNP.js → chunk-ODEIDKGW.js} +2062 -246
- package/dist/cli-bundle/chunks/chunk-ODEIDKGW.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2CXL335K.js → chunk-OK7VSX3N.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-NNANAWFH.js → chunk-OKPZDH43.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-G6MYGULG.js → chunk-OKWJUL6F.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-HPAYDSR2.js → chunk-P24ZU5QV.js} +27 -21
- package/dist/cli-bundle/chunks/chunk-P24ZU5QV.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-TGBTLGPX.js → chunk-Q4PSG2GV.js} +13 -4
- package/dist/cli-bundle/chunks/{chunk-TGBTLGPX.js.map → chunk-Q4PSG2GV.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-5UKQLQM2.js → chunk-Q5NHJ6RO.js} +6 -4
- package/dist/cli-bundle/chunks/chunk-Q5NHJ6RO.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-D5XHO4Q7.js → chunk-Q6JPYR7I.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-P22HGFFI.js → chunk-QFG4MB7P.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-P22HGFFI.js.map → chunk-QFG4MB7P.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-IE5KRAKN.js → chunk-QQ77W23U.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-M7MVOKVV.js → chunk-QYGK2XQ3.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-646MQXFW.js → chunk-RLLOZAM2.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-646MQXFW.js.map → chunk-RLLOZAM2.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-X5YCTFKT.js → chunk-RWAIRGBC.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-W5E2UUSH.js → chunk-RX53WHFI.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-R5XTTZSJ.js → chunk-SBW7EQC4.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-TM5CIO3F.js → chunk-SGJB6PXA.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-DDFGYUCQ.js → chunk-STBCBDKF.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-EX7OQT3Y.js → chunk-SUNZKVAH.js} +10 -10
- package/dist/cli-bundle/chunks/{chunk-EX7OQT3Y.js.map → chunk-SUNZKVAH.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-FHOBCGQO.js → chunk-SVAWG7EE.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-6O44IN44.js → chunk-T6MOTLOJ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-HSYV4ZYT.js → chunk-TELI67UP.js} +9 -6
- package/dist/cli-bundle/chunks/{chunk-HSYV4ZYT.js.map → chunk-TELI67UP.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-EWIT5WIC.js → chunk-U6RYD446.js} +11 -11
- package/dist/cli-bundle/chunks/{chunk-E4FXM2XB.js → chunk-UE7LK3RE.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-N33FD2UI.js → chunk-UNNCT5QY.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-2IPNL3DR.js → chunk-UOIFZ66L.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-LSOWTLEM.js → chunk-UU6EP25G.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-HYTOJW2Q.js → chunk-UW6HCMP2.js} +15 -15
- package/dist/cli-bundle/chunks/{chunk-47HXN6RX.js → chunk-UWAQI3B7.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-YKFHF37B.js → chunk-V4QHAMI5.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-VAHZIPWS.js → chunk-VA3H7VVC.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-XC2HEEOV.js → chunk-VFA5EIEN.js} +21 -11
- package/dist/cli-bundle/chunks/chunk-VFA5EIEN.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-TLWJP5BF.js → chunk-VQOG2ETB.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-H5IOT54C.js → chunk-VSQE43NO.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-BDA35QG5.js → chunk-W6IEJXNC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WACRQ26A.js → chunk-WCBB6VI3.js} +637 -9
- package/dist/cli-bundle/chunks/chunk-WCBB6VI3.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-OWP6QFBV.js → chunk-XDWXPG2E.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-CKX4WOPC.js → chunk-XKVHL3MB.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WL3SS45P.js → chunk-XVB6BATY.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-NVZ6NVHJ.js → chunk-XXWDEQ6O.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-ILVOOAT4.js → chunk-Y2VSGFT4.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-NCVT6XEL.js → chunk-YG56M3NE.js} +11 -11
- package/dist/cli-bundle/chunks/{chunk-AFGKSHAM.js → chunk-YGEA4CLH.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-AXRT7K5V.js → chunk-YIC5NGXF.js} +11 -11
- package/dist/cli-bundle/chunks/{chunk-DHNG452T.js → chunk-ZF52NVRT.js} +396 -245
- package/dist/cli-bundle/chunks/chunk-ZF52NVRT.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-XXLXJL7V.js → chunk-ZUCBPXNA.js} +4 -4
- package/dist/cli-bundle/chunks/{close-X3CF6FQP.js → close-7NWA3GLA.js} +5 -5
- package/dist/cli-bundle/chunks/close-ZZCDDWJT.js +12 -0
- package/dist/cli-bundle/chunks/close-many-QCZHFCON.js +23 -0
- package/dist/cli-bundle/chunks/{close-many-J7A5EHOQ.js → close-many-YALQ7AXS.js} +14 -14
- package/dist/cli-bundle/chunks/comments-FMQNYPSZ.js +13 -0
- package/dist/cli-bundle/chunks/{comments-TMHMALA5.js → comments-SQIQ5WYR.js} +7 -7
- package/dist/cli-bundle/chunks/copy-GI3RCVZP.js +9 -0
- package/dist/cli-bundle/chunks/{copy-FWQA5OU4.js → copy-YDAMENCP.js} +4 -4
- package/dist/cli-bundle/chunks/{create-AQ5SIGZC.js → create-JSL6CXU3.js} +11 -9
- package/dist/cli-bundle/chunks/create-LXMLYJNM.js +29 -0
- package/dist/cli-bundle/chunks/delete-5DFAXJNI.js +10 -0
- package/dist/cli-bundle/chunks/{delete-YYYFOSEA.js → delete-IGVOZEU2.js} +4 -4
- package/dist/cli-bundle/chunks/{deps-NIIKXLPB.js → deps-BQAXUQAK.js} +6 -6
- package/dist/cli-bundle/chunks/{deps-MQ4ZIGZB.js → deps-CBPPSS6J.js} +6 -6
- package/dist/cli-bundle/chunks/docs-KCWPLQOV.js +14 -0
- package/dist/cli-bundle/chunks/{docs-53NUGMIQ.js → docs-NS2AZWCN.js} +7 -7
- package/dist/cli-bundle/chunks/{files-3PXGXYDB.js → files-PVWEPT5J.js} +7 -7
- package/dist/cli-bundle/chunks/{files-EGLKHD7O.js → files-XUUBQ76I.js} +7 -7
- package/dist/cli-bundle/chunks/focus-3EJVFI3D.js +10 -0
- package/dist/cli-bundle/chunks/{focus-SRPASFTN.js → focus-DHBHKK3E.js} +5 -5
- package/dist/cli-bundle/chunks/{history-compact-G4DULDCX.js → history-compact-3TNPYVFG.js} +6 -6
- package/dist/cli-bundle/chunks/history-compact-JHYVDYLW.js +16 -0
- package/dist/cli-bundle/chunks/{history-redact-IUSJ6X3E.js → history-redact-ELRL73XN.js} +4 -4
- package/dist/cli-bundle/chunks/{history-redact-THHGRQXV.js → history-redact-KKFDICCF.js} +4 -4
- package/dist/cli-bundle/chunks/{history-repair-LUQWRS7X.js → history-repair-J7WKZFAG.js} +6 -6
- package/dist/cli-bundle/chunks/history-repair-REMI7DDI.js +16 -0
- package/dist/cli-bundle/chunks/learnings-O6V5WDCV.js +13 -0
- package/dist/cli-bundle/chunks/{learnings-2MRNBFJF.js → learnings-X4D6JCCG.js} +7 -7
- package/dist/cli-bundle/chunks/{notes-73JWKWUD.js → notes-UQC6VS6N.js} +7 -7
- package/dist/cli-bundle/chunks/notes-ZSZREWZA.js +13 -0
- package/dist/cli-bundle/chunks/{plan-AZPMCG37.js → plan-5GKRBJJO.js} +12 -10
- package/dist/cli-bundle/chunks/plan-EZW2YDDY.js +26 -0
- package/dist/cli-bundle/chunks/{profile-AVCIIZID.js → profile-5PQAPCLF.js} +10 -10
- package/dist/cli-bundle/chunks/{profile-LFYO3HHX.js → profile-CW4BD3FO.js} +10 -10
- package/dist/cli-bundle/chunks/{register-list-query-UKMF55FT.js → register-list-query-HTDQE6VI.js} +24 -24
- package/dist/cli-bundle/chunks/{register-list-query-MZUF2EEC.js → register-list-query-PHIPDFP2.js} +24 -24
- package/dist/cli-bundle/chunks/{register-mutation-T6RVNJC4.js → register-mutation-BLEWM5I6.js} +32 -32
- package/dist/cli-bundle/chunks/{register-mutation-2PBW2GEX.js → register-mutation-OTYHR7J6.js} +32 -32
- package/dist/cli-bundle/chunks/{register-operations-KHZYR6MG.js → register-operations-AMCUFYEW.js} +38 -40
- package/dist/cli-bundle/chunks/{register-operations-KHZYR6MG.js.map → register-operations-AMCUFYEW.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-operations-WPQ2LWZJ.js → register-operations-MRLHOZYR.js} +36 -38
- package/dist/cli-bundle/chunks/{register-operations-WPQ2LWZJ.js.map → register-operations-MRLHOZYR.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-setup-PGDNOXDQ.js → register-setup-N2FOSWAG.js} +15 -17
- package/dist/cli-bundle/chunks/{register-setup-PGDNOXDQ.js.map → register-setup-N2FOSWAG.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-setup-TDN7WAO6.js → register-setup-ZVKTDL4G.js} +17 -19
- package/dist/cli-bundle/chunks/{register-setup-TDN7WAO6.js.map → register-setup-ZVKTDL4G.js.map} +1 -1
- package/dist/cli-bundle/chunks/restore-A55MLFAI.js +14 -0
- package/dist/cli-bundle/chunks/{restore-E3PRGDN3.js → restore-HEQAG6EK.js} +6 -6
- package/dist/cli-bundle/chunks/{schema-5JNFQFUW.js → schema-MAXAIHEC.js} +6 -6
- package/dist/cli-bundle/chunks/{schema-TMIW4XZC.js → schema-Q5DAWJ2S.js} +6 -6
- package/dist/cli-bundle/chunks/update-5DTSCWVF.js +23 -0
- package/dist/cli-bundle/chunks/{update-SQYZA3ZW.js → update-DWFXXJKP.js} +15 -13
- package/dist/cli-bundle/chunks/update-many-6T4ZLZS7.js +34 -0
- package/dist/cli-bundle/chunks/update-many-MYRK6VBJ.js +38 -0
- package/dist/cli-bundle/main.js +152 -29
- package/dist/cli-bundle/main.js.map +3 -3
- package/dist/cli-bundle/sdk-runtime.js +72 -75
- package/dist/cli-bundle/sdk-testing.js +8 -8
- package/dist/cli-bundle/sdk.js +288 -642
- package/dist/cli-bundle/sdk.js.map +4 -4
- package/dist/core/extensions/activation-summary.d.ts +2 -0
- package/dist/core/extensions/activation-summary.js +7 -2
- package/dist/core/extensions/activation-summary.js.map +1 -1
- package/dist/core/extensions/capability-usage.d.ts +1 -1
- package/dist/core/extensions/capability-usage.js +5 -2
- package/dist/core/extensions/capability-usage.js.map +1 -1
- package/dist/core/extensions/extension-hook-runtime.js +3 -2
- package/dist/core/extensions/extension-hook-runtime.js.map +1 -1
- package/dist/core/extensions/extension-registries.js +3 -2
- package/dist/core/extensions/extension-registries.js.map +1 -1
- package/dist/core/extensions/extension-types.d.ts +38 -1
- package/dist/core/extensions/extension-types.js +3 -2
- package/dist/core/extensions/extension-types.js.map +1 -1
- package/dist/core/extensions/loader.js +36 -2
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/store/item-store.d.ts +4 -1
- package/dist/core/store/item-store.js +3 -3
- package/dist/core/store/item-store.js.map +1 -1
- package/dist/core/store/paths.d.ts +2 -0
- package/dist/core/store/paths.js +26 -3
- package/dist/core/store/paths.js.map +1 -1
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +1 -1
- package/dist/sdk/compose.d.ts +3 -0
- package/dist/sdk/compose.js +14 -2
- package/dist/sdk/compose.js.map +1 -1
- package/dist/sdk/dependencies.js +3 -3
- package/dist/sdk/dependencies.js.map +1 -1
- package/dist/sdk/extension-command-context.d.ts +10 -0
- package/dist/sdk/extension-command-context.js +30 -0
- package/dist/sdk/extension-command-context.js.map +1 -0
- package/dist/sdk/graph/assembly.js +14 -4
- package/dist/sdk/graph/assembly.js.map +1 -1
- package/dist/sdk/graph/index.d.ts +1 -0
- package/dist/sdk/graph/index.js +3 -2
- package/dist/sdk/graph/index.js.map +1 -1
- package/dist/sdk/graph/mutation-advisory.d.ts +20 -0
- package/dist/sdk/graph/mutation-advisory.js +80 -0
- package/dist/sdk/graph/mutation-advisory.js.map +1 -0
- package/dist/sdk/graph/run.d.ts +5 -1
- package/dist/sdk/graph/run.js +11 -3
- package/dist/sdk/graph/run.js.map +1 -1
- package/dist/sdk/index.d.ts +4 -1
- package/dist/sdk/index.js +5 -2
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/ownership-source.d.ts +2 -0
- package/dist/sdk/ownership-source.js +22 -0
- package/dist/sdk/ownership-source.js.map +1 -0
- package/dist/sdk/relationship-history.d.ts +38 -0
- package/dist/sdk/relationship-history.js +60 -2
- package/dist/sdk/relationship-history.js.map +1 -1
- package/dist/sdk/relationships.js +49 -8
- package/dist/sdk/relationships.js.map +1 -1
- package/dist/sdk/runtime-input.js +3 -2
- package/dist/sdk/runtime-input.js.map +1 -1
- package/dist/sdk/runtime.d.ts +2 -0
- package/dist/sdk/runtime.js +19 -2
- package/dist/sdk/runtime.js.map +1 -1
- package/dist/sdk/tracker-root-discovery.d.ts +6 -0
- package/dist/sdk/tracker-root-discovery.js +10 -0
- package/dist/sdk/tracker-root-discovery.js.map +1 -0
- package/dist/sdk/workspace-transaction.d.ts +83 -0
- package/dist/sdk/workspace-transaction.js +364 -0
- package/dist/sdk/workspace-transaction.js.map +1 -0
- package/docs/AGENT_UX_CONTRACTS.md +41 -0
- package/docs/EXTENSIONS.md +4 -4
- package/docs/README.md +1 -0
- package/docs/SDK.md +102 -1
- package/marketplace.json +2 -2
- package/package.json +1 -1
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/GAP_REPORT.md +31 -0
- package/packages/pm-vcs/README.md +62 -0
- package/packages/pm-vcs/extensions/vcs/index.ts +745 -0
- package/packages/pm-vcs/extensions/vcs/manifest.json +19 -0
- package/packages/pm-vcs/extensions/vcs/package.json +3 -0
- package/packages/pm-vcs/package.json +55 -0
- 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-JHO5K6RP.js +0 -11
- package/dist/cli-bundle/chunks/chunk-2BX74BAS.js +0 -125
- package/dist/cli-bundle/chunks/chunk-2BX74BAS.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-3CUQZNQ6.js +0 -672
- package/dist/cli-bundle/chunks/chunk-3CUQZNQ6.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5UKQLQM2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-6VHUGVNP.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-74FKFFXO.js +0 -172
- package/dist/cli-bundle/chunks/chunk-74FKFFXO.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-ADXDCAKP.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-BAP7G3N2.js +0 -178
- package/dist/cli-bundle/chunks/chunk-BAP7G3N2.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-D53RTYVI.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-DHNG452T.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-EY7ZE3TG.js +0 -1831
- package/dist/cli-bundle/chunks/chunk-EY7ZE3TG.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-F3VC3GOV.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-FL4D53ND.js +0 -162
- package/dist/cli-bundle/chunks/chunk-FL4D53ND.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-GKPCTQYG.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-HPAYDSR2.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-HTXXXF45.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-I3INI567.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-KX62NMZC.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-L5BTTDU5.js +0 -662
- package/dist/cli-bundle/chunks/chunk-L5BTTDU5.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-MR4SHYR4.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-OGVTB5VO.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-QPGQNLPI.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-QRZNCRNA.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-RC4UOUXA.js +0 -122
- package/dist/cli-bundle/chunks/chunk-RC4UOUXA.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-RTBX3C4C.js +0 -1841
- package/dist/cli-bundle/chunks/chunk-RTBX3C4C.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-SIPOACV5.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-WACRQ26A.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-XC2HEEOV.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-XPUTSGJU.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-YIIIAKCE.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-YJSURTBB.js +0 -175
- package/dist/cli-bundle/chunks/chunk-YJSURTBB.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-YQEZWI3R.js.map +0 -7
- package/dist/cli-bundle/chunks/close-GPD7DTJV.js +0 -12
- package/dist/cli-bundle/chunks/close-many-NQLYGPYW.js +0 -23
- package/dist/cli-bundle/chunks/comments-2AOZQ5D2.js +0 -13
- package/dist/cli-bundle/chunks/copy-N3LCQBMC.js +0 -9
- package/dist/cli-bundle/chunks/create-KOGQ3JKD.js +0 -27
- package/dist/cli-bundle/chunks/delete-6G3MBZ6S.js +0 -10
- package/dist/cli-bundle/chunks/docs-OWRGDMNY.js +0 -14
- package/dist/cli-bundle/chunks/focus-KZLIA6WS.js +0 -10
- package/dist/cli-bundle/chunks/history-compact-HHIUOMZ7.js +0 -16
- package/dist/cli-bundle/chunks/history-repair-KG7SWXI6.js +0 -16
- package/dist/cli-bundle/chunks/learnings-ZVHSALJY.js +0 -13
- package/dist/cli-bundle/chunks/notes-BAKUL5DJ.js +0 -13
- package/dist/cli-bundle/chunks/plan-LEAGLPGP.js +0 -24
- package/dist/cli-bundle/chunks/restore-KIUYTAEJ.js +0 -14
- package/dist/cli-bundle/chunks/update-XZJYS5X7.js +0 -21
- package/dist/cli-bundle/chunks/update-many-R24B3GBK.js +0 -36
- package/dist/cli-bundle/chunks/update-many-WQ3R3J6N.js +0 -32
- /package/dist/cli-bundle/chunks/{append-5YF3TO7I.js.map → append-MBXHNWSX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-JHO5K6RP.js.map → append-XUYF7NON.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BIRYX32V.js.map → chunk-2UCG5H6B.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VE6ZSTQW.js.map → chunk-2XPDCXK5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GLZKZON6.js.map → chunk-3HSRP6T2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XWBD6DSR.js.map → chunk-3KPNOZOH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HO4DLBNK.js.map → chunk-4M6RZJXF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RXPQ5Q23.js.map → chunk-4PSJVGRE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YFE7JHX3.js.map → chunk-6BNV3G6C.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-43UMFKCK.js.map → chunk-6V4T4RD3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EHJFUOXL.js.map → chunk-7B7IHMLH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-I7DIDUSP.js.map → chunk-7CHWLT2J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-L6FVNR7X.js.map → chunk-A3GAQLBH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-B57RJHBZ.js.map → chunk-A4FVWFZY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-D52ZN3BF.js.map → chunk-A5EQPNV7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TZAE66GQ.js.map → chunk-AGEBQRBG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WU3KAN6A.js.map → chunk-AQUNTB7G.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XWYQ2LT4.js.map → chunk-BBGR4FKQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2FUOXSRN.js.map → chunk-BFJP4VYC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-633PKXLT.js.map → chunk-BZKE2O5V.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-L337QKWJ.js.map → chunk-DUDLSQFG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BVLOMU6O.js.map → chunk-E7KBMWEF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WQXRZMFN.js.map → chunk-EEECAV5M.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-35FHWD4C.js.map → chunk-EI3UIMZM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-PT7MCCGD.js.map → chunk-FIUTBFC6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7H5NNCJ5.js.map → chunk-FQF6VVPH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6DYOZS6C.js.map → chunk-FQO5THHM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5HGZKQUL.js.map → chunk-FQODDTE7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-67RO3H4N.js.map → chunk-G33XIMRT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QWBKN3QC.js.map → chunk-GKCEEXMA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DG2EQRIH.js.map → chunk-GRDK25BN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FXFCFL73.js.map → chunk-H3YKUVDR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ARGDWQ4J.js.map → chunk-IGBBTPM5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FY4RLHSC.js.map → chunk-IRJ6F23W.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-66MKH7SZ.js.map → chunk-IXG5CMBR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7UCY6DR5.js.map → chunk-JPWUZOMR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FVNWHUME.js.map → chunk-K2L6FZBX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-X2MGQMZO.js.map → chunk-LT5UWU7H.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KH6QAHME.js.map → chunk-M4B4RK4J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2XOSFSTH.js.map → chunk-MQOSMBWV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7R6UIHYY.js.map → chunk-N2TEEOXJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NTRQLE2R.js.map → chunk-N7FCFJ76.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-37DRDP2B.js.map → chunk-NPEYH6CE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2CXL335K.js.map → chunk-OK7VSX3N.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NNANAWFH.js.map → chunk-OKPZDH43.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-G6MYGULG.js.map → chunk-OKWJUL6F.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-D5XHO4Q7.js.map → chunk-Q6JPYR7I.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IE5KRAKN.js.map → chunk-QQ77W23U.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-M7MVOKVV.js.map → chunk-QYGK2XQ3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-X5YCTFKT.js.map → chunk-RWAIRGBC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-W5E2UUSH.js.map → chunk-RX53WHFI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-R5XTTZSJ.js.map → chunk-SBW7EQC4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TM5CIO3F.js.map → chunk-SGJB6PXA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DDFGYUCQ.js.map → chunk-STBCBDKF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FHOBCGQO.js.map → chunk-SVAWG7EE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6O44IN44.js.map → chunk-T6MOTLOJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EWIT5WIC.js.map → chunk-U6RYD446.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-E4FXM2XB.js.map → chunk-UE7LK3RE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-N33FD2UI.js.map → chunk-UNNCT5QY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2IPNL3DR.js.map → chunk-UOIFZ66L.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LSOWTLEM.js.map → chunk-UU6EP25G.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HYTOJW2Q.js.map → chunk-UW6HCMP2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-47HXN6RX.js.map → chunk-UWAQI3B7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YKFHF37B.js.map → chunk-V4QHAMI5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VAHZIPWS.js.map → chunk-VA3H7VVC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TLWJP5BF.js.map → chunk-VQOG2ETB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-H5IOT54C.js.map → chunk-VSQE43NO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BDA35QG5.js.map → chunk-W6IEJXNC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OWP6QFBV.js.map → chunk-XDWXPG2E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CKX4WOPC.js.map → chunk-XKVHL3MB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WL3SS45P.js.map → chunk-XVB6BATY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NVZ6NVHJ.js.map → chunk-XXWDEQ6O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ILVOOAT4.js.map → chunk-Y2VSGFT4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NCVT6XEL.js.map → chunk-YG56M3NE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AFGKSHAM.js.map → chunk-YGEA4CLH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AXRT7K5V.js.map → chunk-YIC5NGXF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XXLXJL7V.js.map → chunk-ZUCBPXNA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-X3CF6FQP.js.map → close-7NWA3GLA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-GPD7DTJV.js.map → close-ZZCDDWJT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-NQLYGPYW.js.map → close-many-QCZHFCON.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-J7A5EHOQ.js.map → close-many-YALQ7AXS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-2AOZQ5D2.js.map → comments-FMQNYPSZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-TMHMALA5.js.map → comments-SQIQ5WYR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-N3LCQBMC.js.map → copy-GI3RCVZP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-FWQA5OU4.js.map → copy-YDAMENCP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-AQ5SIGZC.js.map → create-JSL6CXU3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-KOGQ3JKD.js.map → create-LXMLYJNM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-6G3MBZ6S.js.map → delete-5DFAXJNI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-YYYFOSEA.js.map → delete-IGVOZEU2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-NIIKXLPB.js.map → deps-BQAXUQAK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-MQ4ZIGZB.js.map → deps-CBPPSS6J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-OWRGDMNY.js.map → docs-KCWPLQOV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-53NUGMIQ.js.map → docs-NS2AZWCN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-3PXGXYDB.js.map → files-PVWEPT5J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-EGLKHD7O.js.map → files-XUUBQ76I.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-KZLIA6WS.js.map → focus-3EJVFI3D.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-SRPASFTN.js.map → focus-DHBHKK3E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-G4DULDCX.js.map → history-compact-3TNPYVFG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-HHIUOMZ7.js.map → history-compact-JHYVDYLW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-IUSJ6X3E.js.map → history-redact-ELRL73XN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-THHGRQXV.js.map → history-redact-KKFDICCF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-LUQWRS7X.js.map → history-repair-J7WKZFAG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-KG7SWXI6.js.map → history-repair-REMI7DDI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-ZVHSALJY.js.map → learnings-O6V5WDCV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-2MRNBFJF.js.map → learnings-X4D6JCCG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-73JWKWUD.js.map → notes-UQC6VS6N.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-BAKUL5DJ.js.map → notes-ZSZREWZA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-AZPMCG37.js.map → plan-5GKRBJJO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-LEAGLPGP.js.map → plan-EZW2YDDY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{profile-AVCIIZID.js.map → profile-5PQAPCLF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{profile-LFYO3HHX.js.map → profile-CW4BD3FO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-list-query-UKMF55FT.js.map → register-list-query-HTDQE6VI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-list-query-MZUF2EEC.js.map → register-list-query-PHIPDFP2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-mutation-T6RVNJC4.js.map → register-mutation-BLEWM5I6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-mutation-2PBW2GEX.js.map → register-mutation-OTYHR7J6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-KIUYTAEJ.js.map → restore-A55MLFAI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-E3PRGDN3.js.map → restore-HEQAG6EK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-5JNFQFUW.js.map → schema-MAXAIHEC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-TMIW4XZC.js.map → schema-Q5DAWJ2S.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-XZJYS5X7.js.map → update-5DTSCWVF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-SQYZA3ZW.js.map → update-DWFXXJKP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-WQ3R3J6N.js.map → update-many-6T4ZLZS7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-R24B3GBK.js.map → update-many-MYRK6VBJ.js.map} +0 -0
|
@@ -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]="96b56a77-ebeb-51d6-b933-58ca6decc8bb")}catch(e){}}();
|
|
13
13
|
import { collectBlockedByIds, computeActionabilityReport, } from "../../sdk/actionability.js";
|
|
14
14
|
import { resolveRuntimeStatusRegistry, } from "../../core/schema/runtime-schema.js";
|
|
15
15
|
import { EXIT_CODE } from "../../core/shared/constants.js";
|
|
@@ -303,11 +303,21 @@ async function rankReadyEntriesWithRelevance(rankedReady, childrenByParent, stat
|
|
|
303
303
|
packing,
|
|
304
304
|
};
|
|
305
305
|
}
|
|
306
|
+
/** Resolve the ranking perspective from an explicit caller, delegated assignee, environment author, or project default. */
|
|
307
|
+
function resolveNextCallerAuthor(options, settingsAuthor) {
|
|
308
|
+
const requestedAssignee = options.assignee?.trim();
|
|
309
|
+
return (options.callerAuthor ??
|
|
310
|
+
(requestedAssignee && requestedAssignee.length > 0
|
|
311
|
+
? requestedAssignee
|
|
312
|
+
: undefined) ??
|
|
313
|
+
process.env.PM_AUTHOR ??
|
|
314
|
+
settingsAuthor);
|
|
315
|
+
}
|
|
306
316
|
/** Implements `pm next`: computes the ranked ready/blocked actionable queues and a single recommended next item with rationale for the public runtime surface. */
|
|
307
317
|
export async function runNext(options, global) {
|
|
308
318
|
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
309
319
|
const settings = await readSettings(pmRoot);
|
|
310
|
-
const callerAuthor = options
|
|
320
|
+
const callerAuthor = resolveNextCallerAuthor(options, settings.author_default);
|
|
311
321
|
const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);
|
|
312
322
|
const now = nowIso();
|
|
313
323
|
const limit = parseNextLimit(options.limit, "--limit", DEFAULT_NEXT_LIMIT);
|
|
@@ -456,4 +466,4 @@ function formatNextLine(item) {
|
|
|
456
466
|
return `${rankToken}${item.id} p${item.priority} ${item.status} ${item.type} deadline:${deadlineToken}${parentToken}${unblocksToken} ${item.title}`;
|
|
457
467
|
}
|
|
458
468
|
//# sourceMappingURL=next.js.map
|
|
459
|
-
//# debugId=
|
|
469
|
+
//# debugId=96b56a77-ebeb-51d6-b933-58ca6decc8bb
|
|
@@ -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 \"../../sdk/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 { ItemMetadata, ItemStatus } from \"../../types/index.js\";\nimport { parseIntegerLimit } from \"../shared-parsers.js\";\nimport {\n buildChildrenByParent,\n buildItemContextRelevanceCandidates,\n collectSubtreeIds,\n compareCriticalItems,\n packRankedContextItems,\n toContextPackingSummary,\n toContextRankingSummary,\n toContextFocusItem,\n type ContextFocusItem,\n type ContextRankingSummary,\n type ContextPackingSummary,\n} from \"./context.js\";\nimport { runList, type ListOptions } from \"./list.js\";\nimport { scoreContextCandidatesWithActiveExtensions } from \"../../sdk/context-relevance.js\";\nimport {\n readContextUsageAffinity,\n recordContextUsageServing,\n} from \"../../sdk/context-usage.js\";\nimport type { ContextPackingReport } from \"../../sdk/context-packing.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 decision_needed: number;\n held_by_others: 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 /** Token-budget selection and projection accounting for the ready queue. */\n packing?: ContextPackingSummary;\n /** Explicit marker and complete counts for queues truncated by the shared section limit. */\n truncation?: {\n decision_needed_total?: number;\n held_by_others_total?: number;\n };\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, ItemMetadata[]>,\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: ItemMetadata,\n childrenByParent: Map<string, ItemMetadata[]>,\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, ItemMetadata[]>,\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 buildNextTruncation(\n decisionCount: number,\n heldCount: number,\n limit: number,\n): NextResult[\"truncation\"] {\n const truncation: NonNullable<NextResult[\"truncation\"]> = {};\n if (decisionCount > limit) {\n truncation.decision_needed_total = decisionCount;\n }\n if (heldCount > limit) {\n truncation.held_by_others_total = heldCount;\n }\n return Object.keys(truncation).length > 0 ? truncation : undefined;\n}\n\nasync function attachNextUsageFeedback(params: {\n result: NextResult;\n pmRoot: string;\n author: string;\n packing: ContextPackingReport<ItemMetadata>;\n ranking: Awaited<\n ReturnType<typeof scoreContextCandidatesWithActiveExtensions<ItemMetadata>>\n >;\n}): Promise<void> {\n try {\n const included = new Set(params.packing.included.map((entry) => entry.id));\n await recordContextUsageServing({\n pmRoot: params.pmRoot,\n author: params.author,\n surface: \"next\",\n profile: params.packing.profile,\n rows: params.ranking.ranked.map((entry) => ({\n id: entry.id,\n rank: entry.rank,\n included: included.has(entry.id),\n })),\n enabled: process.env.PM_CONTEXT_USAGE_DISABLED !== \"1\",\n });\n } catch {\n params.result.warnings = [\n ...new Set([\n ...(params.result.warnings ?? []),\n \"context_usage_feedback_write_failed\",\n ]),\n ].sort((left, right) => left.localeCompare(right));\n }\n}\n\nasync function finalizeNextResult(params: {\n result: NextResult;\n recommended: NextRecommendation | null;\n blockedRows: NextActionableItem[];\n candidatesWarnings: string[] | undefined;\n corpusWarnings: string[] | undefined;\n readyRanking: Awaited<\n ReturnType<typeof scoreContextCandidatesWithActiveExtensions<ItemMetadata>>\n >;\n explainRanking: boolean;\n pmRoot: string;\n author: string;\n packing: ContextPackingReport<ItemMetadata>;\n}): Promise<NextResult> {\n const warnings = [\n ...new Set([\n ...(params.candidatesWarnings ?? []),\n ...(params.corpusWarnings ?? []),\n ...(params.readyRanking.warnings ?? []),\n ]),\n ].sort((left, right) => left.localeCompare(right));\n if (warnings.length > 0) params.result.warnings = warnings;\n if (params.explainRanking) {\n params.result.ranking = toContextRankingSummary(params.readyRanking);\n params.result.packing = toContextPackingSummary(params.packing);\n }\n\n params.result.suggestions = buildNextSuggestions(\n params.recommended,\n params.blockedRows,\n );\n await attachNextUsageFeedback({\n result: params.result,\n pmRoot: params.pmRoot,\n author: params.author,\n packing: params.packing,\n ranking: params.readyRanking,\n });\n return params.result;\n}\n\nfunction filterCandidatesByParentScope(\n candidates: ItemMetadata[],\n corpus: ItemMetadata[],\n parentScope: string,\n): ItemMetadata[] {\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, ItemMetadata[]>,\n statusRegistry: RuntimeStatusRegistry,\n now: string,\n callerAuthor: string,\n pmRoot: string,\n tokenBudget: number,\n): Promise<{\n projectedReady: ActionableEntry[];\n ranking: Awaited<\n ReturnType<\n typeof scoreContextCandidatesWithActiveExtensions<ItemMetadata>\n >\n >;\n completedContainer: boolean;\n packing: ContextPackingReport<ItemMetadata>;\n}> {\n const concreteReady = rankedReady.filter(\n (entry) => !hasCompletedDescendants(entry.item, childrenByParent),\n );\n const structuralReady =\n concreteReady.length > 0 ? concreteReady : rankedReady;\n const usage = await readContextUsageAffinity({\n pmRoot,\n author: callerAuthor,\n enabled: process.env.PM_CONTEXT_USAGE_DISABLED !== \"1\",\n });\n const ranking = await scoreContextCandidatesWithActiveExtensions(\n \"next\",\n buildItemContextRelevanceCandidates(\n structuralReady.map((entry) => entry.item),\n { statusRegistry, now, author: callerAuthor, usageAffinity: usage.affinity },\n ),\n );\n const packing = packRankedContextItems(ranking, tokenBudget, new Set(), \"next\");\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 packing,\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 callerAuthor =\n options.callerAuthor ?? process.env.PM_AUTHOR ?? settings.author_default;\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 ItemMetadata[],\n corpusList.items as ItemMetadata[],\n parentScope,\n );\n const corpus = corpusList.items as ItemMetadata[];\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 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 packing: readyPacking,\n } = await rankReadyEntriesWithRelevance(\n rankedReady,\n childrenByParent,\n statusRegistry,\n now,\n callerAuthor,\n pmRoot,\n Math.max(192, limit * 128),\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 const truncation = buildNextTruncation(\n decisionRows.length,\n callerPartition.held.length,\n limit,\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.slice(0, limit),\n blocked: readyOnly ? [] : blockedRows.slice(0, blockedLimit),\n held_by_others: callerPartition.held.slice(0, limit),\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 decision_needed: decisionRows.length,\n held_by_others: callerPartition.held.length,\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 truncation,\n };\n\n return finalizeNextResult({\n result,\n recommended,\n blockedRows,\n candidatesWarnings: candidatesList.warnings,\n corpusWarnings: corpusList.warnings,\n readyRanking,\n explainRanking: options.explainRanking === true,\n pmRoot,\n author: callerAuthor,\n packing: readyPacking,\n });\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\", \"\", ...renderNextSummaryLines(result)];\n lines.push(...renderNextSection(\"Recommended\", renderNextRecommendedRows(result.recommended), \"No ready work.\"));\n lines.push(\n ...renderNextSection(\n \"Decision needed\",\n // `?? []` tolerates JSON payloads from pre-decision-queue builds (the\n // field is newer than the rest of the shape); pinned by a dedicated spec.\n (result.decision_needed ?? []).map((item) => `- ${formatNextLine(item)}`),\n \"No human-gated decisions.\",\n ),\n );\n lines.push(\n ...renderNextSection(\n \"Ready\",\n result.ready.map((item) => `- ${formatNextLine(item)}`),\n \"No ready items.\",\n ),\n );\n if (!result.filters.ready_only) {\n lines.push(\n ...renderNextSection(\n \"Blocked\",\n result.blocked.map((item) => `- ${formatNextBlockedLine(item)}`),\n \"No blocked items.\",\n ),\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// Renders the top-of-report summary bullet block (timestamp, queue counts,\n// optional subtree scope) followed by its separating blank line.\nfunction renderNextSummaryLines(result: NextResult): string[] {\n const lines = [\n `- now: ${result.now}`,\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 return lines;\n}\n\n// Renders the recommendation rows (item line + rationale) or nothing when no\n// candidate is ready, letting the shared section helper supply the empty state.\nfunction renderNextRecommendedRows(recommended: NextResult[\"recommended\"]): string[] {\n if (!recommended) {\n return [];\n }\n return [`- ${formatNextLine(recommended)}`, ` why: ${recommended.reasons.join(\"; \")}`];\n}\n\n// Renders one markdown queue section: the `##` header, then either the rows or\n// the section's empty-state message, closed by a separating blank line.\nfunction renderNextSection(header: string, rows: string[], emptyMessage: string): string[] {\n return [`## ${header}`, ...(rows.length === 0 ? [emptyMessage] : rows), \"\"];\n}\n\n// Formats a blocked row: the standard actionable line annotated with each open\n// blocker's id and current status.\nfunction formatNextBlockedLine(item: NextResult[\"blocked\"][number]): string {\n const by = item.blockers\n .map((blocker) => `${blocker.id}(${blocker.status ?? \"?\"})`)\n .join(\", \");\n return `${formatNextLine(item)} blocked_by:${by}`;\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,4BAA4B,CAAC;AACpC,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,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CAAC;IACd,OAAO,GAAG,cAAc,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,CAAC;AACpD,CAAC;AAED,iFAAiF;AACjF,6EAA6E;AAC7E,SAAS,cAAc,CAAC,IAAwB;IAC9C,MAAM,aAAa,GAAG,IAAI,CAAC,QAAQ,IAAI,GAAG,CAAC;IAC3C,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAChE,MAAM,aAAa,GACjB,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACtE,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IACtE,OAAO,GAAG,SAAS,GAAG,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,IAAI,aAAa,aAAa,GAAG,WAAW,GAAG,aAAa,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;AACtJ,CAAC","debugId":"534c717f-fed5-51b7-82b9-55ef4f6a4bdf"}
|
|
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 \"../../sdk/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 { ItemMetadata, ItemStatus } from \"../../types/index.js\";\nimport { parseIntegerLimit } from \"../shared-parsers.js\";\nimport {\n buildChildrenByParent,\n buildItemContextRelevanceCandidates,\n collectSubtreeIds,\n compareCriticalItems,\n packRankedContextItems,\n toContextPackingSummary,\n toContextRankingSummary,\n toContextFocusItem,\n type ContextFocusItem,\n type ContextRankingSummary,\n type ContextPackingSummary,\n} from \"./context.js\";\nimport { runList, type ListOptions } from \"./list.js\";\nimport { scoreContextCandidatesWithActiveExtensions } from \"../../sdk/context-relevance.js\";\nimport {\n readContextUsageAffinity,\n recordContextUsageServing,\n} from \"../../sdk/context-usage.js\";\nimport type { ContextPackingReport } from \"../../sdk/context-packing.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 decision_needed: number;\n held_by_others: 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 /** Token-budget selection and projection accounting for the ready queue. */\n packing?: ContextPackingSummary;\n /** Explicit marker and complete counts for queues truncated by the shared section limit. */\n truncation?: {\n decision_needed_total?: number;\n held_by_others_total?: number;\n };\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, ItemMetadata[]>,\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: ItemMetadata,\n childrenByParent: Map<string, ItemMetadata[]>,\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, ItemMetadata[]>,\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 buildNextTruncation(\n decisionCount: number,\n heldCount: number,\n limit: number,\n): NextResult[\"truncation\"] {\n const truncation: NonNullable<NextResult[\"truncation\"]> = {};\n if (decisionCount > limit) {\n truncation.decision_needed_total = decisionCount;\n }\n if (heldCount > limit) {\n truncation.held_by_others_total = heldCount;\n }\n return Object.keys(truncation).length > 0 ? truncation : undefined;\n}\n\nasync function attachNextUsageFeedback(params: {\n result: NextResult;\n pmRoot: string;\n author: string;\n packing: ContextPackingReport<ItemMetadata>;\n ranking: Awaited<\n ReturnType<typeof scoreContextCandidatesWithActiveExtensions<ItemMetadata>>\n >;\n}): Promise<void> {\n try {\n const included = new Set(params.packing.included.map((entry) => entry.id));\n await recordContextUsageServing({\n pmRoot: params.pmRoot,\n author: params.author,\n surface: \"next\",\n profile: params.packing.profile,\n rows: params.ranking.ranked.map((entry) => ({\n id: entry.id,\n rank: entry.rank,\n included: included.has(entry.id),\n })),\n enabled: process.env.PM_CONTEXT_USAGE_DISABLED !== \"1\",\n });\n } catch {\n params.result.warnings = [\n ...new Set([\n ...(params.result.warnings ?? []),\n \"context_usage_feedback_write_failed\",\n ]),\n ].sort((left, right) => left.localeCompare(right));\n }\n}\n\nasync function finalizeNextResult(params: {\n result: NextResult;\n recommended: NextRecommendation | null;\n blockedRows: NextActionableItem[];\n candidatesWarnings: string[] | undefined;\n corpusWarnings: string[] | undefined;\n readyRanking: Awaited<\n ReturnType<typeof scoreContextCandidatesWithActiveExtensions<ItemMetadata>>\n >;\n explainRanking: boolean;\n pmRoot: string;\n author: string;\n packing: ContextPackingReport<ItemMetadata>;\n}): Promise<NextResult> {\n const warnings = [\n ...new Set([\n ...(params.candidatesWarnings ?? []),\n ...(params.corpusWarnings ?? []),\n ...(params.readyRanking.warnings ?? []),\n ]),\n ].sort((left, right) => left.localeCompare(right));\n if (warnings.length > 0) params.result.warnings = warnings;\n if (params.explainRanking) {\n params.result.ranking = toContextRankingSummary(params.readyRanking);\n params.result.packing = toContextPackingSummary(params.packing);\n }\n\n params.result.suggestions = buildNextSuggestions(\n params.recommended,\n params.blockedRows,\n );\n await attachNextUsageFeedback({\n result: params.result,\n pmRoot: params.pmRoot,\n author: params.author,\n packing: params.packing,\n ranking: params.readyRanking,\n });\n return params.result;\n}\n\nfunction filterCandidatesByParentScope(\n candidates: ItemMetadata[],\n corpus: ItemMetadata[],\n parentScope: string,\n): ItemMetadata[] {\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, ItemMetadata[]>,\n statusRegistry: RuntimeStatusRegistry,\n now: string,\n callerAuthor: string,\n pmRoot: string,\n tokenBudget: number,\n): Promise<{\n projectedReady: ActionableEntry[];\n ranking: Awaited<\n ReturnType<\n typeof scoreContextCandidatesWithActiveExtensions<ItemMetadata>\n >\n >;\n completedContainer: boolean;\n packing: ContextPackingReport<ItemMetadata>;\n}> {\n const concreteReady = rankedReady.filter(\n (entry) => !hasCompletedDescendants(entry.item, childrenByParent),\n );\n const structuralReady =\n concreteReady.length > 0 ? concreteReady : rankedReady;\n const usage = await readContextUsageAffinity({\n pmRoot,\n author: callerAuthor,\n enabled: process.env.PM_CONTEXT_USAGE_DISABLED !== \"1\",\n });\n const ranking = await scoreContextCandidatesWithActiveExtensions(\n \"next\",\n buildItemContextRelevanceCandidates(\n structuralReady.map((entry) => entry.item),\n { statusRegistry, now, author: callerAuthor, usageAffinity: usage.affinity },\n ),\n );\n const packing = packRankedContextItems(ranking, tokenBudget, new Set(), \"next\");\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 packing,\n };\n}\n\n/** Resolve the ranking perspective from an explicit caller, delegated assignee, environment author, or project default. */\nfunction resolveNextCallerAuthor(\n options: NextOptions,\n settingsAuthor: string,\n): string {\n const requestedAssignee = options.assignee?.trim();\n return (\n options.callerAuthor ??\n (requestedAssignee && requestedAssignee.length > 0\n ? requestedAssignee\n : undefined) ??\n process.env.PM_AUTHOR ??\n settingsAuthor\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 callerAuthor = resolveNextCallerAuthor(\n options,\n settings.author_default,\n );\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 ItemMetadata[],\n corpusList.items as ItemMetadata[],\n parentScope,\n );\n const corpus = corpusList.items as ItemMetadata[];\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 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 packing: readyPacking,\n } = await rankReadyEntriesWithRelevance(\n rankedReady,\n childrenByParent,\n statusRegistry,\n now,\n callerAuthor,\n pmRoot,\n Math.max(192, limit * 128),\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 const truncation = buildNextTruncation(\n decisionRows.length,\n callerPartition.held.length,\n limit,\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.slice(0, limit),\n blocked: readyOnly ? [] : blockedRows.slice(0, blockedLimit),\n held_by_others: callerPartition.held.slice(0, limit),\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 decision_needed: decisionRows.length,\n held_by_others: callerPartition.held.length,\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 truncation,\n };\n\n return finalizeNextResult({\n result,\n recommended,\n blockedRows,\n candidatesWarnings: candidatesList.warnings,\n corpusWarnings: corpusList.warnings,\n readyRanking,\n explainRanking: options.explainRanking === true,\n pmRoot,\n author: callerAuthor,\n packing: readyPacking,\n });\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\", \"\", ...renderNextSummaryLines(result)];\n lines.push(...renderNextSection(\"Recommended\", renderNextRecommendedRows(result.recommended), \"No ready work.\"));\n lines.push(\n ...renderNextSection(\n \"Decision needed\",\n // `?? []` tolerates JSON payloads from pre-decision-queue builds (the\n // field is newer than the rest of the shape); pinned by a dedicated spec.\n (result.decision_needed ?? []).map((item) => `- ${formatNextLine(item)}`),\n \"No human-gated decisions.\",\n ),\n );\n lines.push(\n ...renderNextSection(\n \"Ready\",\n result.ready.map((item) => `- ${formatNextLine(item)}`),\n \"No ready items.\",\n ),\n );\n if (!result.filters.ready_only) {\n lines.push(\n ...renderNextSection(\n \"Blocked\",\n result.blocked.map((item) => `- ${formatNextBlockedLine(item)}`),\n \"No blocked items.\",\n ),\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// Renders the top-of-report summary bullet block (timestamp, queue counts,\n// optional subtree scope) followed by its separating blank line.\nfunction renderNextSummaryLines(result: NextResult): string[] {\n const lines = [\n `- now: ${result.now}`,\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 return lines;\n}\n\n// Renders the recommendation rows (item line + rationale) or nothing when no\n// candidate is ready, letting the shared section helper supply the empty state.\nfunction renderNextRecommendedRows(recommended: NextResult[\"recommended\"]): string[] {\n if (!recommended) {\n return [];\n }\n return [`- ${formatNextLine(recommended)}`, ` why: ${recommended.reasons.join(\"; \")}`];\n}\n\n// Renders one markdown queue section: the `##` header, then either the rows or\n// the section's empty-state message, closed by a separating blank line.\nfunction renderNextSection(header: string, rows: string[], emptyMessage: string): string[] {\n return [`## ${header}`, ...(rows.length === 0 ? [emptyMessage] : rows), \"\"];\n}\n\n// Formats a blocked row: the standard actionable line annotated with each open\n// blocker's id and current status.\nfunction formatNextBlockedLine(item: NextResult[\"blocked\"][number]): string {\n const by = item.blockers\n .map((blocker) => `${blocker.id}(${blocker.status ?? \"?\"})`)\n .join(\", \");\n return `${formatNextLine(item)} blocked_by:${by}`;\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,4BAA4B,CAAC;AACpC,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,OAAO,EACL,qBAAqB,EACrB,mCAAmC,EACnC,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,kBAAkB,GAInB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,OAAO,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,CAAC,MAAM,IAAI,GAAG,GAAG,CAAC;SAC3D,IAAI,CAAC,IAAI,CAAC,CAAC;IACd,OAAO,GAAG,cAAc,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,CAAC;AACpD,CAAC;AAED,iFAAiF;AACjF,6EAA6E;AAC7E,SAAS,cAAc,CAAC,IAAwB;IAC9C,MAAM,aAAa,GAAG,IAAI,CAAC,QAAQ,IAAI,GAAG,CAAC;IAC3C,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAChE,MAAM,aAAa,GACjB,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACtE,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IACtE,OAAO,GAAG,SAAS,GAAG,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,IAAI,aAAa,aAAa,GAAG,WAAW,GAAG,aAAa,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;AACtJ,CAAC","debugId":"96b56a77-ebeb-51d6-b933-58ca6decc8bb"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Implements the pm update 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]="addb4248-70dc-56db-8478-c2947c56c5e7")}catch(e){}}();
|
|
8
8
|
import { pathExists } from "../../core/fs/fs-utils.js";
|
|
9
9
|
import { COMMON_MUTATION_COMMAND_OPTION_KEYS, canonicalizeCommandOptionKey, commandOptionFlagLabel, resolveItemTypeRegistry, resolveCommandOptionPolicyState, resolveTypeDefinition, resolveTypeName, validateTypeOptions, } from "../../core/item/type-registry.js";
|
|
10
10
|
import { normalizeItemId } from "../../core/item/id.js";
|
|
@@ -24,7 +24,7 @@ import { stableValueEquals } from "../../core/shared/serialization.js";
|
|
|
24
24
|
import { resolveIsoOrRelative } from "../../core/shared/time.js";
|
|
25
25
|
import { getActiveExtensionRegistrations } from "../../core/extensions/index.js";
|
|
26
26
|
import { collectRegisteredItemFieldNames, applyRegisteredItemFieldDefaultsAndValidation, parseRegisteredItemFieldAssignments, } from "../../core/extensions/item-fields.js";
|
|
27
|
-
import { buildItemNotFoundError, locateItem, mutateItem, readLocatedItem, } from "../../core/store/item-store.js";
|
|
27
|
+
import { buildItemNotFoundError, listAllItemMetadataLight, locateItem, mutateItem, readLocatedItem, } from "../../core/store/item-store.js";
|
|
28
28
|
import { getSettingsPath, resolvePmRoot } from "../../core/store/paths.js";
|
|
29
29
|
import { readSettings } from "../../core/store/settings.js";
|
|
30
30
|
import { runClose } from "./close.js";
|
|
@@ -33,6 +33,7 @@ import { applyLegacyNoneCollectionNormalizers, createLegacyNoneCollectionNormali
|
|
|
33
33
|
import { ensureEnumValue as ensureEnum } from "./recurrence-parsers.js";
|
|
34
34
|
import { parseEventEntries, parseReminderEntries, parseTypeOptionEntries, } from "./repeatable-metadata-parsers.js";
|
|
35
35
|
import { assertValidBareDependencyFlagValue } from "../../sdk/dependency-flag-validation.js";
|
|
36
|
+
import { collectNewOrderingCycleWarnings } from "../../sdk/graph/mutation-advisory.js";
|
|
36
37
|
import { DEPENDENCY_KIND_VALUES, ISSUE_SEVERITY_VALUES, RISK_VALUES, } from "../../types/index.js";
|
|
37
38
|
import { parseDocs, parseFiles, parseLogSeed, parseTests, requireStringOption, } from "./create.js";
|
|
38
39
|
import { COMMON_UNSET_FIELD_DEFINITIONS_AFTER_CLOSE_REASON_BEFORE_AUTHOR, COMMON_UNSET_FIELD_DEFINITIONS_AFTER_AUTHOR, COMMON_UNSET_FIELD_DEFINITIONS_BEFORE_CLOSE_REASON, parseCommandUnsetTargets, resolveRuntimeUnsetFieldDefinition, } from "./shared-unset-fields.js";
|
|
@@ -1696,6 +1697,9 @@ export async function runUpdate(id, options, global) {
|
|
|
1696
1697
|
return routedClose;
|
|
1697
1698
|
}
|
|
1698
1699
|
assertMatchingOrderRank(options);
|
|
1700
|
+
let graphBeforeUpdate = fieldFlags.dep || fieldFlags.depRemove || fieldFlags.blockedBy
|
|
1701
|
+
? await listAllItemMetadataLight(pmRoot, settings.item_format, typeRegistry.type_to_folder, undefined, settings.schema)
|
|
1702
|
+
: undefined;
|
|
1699
1703
|
const result = await mutateItem({
|
|
1700
1704
|
pmRoot,
|
|
1701
1705
|
settings,
|
|
@@ -1711,6 +1715,9 @@ export async function runUpdate(id, options, global) {
|
|
|
1711
1715
|
extensionFieldNames,
|
|
1712
1716
|
skipNoop: true,
|
|
1713
1717
|
mutate(document) {
|
|
1718
|
+
graphBeforeUpdate = graphBeforeUpdate?.map((item) => item.id === document.metadata.id
|
|
1719
|
+
? structuredClone(document.metadata)
|
|
1720
|
+
: item);
|
|
1714
1721
|
return mutateUpdateDocument(document, {
|
|
1715
1722
|
options,
|
|
1716
1723
|
settings,
|
|
@@ -1738,12 +1745,16 @@ export async function runUpdate(id, options, global) {
|
|
|
1738
1745
|
});
|
|
1739
1746
|
},
|
|
1740
1747
|
});
|
|
1748
|
+
const orderingCycleWarnings = graphBeforeUpdate
|
|
1749
|
+
? collectNewOrderingCycleWarnings(graphBeforeUpdate, graphBeforeUpdate.map((item) => item.id === result.item.id ? result.item : item), result.item.id)
|
|
1750
|
+
: [];
|
|
1741
1751
|
return {
|
|
1742
1752
|
item: toItemRecord(result.item),
|
|
1743
1753
|
changed_fields: result.changedFields,
|
|
1744
1754
|
warnings: [
|
|
1745
1755
|
...workflowTransitionWarnings,
|
|
1746
1756
|
...parentReferenceWarnings,
|
|
1757
|
+
...orderingCycleWarnings,
|
|
1747
1758
|
...result.warnings,
|
|
1748
1759
|
],
|
|
1749
1760
|
};
|
|
@@ -1766,4 +1777,4 @@ export const _testOnlyUpdateCommand = {
|
|
|
1766
1777
|
resolveRuntimeUnsetDefinition: (token, registry) => resolveRuntimeUnsetFieldDefinition(token, "update", registry),
|
|
1767
1778
|
};
|
|
1768
1779
|
//# sourceMappingURL=update.js.map
|
|
1769
|
-
//# debugId=
|
|
1780
|
+
//# debugId=addb4248-70dc-56db-8478-c2947c56c5e7
|