@unbrained/pm-cli 2026.7.13 → 2026.7.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (487) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +28 -0
  3. package/dist/cli/commands/aggregate.d.ts +1 -1
  4. package/dist/cli/commands/aggregate.js +18 -6
  5. package/dist/cli/commands/aggregate.js.map +1 -1
  6. package/dist/cli/commands/context.d.ts +16 -1
  7. package/dist/cli/commands/context.js +98 -16
  8. package/dist/cli/commands/context.js.map +1 -1
  9. package/dist/cli/commands/create.d.ts +1 -1
  10. package/dist/cli/commands/create.js +11 -7
  11. package/dist/cli/commands/create.js.map +1 -1
  12. package/dist/cli/commands/deps.d.ts +6 -96
  13. package/dist/cli/commands/deps.js +4 -214
  14. package/dist/cli/commands/deps.js.map +1 -1
  15. package/dist/cli/commands/docs.d.ts +2 -44
  16. package/dist/cli/commands/docs.js +8 -13
  17. package/dist/cli/commands/docs.js.map +1 -1
  18. package/dist/cli/commands/files.d.ts +6 -134
  19. package/dist/cli/commands/files.js +4 -294
  20. package/dist/cli/commands/files.js.map +1 -1
  21. package/dist/cli/commands/get.js +15 -2
  22. package/dist/cli/commands/get.js.map +1 -1
  23. package/dist/cli/commands/list.js +5 -6
  24. package/dist/cli/commands/list.js.map +1 -1
  25. package/dist/cli/commands/next.d.ts +3 -1
  26. package/dist/cli/commands/next.js +77 -20
  27. package/dist/cli/commands/next.js.map +1 -1
  28. package/dist/cli/commands/update-many.js +6 -3
  29. package/dist/cli/commands/update-many.js.map +1 -1
  30. package/dist/cli/commands/update.js +14 -7
  31. package/dist/cli/commands/update.js.map +1 -1
  32. package/dist/cli/commands/validate.d.ts +1 -1
  33. package/dist/cli/commands/validate.js +32 -35
  34. package/dist/cli/commands/validate.js.map +1 -1
  35. package/dist/cli/main.d.ts +2 -14
  36. package/dist/cli/main.js +27 -8
  37. package/dist/cli/main.js.map +1 -1
  38. package/dist/cli-bundle/chunks/append-DYQWQK2J.js +11 -0
  39. package/dist/cli-bundle/chunks/{append-2FS6MVG7.js → append-PVZJDM6J.js} +5 -5
  40. package/dist/cli-bundle/chunks/{chunk-J2WAWP4U.js → chunk-2FNWQXZ2.js} +4 -4
  41. package/dist/cli-bundle/chunks/{chunk-YFGYDZRP.js → chunk-2GA3NK35.js} +4 -4
  42. package/dist/cli-bundle/chunks/{chunk-XFEIASAC.js → chunk-2QIQGYPW.js} +2 -2
  43. package/dist/cli-bundle/chunks/{chunk-3WCGYH5Q.js → chunk-3CMRNVTO.js} +7 -7
  44. package/dist/cli-bundle/chunks/chunk-3HKUXVKV.js +9 -0
  45. package/dist/cli-bundle/chunks/{chunk-VDAZPPRU.js → chunk-3I3LRT2G.js} +2 -2
  46. package/dist/cli-bundle/chunks/{chunk-3P3RFJIQ.js → chunk-3TL7WOEF.js} +2 -2
  47. package/dist/cli-bundle/chunks/{chunk-4SHJ5JS3.js → chunk-44LNIULG.js} +4 -4
  48. package/dist/cli-bundle/chunks/{chunk-QFOAWBOB.js → chunk-4DY4KPQI.js} +11 -10
  49. package/dist/cli-bundle/chunks/{chunk-QFOAWBOB.js.map → chunk-4DY4KPQI.js.map} +2 -2
  50. package/dist/cli-bundle/chunks/{chunk-BVCF4ULV.js → chunk-4RXTMU57.js} +5 -5
  51. package/dist/cli-bundle/chunks/{chunk-XMI2TRY5.js → chunk-4WREH7RT.js} +4 -4
  52. package/dist/cli-bundle/chunks/{chunk-JYUGUXFW.js → chunk-5CT5BW6E.js} +5 -5
  53. package/dist/cli-bundle/chunks/{chunk-NA5SBIB4.js → chunk-5URI7TPJ.js} +44 -44
  54. package/dist/cli-bundle/chunks/chunk-5URI7TPJ.js.map +7 -0
  55. package/dist/cli-bundle/chunks/{chunk-QGH6WL6L.js → chunk-655STMGA.js} +2 -2
  56. package/dist/cli-bundle/chunks/{chunk-DGKBWCMA.js → chunk-6IIVBC56.js} +4 -4
  57. package/dist/cli-bundle/chunks/{chunk-SRQLQUO6.js → chunk-6MHSBDGD.js} +7 -7
  58. package/dist/cli-bundle/chunks/{chunk-SRQLQUO6.js.map → chunk-6MHSBDGD.js.map} +2 -2
  59. package/dist/cli-bundle/chunks/{chunk-D4GPNYYP.js → chunk-6OTZMORS.js} +6 -6
  60. package/dist/cli-bundle/chunks/{chunk-JVRVXO6M.js → chunk-6PKA3SJQ.js} +6 -6
  61. package/dist/cli-bundle/chunks/{chunk-2PR4ZTRO.js → chunk-6TTOHMTB.js} +8 -8
  62. package/dist/cli-bundle/chunks/{chunk-2PR4ZTRO.js.map → chunk-6TTOHMTB.js.map} +1 -1
  63. package/dist/cli-bundle/chunks/chunk-6X5MZ5R2.js +9 -0
  64. package/dist/cli-bundle/chunks/chunk-76UBY2EE.js +5 -0
  65. package/dist/cli-bundle/chunks/{chunk-ZS2KPCJN.js → chunk-7QDSYUMF.js} +7 -7
  66. package/dist/cli-bundle/chunks/{chunk-Z7TFPIJ6.js → chunk-7TQMR6LK.js} +7 -7
  67. package/dist/cli-bundle/chunks/{chunk-AHA4POA6.js → chunk-ABRCOSDC.js} +3 -3
  68. package/dist/cli-bundle/chunks/{chunk-XY3CC3EM.js → chunk-AFWZRL7M.js} +59 -53
  69. package/dist/cli-bundle/chunks/chunk-AFWZRL7M.js.map +7 -0
  70. package/dist/cli-bundle/chunks/{chunk-KQJVTQVK.js → chunk-ANSJHDOZ.js} +2 -2
  71. package/dist/cli-bundle/chunks/{chunk-OMT4NO7T.js → chunk-B5DZYTT3.js} +113 -24
  72. package/dist/cli-bundle/chunks/chunk-B5DZYTT3.js.map +7 -0
  73. package/dist/cli-bundle/chunks/chunk-B7SWOIP6.js +5 -0
  74. package/dist/cli-bundle/chunks/{chunk-D2LXG7WX.js → chunk-BN62TO2S.js} +5 -5
  75. package/dist/cli-bundle/chunks/chunk-BN62TO2S.js.map +1 -0
  76. package/dist/cli-bundle/chunks/{chunk-ZTSV7P2T.js → chunk-BPD26E3P.js} +357 -42
  77. package/dist/cli-bundle/chunks/chunk-BPD26E3P.js.map +1 -0
  78. package/dist/cli-bundle/chunks/{chunk-RKGFUC4O.js → chunk-CDJYP7OQ.js} +36 -14
  79. package/dist/cli-bundle/chunks/chunk-CDJYP7OQ.js.map +1 -0
  80. package/dist/cli-bundle/chunks/{chunk-VLFLRFJP.js → chunk-CIOZ376P.js} +20 -13
  81. package/dist/cli-bundle/chunks/chunk-CIOZ376P.js.map +1 -0
  82. package/dist/cli-bundle/chunks/{chunk-HXTCZSAI.js → chunk-DBZVUJTK.js} +3 -3
  83. package/dist/cli-bundle/chunks/{chunk-2QNOWOIB.js → chunk-DO5RGJXT.js} +3 -3
  84. package/dist/cli-bundle/chunks/{chunk-MKONZ4UO.js → chunk-DRNJPEPQ.js} +4 -4
  85. package/dist/cli-bundle/chunks/{chunk-XDT2PSXA.js → chunk-DVOLZJ3C.js} +12 -11
  86. package/dist/cli-bundle/chunks/{chunk-XDT2PSXA.js.map → chunk-DVOLZJ3C.js.map} +1 -1
  87. package/dist/cli-bundle/chunks/{chunk-H36FXA7B.js → chunk-DYEX6NFH.js} +4 -4
  88. package/dist/cli-bundle/chunks/{chunk-G3IB5GTD.js → chunk-E2WC6S4P.js} +15 -11
  89. package/dist/cli-bundle/chunks/chunk-E2WC6S4P.js.map +7 -0
  90. package/dist/cli-bundle/chunks/{chunk-GAJ7U7B4.js → chunk-ERL2YFJ2.js} +3 -3
  91. package/dist/cli-bundle/chunks/{chunk-FPEYOFEF.js → chunk-F7PSHRNO.js} +3 -3
  92. package/dist/cli-bundle/chunks/{chunk-UH7OLT6F.js → chunk-FDSBDNYE.js} +2 -2
  93. package/dist/cli-bundle/chunks/{chunk-DGJF32JF.js → chunk-FIGXOCEQ.js} +66 -21
  94. package/dist/cli-bundle/chunks/chunk-FIGXOCEQ.js.map +7 -0
  95. package/dist/cli-bundle/chunks/{chunk-RQAY7C5T.js → chunk-FJZDA6MS.js} +3 -3
  96. package/dist/cli-bundle/chunks/{chunk-B4TVNGRX.js → chunk-FO7GMJKG.js} +3 -3
  97. package/dist/cli-bundle/chunks/chunk-FRQ63VPB.js +5 -0
  98. package/dist/cli-bundle/chunks/{chunk-UTYNQ2WH.js → chunk-FS6UM5WH.js} +48 -27
  99. package/dist/cli-bundle/chunks/chunk-FS6UM5WH.js.map +7 -0
  100. package/dist/cli-bundle/chunks/{chunk-U252II47.js → chunk-FTQLW4JD.js} +4 -4
  101. package/dist/cli-bundle/chunks/{chunk-TNGLCRKS.js → chunk-GSEADLRH.js} +1821 -1809
  102. package/dist/cli-bundle/chunks/chunk-GSEADLRH.js.map +1 -0
  103. package/dist/cli-bundle/chunks/{chunk-TGG7YGMC.js → chunk-GXXC7QSK.js} +53 -47
  104. package/dist/cli-bundle/chunks/chunk-GXXC7QSK.js.map +1 -0
  105. package/dist/cli-bundle/chunks/{chunk-AGD4VZXH.js → chunk-H2QBAKLQ.js} +3 -3
  106. package/dist/cli-bundle/chunks/{chunk-CJVQ4XIG.js → chunk-HAMLIWAF.js} +4 -4
  107. package/dist/cli-bundle/chunks/{chunk-56DX6QYG.js → chunk-HL7V2PHX.js} +19 -13
  108. package/dist/cli-bundle/chunks/chunk-HL7V2PHX.js.map +1 -0
  109. package/dist/cli-bundle/chunks/{chunk-7QOIQTPB.js → chunk-HLHSQ5CA.js} +4 -4
  110. package/dist/cli-bundle/chunks/{chunk-AHC7J6XD.js → chunk-IA3YFTXT.js} +6 -6
  111. package/dist/cli-bundle/chunks/{chunk-5ZCVF4WF.js → chunk-IAPHYPRL.js} +2 -2
  112. package/dist/cli-bundle/chunks/{chunk-OCSQWIOW.js → chunk-IFZA4VB5.js} +4 -4
  113. package/dist/cli-bundle/chunks/{chunk-6O2HJENY.js → chunk-IGED7NH2.js} +61 -48
  114. package/dist/cli-bundle/chunks/chunk-IGED7NH2.js.map +7 -0
  115. package/dist/cli-bundle/chunks/{chunk-RPCCQDG2.js → chunk-ILLUE5DI.js} +36 -14
  116. package/dist/cli-bundle/chunks/chunk-ILLUE5DI.js.map +7 -0
  117. package/dist/cli-bundle/chunks/{chunk-4WMFM77X.js → chunk-J4NZOP3I.js} +5 -5
  118. package/dist/cli-bundle/chunks/{chunk-57JVERX3.js → chunk-JAF4TUQ7.js} +4 -4
  119. package/dist/cli-bundle/chunks/chunk-JAF4TUQ7.js.map +7 -0
  120. package/dist/cli-bundle/chunks/{chunk-MTNKSSSO.js → chunk-JL7WZ4O2.js} +3 -3
  121. package/dist/cli-bundle/chunks/{chunk-AZ52LTCY.js → chunk-K7WNZ7KD.js} +3 -3
  122. package/dist/cli-bundle/chunks/{chunk-2OLSXXIV.js → chunk-KADLSPIU.js} +4 -4
  123. package/dist/cli-bundle/chunks/{chunk-RQKORMM4.js → chunk-KB726FMH.js} +4 -4
  124. package/dist/cli-bundle/chunks/{chunk-WKSFBBZT.js → chunk-L24HCJFC.js} +114 -25
  125. package/dist/cli-bundle/chunks/chunk-L24HCJFC.js.map +1 -0
  126. package/dist/cli-bundle/chunks/{chunk-LDO24J5I.js → chunk-LWTIRS3Y.js} +365 -43
  127. package/dist/cli-bundle/chunks/chunk-LWTIRS3Y.js.map +7 -0
  128. package/dist/cli-bundle/chunks/{chunk-TZTQ4TVV.js → chunk-M6ASXYCU.js} +4 -4
  129. package/dist/cli-bundle/chunks/{chunk-WDDOAU7Z.js → chunk-M7EWN4TF.js} +3 -3
  130. package/dist/cli-bundle/chunks/{chunk-327DSGW2.js → chunk-MD6ULIPJ.js} +3 -3
  131. package/dist/cli-bundle/chunks/{chunk-OKDBHOON.js → chunk-MKL4CP2I.js} +61 -48
  132. package/dist/cli-bundle/chunks/chunk-MKL4CP2I.js.map +1 -0
  133. package/dist/cli-bundle/chunks/{chunk-M52DG2QJ.js → chunk-MQZ3PLCF.js} +2 -2
  134. package/dist/cli-bundle/chunks/{chunk-GQ2CQNGI.js → chunk-N3CMP4NI.js} +2 -2
  135. package/dist/cli-bundle/chunks/{chunk-J7SBFUZC.js → chunk-NAQYVWSQ.js} +4 -4
  136. package/dist/cli-bundle/chunks/{chunk-U2GMYP3L.js → chunk-NKW36AMT.js} +4 -4
  137. package/dist/cli-bundle/chunks/{chunk-5WEYOVZ7.js → chunk-OBDLEQG5.js} +19 -12
  138. package/dist/cli-bundle/chunks/chunk-OBDLEQG5.js.map +7 -0
  139. package/dist/cli-bundle/chunks/{chunk-VL4LYTJN.js → chunk-OI4S4KCI.js} +18 -12
  140. package/dist/cli-bundle/chunks/chunk-OI4S4KCI.js.map +7 -0
  141. package/dist/cli-bundle/chunks/{chunk-FCVVMAEX.js → chunk-P6MYFH6K.js} +60 -22
  142. package/dist/cli-bundle/chunks/chunk-P6MYFH6K.js.map +1 -0
  143. package/dist/cli-bundle/chunks/{chunk-FTQQAPRX.js → chunk-PHKP3AGR.js} +8 -8
  144. package/dist/cli-bundle/chunks/{chunk-WVUXNIYO.js → chunk-Q37E63AM.js} +4 -4
  145. package/dist/cli-bundle/chunks/{chunk-JVXV7ANV.js → chunk-Q7E6OYZK.js} +2 -2
  146. package/dist/cli-bundle/chunks/{chunk-WVUYATII.js → chunk-QABYZYLU.js} +4 -4
  147. package/dist/cli-bundle/chunks/{chunk-QRRUGIJN.js → chunk-QASRVKUQ.js} +45 -45
  148. package/dist/cli-bundle/chunks/chunk-QASRVKUQ.js.map +1 -0
  149. package/dist/cli-bundle/chunks/{chunk-L4262MFB.js → chunk-QK2ZN6UL.js} +14 -5
  150. package/dist/cli-bundle/chunks/{chunk-L4262MFB.js.map → chunk-QK2ZN6UL.js.map} +1 -1
  151. package/dist/cli-bundle/chunks/{chunk-7TQPV7HR.js → chunk-QSPARJWF.js} +2 -2
  152. package/dist/cli-bundle/chunks/{chunk-GTKILM6F.js → chunk-QZ7LT3XE.js} +3 -3
  153. package/dist/cli-bundle/chunks/{chunk-L3VKY6R6.js → chunk-RA5AIAMP.js} +3 -3
  154. package/dist/cli-bundle/chunks/{chunk-BJS27ALI.js → chunk-RGXD5JJR.js} +6 -6
  155. package/dist/cli-bundle/chunks/{chunk-TSEPW2P6.js → chunk-RMF3IOYQ.js} +7 -7
  156. package/dist/cli-bundle/chunks/{chunk-QXYKH56X.js → chunk-T4BRCB6Z.js} +1894 -1875
  157. package/dist/cli-bundle/chunks/chunk-T4BRCB6Z.js.map +7 -0
  158. package/dist/cli-bundle/chunks/{chunk-TGGTXC52.js → chunk-TH7U4KLY.js} +3 -3
  159. package/dist/cli-bundle/chunks/{chunk-LP4UATP6.js → chunk-TWLDBKQU.js} +3 -3
  160. package/dist/cli-bundle/chunks/{chunk-OTZ3C2NE.js → chunk-TZ2PSLLT.js} +49 -28
  161. package/dist/cli-bundle/chunks/chunk-TZ2PSLLT.js.map +1 -0
  162. package/dist/cli-bundle/chunks/{chunk-UK222BHQ.js → chunk-TZRTLMWM.js} +4 -4
  163. package/dist/cli-bundle/chunks/{chunk-6E6S2X6S.js → chunk-UB2QYSTO.js} +8 -8
  164. package/dist/cli-bundle/chunks/{chunk-S6CXUSYC.js → chunk-UGTVWL3E.js} +5 -5
  165. package/dist/cli-bundle/chunks/{chunk-BNS6QHTZ.js → chunk-UJ4HJYWL.js} +2 -2
  166. package/dist/cli-bundle/chunks/{chunk-BYVOEJPQ.js → chunk-UKUIIBDW.js} +4 -4
  167. package/dist/cli-bundle/chunks/{chunk-SGDBVR7X.js → chunk-UVBA6F5A.js} +2 -2
  168. package/dist/cli-bundle/chunks/{chunk-DZRZMBBF.js → chunk-VJTAEIPC.js} +5 -5
  169. package/dist/cli-bundle/chunks/{chunk-74PWVJON.js → chunk-W6HZ55JO.js} +2 -2
  170. package/dist/cli-bundle/chunks/{chunk-HR2MQAO5.js → chunk-WD6MSYMP.js} +13 -4
  171. package/dist/cli-bundle/chunks/{chunk-HR2MQAO5.js.map → chunk-WD6MSYMP.js.map} +2 -2
  172. package/dist/cli-bundle/chunks/{chunk-P7IFURWH.js → chunk-WPAWZW7S.js} +2 -2
  173. package/dist/cli-bundle/chunks/{chunk-36LEOWSX.js → chunk-WQUEHPZB.js} +2 -2
  174. package/dist/cli-bundle/chunks/{chunk-FCKJF7G2.js → chunk-WRKB56FC.js} +3 -3
  175. package/dist/cli-bundle/chunks/{chunk-KR5EHAN4.js → chunk-X3GYR4P2.js} +2 -2
  176. package/dist/cli-bundle/chunks/{chunk-J567OZJY.js → chunk-X6BVXQ52.js} +16 -12
  177. package/dist/cli-bundle/chunks/chunk-X6BVXQ52.js.map +1 -0
  178. package/dist/cli-bundle/chunks/chunk-Y72FV7RM.js +178 -0
  179. package/dist/cli-bundle/chunks/chunk-Y72FV7RM.js.map +7 -0
  180. package/dist/cli-bundle/chunks/{chunk-OWW2KXOV.js → chunk-YQYG2V23.js} +2 -2
  181. package/dist/cli-bundle/chunks/{chunk-G2SCT7BC.js → chunk-YVKE5ZDM.js} +4 -4
  182. package/dist/cli-bundle/chunks/{chunk-QHIN4UTF.js → chunk-ZAYYDNB3.js} +4 -4
  183. package/dist/cli-bundle/chunks/chunk-ZHBI2AP7.js +9 -0
  184. package/dist/cli-bundle/chunks/chunk-ZNP64HOW.js +175 -0
  185. package/dist/cli-bundle/chunks/chunk-ZNP64HOW.js.map +1 -0
  186. package/dist/cli-bundle/chunks/{chunk-GNVBUNJQ.js → chunk-ZTRBSABY.js} +3 -3
  187. package/dist/cli-bundle/chunks/{chunk-PY32KGQU.js → chunk-ZUKSZVBW.js} +5 -5
  188. package/dist/cli-bundle/chunks/{close-CU56F47E.js → close-LZECOMHO.js} +5 -5
  189. package/dist/cli-bundle/chunks/close-RI4JQQHU.js +12 -0
  190. package/dist/cli-bundle/chunks/close-many-LY2XJ52M.js +21 -0
  191. package/dist/cli-bundle/chunks/{close-many-ZQ2WP67J.js → close-many-ZHI6A5TN.js} +12 -12
  192. package/dist/cli-bundle/chunks/comments-35M273DN.js +13 -0
  193. package/dist/cli-bundle/chunks/{comments-UDUMKXL6.js → comments-AJWRTFZ5.js} +7 -7
  194. package/dist/cli-bundle/chunks/{copy-VFHECFBV.js → copy-GMXYKBXT.js} +4 -4
  195. package/dist/cli-bundle/chunks/copy-NPYM7M7U.js +9 -0
  196. package/dist/cli-bundle/chunks/create-F53OBTOU.js +27 -0
  197. package/dist/cli-bundle/chunks/{create-CE2X3SGF.js → create-HU4Q7RJX.js} +11 -9
  198. package/dist/cli-bundle/chunks/{delete-2JXQCHHT.js → delete-GSDZLTRC.js} +4 -4
  199. package/dist/cli-bundle/chunks/delete-ODRWJWAM.js +10 -0
  200. package/dist/cli-bundle/chunks/deps-U57I7EAK.js +16 -0
  201. package/dist/cli-bundle/chunks/{deps-FPXNLO6C.js → deps-WWB7P2GT.js} +7 -4
  202. package/dist/cli-bundle/chunks/docs-G7N4E2JO.js +14 -0
  203. package/dist/cli-bundle/chunks/{docs-AMAR4OHU.js → docs-MQIY2ZQS.js} +7 -7
  204. package/dist/cli-bundle/chunks/files-TBZD7V6H.js +18 -0
  205. package/dist/cli-bundle/chunks/{files-JFHN7DYM.js → files-TTY6N2AV.js} +7 -7
  206. package/dist/cli-bundle/chunks/focus-U5TRVCRS.js +10 -0
  207. package/dist/cli-bundle/chunks/{focus-QFN2RRZ7.js → focus-XT6YVFFX.js} +5 -5
  208. package/dist/cli-bundle/chunks/{history-compact-G34XMABV.js → history-compact-KKVUWB4V.js} +8 -8
  209. package/dist/cli-bundle/chunks/{history-compact-SAHT5D46.js → history-compact-M7GHYVFN.js} +8 -8
  210. package/dist/cli-bundle/chunks/{history-redact-IFJDNKLZ.js → history-redact-3DVZOILD.js} +6 -6
  211. package/dist/cli-bundle/chunks/history-redact-JIHZLHDP.js +16 -0
  212. package/dist/cli-bundle/chunks/{history-repair-NXLQTCVN.js → history-repair-ITDUMK4N.js} +8 -8
  213. package/dist/cli-bundle/chunks/history-repair-NAFCHLH7.js +18 -0
  214. package/dist/cli-bundle/chunks/{learnings-5CZKAMBS.js → learnings-FGO3NSFW.js} +7 -7
  215. package/dist/cli-bundle/chunks/learnings-SONGPSHI.js +13 -0
  216. package/dist/cli-bundle/chunks/notes-BSD53H2W.js +13 -0
  217. package/dist/cli-bundle/chunks/{notes-POMK37UI.js → notes-NQ6RXVW6.js} +7 -7
  218. package/dist/cli-bundle/chunks/{plan-YBNYNT3A.js → plan-2NNEO46V.js} +10 -10
  219. package/dist/cli-bundle/chunks/plan-AWLYGBNV.js +24 -0
  220. package/dist/cli-bundle/chunks/{profile-JNKSU6EQ.js → profile-AAQUU6T3.js} +9 -9
  221. package/dist/cli-bundle/chunks/{profile-A2WPVG6I.js → profile-U725ATWZ.js} +9 -9
  222. package/dist/cli-bundle/chunks/{register-list-query-UG4ZA5AU.js → register-list-query-BUWCYHBT.js} +14 -13
  223. package/dist/cli-bundle/chunks/{register-list-query-UG4ZA5AU.js.map → register-list-query-BUWCYHBT.js.map} +1 -1
  224. package/dist/cli-bundle/chunks/{register-list-query-KJULL4W3.js → register-list-query-KTZ6AGE7.js} +16 -15
  225. package/dist/cli-bundle/chunks/{register-list-query-KJULL4W3.js.map → register-list-query-KTZ6AGE7.js.map} +1 -1
  226. package/dist/cli-bundle/chunks/{register-mutation-3OXYXBKH.js → register-mutation-4FMGJJF7.js} +29 -29
  227. package/dist/cli-bundle/chunks/{register-mutation-WK265BM7.js → register-mutation-UELYYOR7.js} +29 -29
  228. package/dist/cli-bundle/chunks/{register-operations-C5SQH3FJ.js → register-operations-ISUX6LY5.js} +33 -29
  229. package/dist/cli-bundle/chunks/{register-operations-C5SQH3FJ.js.map → register-operations-ISUX6LY5.js.map} +1 -1
  230. package/dist/cli-bundle/chunks/{register-operations-FH3PBHYN.js → register-operations-JVW24J2Y.js} +35 -31
  231. package/dist/cli-bundle/chunks/{register-operations-FH3PBHYN.js.map → register-operations-JVW24J2Y.js.map} +1 -1
  232. package/dist/cli-bundle/chunks/{register-setup-CCK7CJVR.js → register-setup-5XNGKJ22.js} +15 -15
  233. package/dist/cli-bundle/chunks/{register-setup-CPZBGSOJ.js → register-setup-ZTNY6S7R.js} +15 -15
  234. package/dist/cli-bundle/chunks/restore-66GLMHIX.js +14 -0
  235. package/dist/cli-bundle/chunks/{restore-IVS5XGYR.js → restore-B3BAB6X2.js} +6 -6
  236. package/dist/cli-bundle/chunks/{schema-P2MF23JO.js → schema-LZNUYHDB.js} +6 -6
  237. package/dist/cli-bundle/chunks/schema-LZNUYHDB.js.map +7 -0
  238. package/dist/cli-bundle/chunks/{schema-R3U2REY4.js → schema-U7IM2DXV.js} +6 -6
  239. package/dist/cli-bundle/chunks/schema-U7IM2DXV.js.map +1 -0
  240. package/dist/cli-bundle/chunks/update-2XGHIVQ2.js +21 -0
  241. package/dist/cli-bundle/chunks/update-2XGHIVQ2.js.map +7 -0
  242. package/dist/cli-bundle/chunks/{update-YBIQESMH.js → update-Q3UCILNR.js} +12 -12
  243. package/dist/cli-bundle/chunks/update-Q3UCILNR.js.map +1 -0
  244. package/dist/cli-bundle/chunks/{update-many-F3CIV5SQ.js → update-many-75K57FS3.js} +19 -19
  245. package/dist/cli-bundle/chunks/update-many-75K57FS3.js.map +1 -0
  246. package/dist/cli-bundle/chunks/update-many-U42YA445.js +30 -0
  247. package/dist/cli-bundle/chunks/update-many-U42YA445.js.map +7 -0
  248. package/dist/cli-bundle/main.js +39 -16
  249. package/dist/cli-bundle/main.js.map +2 -2
  250. package/dist/cli-bundle/sdk-runtime.js +56 -53
  251. package/dist/cli-bundle/sdk-testing.js +6 -6
  252. package/dist/cli-bundle/sdk.js +115 -55
  253. package/dist/cli-bundle/sdk.js.map +2 -2
  254. package/dist/core/extensions/command-hook-context.d.ts +40 -0
  255. package/dist/core/extensions/command-hook-context.js +14 -0
  256. package/dist/core/extensions/command-hook-context.js.map +1 -0
  257. package/dist/core/extensions/index.d.ts +1 -0
  258. package/dist/core/extensions/index.js +4 -3
  259. package/dist/core/extensions/index.js.map +1 -1
  260. package/dist/core/item/parse.d.ts +2 -0
  261. package/dist/core/item/parse.js +11 -2
  262. package/dist/core/item/parse.js.map +1 -1
  263. package/dist/core/store/paths.d.ts +2 -0
  264. package/dist/core/store/paths.js +10 -2
  265. package/dist/core/store/paths.js.map +1 -1
  266. package/dist/mcp/tool-definitions.js +12 -2
  267. package/dist/mcp/tool-definitions.js.map +1 -1
  268. package/dist/sdk/context-packing.d.ts +114 -0
  269. package/dist/sdk/context-packing.js +219 -0
  270. package/dist/sdk/context-packing.js.map +1 -0
  271. package/dist/sdk/context-relevance.d.ts +1 -1
  272. package/dist/sdk/context-relevance.js +4 -2
  273. package/dist/sdk/context-relevance.js.map +1 -1
  274. package/dist/sdk/context-usage.d.ts +79 -0
  275. package/dist/sdk/context-usage.js +193 -0
  276. package/dist/sdk/context-usage.js.map +1 -0
  277. package/dist/sdk/dependencies.d.ts +145 -0
  278. package/dist/sdk/dependencies.js +327 -0
  279. package/dist/sdk/dependencies.js.map +1 -0
  280. package/dist/sdk/docs.d.ts +48 -0
  281. package/dist/sdk/docs.js +15 -0
  282. package/dist/sdk/docs.js.map +1 -0
  283. package/dist/sdk/files.d.ts +135 -0
  284. package/dist/sdk/files.js +320 -0
  285. package/dist/sdk/files.js.map +1 -0
  286. package/dist/sdk/index.d.ts +6 -0
  287. package/dist/sdk/index.js +8 -2
  288. package/dist/sdk/index.js.map +1 -1
  289. package/dist/{cli/commands → sdk}/linked-artifacts.d.ts +11 -5
  290. package/dist/{cli/commands → sdk}/linked-artifacts.js +49 -25
  291. package/dist/sdk/linked-artifacts.js.map +1 -0
  292. package/dist/sdk/runtime.d.ts +4 -4
  293. package/dist/sdk/runtime.js +7 -4
  294. package/dist/sdk/runtime.js.map +1 -1
  295. package/dist/sdk/workspace.js +3 -2
  296. package/dist/sdk/workspace.js.map +1 -1
  297. package/docs/AGENT_GUIDE.md +1 -1
  298. package/docs/CONFIGURATION.md +1 -0
  299. package/docs/PR_REVIEW_LOOP.md +21 -11
  300. package/docs/SDK.md +94 -0
  301. package/marketplace.json +2 -2
  302. package/package.json +1 -1
  303. package/packages/pm-beads/package.json +1 -1
  304. package/packages/pm-calendar/package.json +1 -1
  305. package/packages/pm-command-kit/package.json +1 -1
  306. package/packages/pm-governance-audit/package.json +1 -1
  307. package/packages/pm-guide-shell/package.json +1 -1
  308. package/packages/pm-kanban/package.json +1 -1
  309. package/packages/pm-lifecycle-hooks/package.json +1 -1
  310. package/packages/pm-linked-test-adapters/package.json +1 -1
  311. package/packages/pm-search-advanced/package.json +1 -1
  312. package/packages/pm-templates/package.json +1 -1
  313. package/packages/pm-todos/package.json +1 -1
  314. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  315. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  316. package/dist/cli/commands/linked-artifacts.js.map +0 -1
  317. package/dist/cli-bundle/chunks/append-CTKFDEAX.js +0 -11
  318. package/dist/cli-bundle/chunks/chunk-56DX6QYG.js.map +0 -1
  319. package/dist/cli-bundle/chunks/chunk-57JVERX3.js.map +0 -7
  320. package/dist/cli-bundle/chunks/chunk-5WEYOVZ7.js.map +0 -7
  321. package/dist/cli-bundle/chunks/chunk-6O2HJENY.js.map +0 -7
  322. package/dist/cli-bundle/chunks/chunk-CCAGZCZK.js +0 -17
  323. package/dist/cli-bundle/chunks/chunk-CCAGZCZK.js.map +0 -7
  324. package/dist/cli-bundle/chunks/chunk-D2LXG7WX.js.map +0 -1
  325. package/dist/cli-bundle/chunks/chunk-DGJF32JF.js.map +0 -7
  326. package/dist/cli-bundle/chunks/chunk-FCVVMAEX.js.map +0 -1
  327. package/dist/cli-bundle/chunks/chunk-FUOK7JZ6.js +0 -14
  328. package/dist/cli-bundle/chunks/chunk-FUOK7JZ6.js.map +0 -1
  329. package/dist/cli-bundle/chunks/chunk-G3IB5GTD.js.map +0 -7
  330. package/dist/cli-bundle/chunks/chunk-J567OZJY.js.map +0 -1
  331. package/dist/cli-bundle/chunks/chunk-LDO24J5I.js.map +0 -7
  332. package/dist/cli-bundle/chunks/chunk-NA5SBIB4.js.map +0 -7
  333. package/dist/cli-bundle/chunks/chunk-OKDBHOON.js.map +0 -1
  334. package/dist/cli-bundle/chunks/chunk-OMT4NO7T.js.map +0 -7
  335. package/dist/cli-bundle/chunks/chunk-OTZ3C2NE.js.map +0 -1
  336. package/dist/cli-bundle/chunks/chunk-QRRUGIJN.js.map +0 -1
  337. package/dist/cli-bundle/chunks/chunk-QXYKH56X.js.map +0 -7
  338. package/dist/cli-bundle/chunks/chunk-RKGFUC4O.js.map +0 -1
  339. package/dist/cli-bundle/chunks/chunk-RPCCQDG2.js.map +0 -7
  340. package/dist/cli-bundle/chunks/chunk-TGG7YGMC.js.map +0 -1
  341. package/dist/cli-bundle/chunks/chunk-TNGLCRKS.js.map +0 -1
  342. package/dist/cli-bundle/chunks/chunk-UTYNQ2WH.js.map +0 -7
  343. package/dist/cli-bundle/chunks/chunk-VL4LYTJN.js.map +0 -7
  344. package/dist/cli-bundle/chunks/chunk-VLFLRFJP.js.map +0 -1
  345. package/dist/cli-bundle/chunks/chunk-WKSFBBZT.js.map +0 -1
  346. package/dist/cli-bundle/chunks/chunk-XY3CC3EM.js.map +0 -7
  347. package/dist/cli-bundle/chunks/chunk-ZTSV7P2T.js.map +0 -1
  348. package/dist/cli-bundle/chunks/close-BWM7FTF4.js +0 -12
  349. package/dist/cli-bundle/chunks/close-many-AUHTVFUQ.js +0 -21
  350. package/dist/cli-bundle/chunks/comments-7D5VPBZI.js +0 -13
  351. package/dist/cli-bundle/chunks/copy-QJ6ZVWZV.js +0 -9
  352. package/dist/cli-bundle/chunks/create-FGMTTYOI.js +0 -25
  353. package/dist/cli-bundle/chunks/delete-L2GMMMPR.js +0 -10
  354. package/dist/cli-bundle/chunks/deps-KTFI4RWD.js +0 -13
  355. package/dist/cli-bundle/chunks/docs-VNURA275.js +0 -14
  356. package/dist/cli-bundle/chunks/files-UNFPZLTG.js +0 -18
  357. package/dist/cli-bundle/chunks/focus-MI2UHBP4.js +0 -10
  358. package/dist/cli-bundle/chunks/history-redact-VAHGBUHI.js +0 -16
  359. package/dist/cli-bundle/chunks/history-repair-DDYQXR43.js +0 -18
  360. package/dist/cli-bundle/chunks/learnings-VWJEKHEO.js +0 -13
  361. package/dist/cli-bundle/chunks/notes-NGVJJJQO.js +0 -13
  362. package/dist/cli-bundle/chunks/plan-U6SQJUFI.js +0 -24
  363. package/dist/cli-bundle/chunks/restore-AX6ZMGHZ.js +0 -14
  364. package/dist/cli-bundle/chunks/update-XYHF3YZF.js +0 -21
  365. package/dist/cli-bundle/chunks/update-many-5HKVHFUL.js +0 -30
  366. /package/dist/cli-bundle/chunks/{append-CTKFDEAX.js.map → append-DYQWQK2J.js.map} +0 -0
  367. /package/dist/cli-bundle/chunks/{append-2FS6MVG7.js.map → append-PVZJDM6J.js.map} +0 -0
  368. /package/dist/cli-bundle/chunks/{chunk-J2WAWP4U.js.map → chunk-2FNWQXZ2.js.map} +0 -0
  369. /package/dist/cli-bundle/chunks/{chunk-YFGYDZRP.js.map → chunk-2GA3NK35.js.map} +0 -0
  370. /package/dist/cli-bundle/chunks/{chunk-XFEIASAC.js.map → chunk-2QIQGYPW.js.map} +0 -0
  371. /package/dist/cli-bundle/chunks/{chunk-3WCGYH5Q.js.map → chunk-3CMRNVTO.js.map} +0 -0
  372. /package/dist/cli-bundle/chunks/{close-BWM7FTF4.js.map → chunk-3HKUXVKV.js.map} +0 -0
  373. /package/dist/cli-bundle/chunks/{chunk-VDAZPPRU.js.map → chunk-3I3LRT2G.js.map} +0 -0
  374. /package/dist/cli-bundle/chunks/{chunk-3P3RFJIQ.js.map → chunk-3TL7WOEF.js.map} +0 -0
  375. /package/dist/cli-bundle/chunks/{chunk-4SHJ5JS3.js.map → chunk-44LNIULG.js.map} +0 -0
  376. /package/dist/cli-bundle/chunks/{chunk-BVCF4ULV.js.map → chunk-4RXTMU57.js.map} +0 -0
  377. /package/dist/cli-bundle/chunks/{chunk-XMI2TRY5.js.map → chunk-4WREH7RT.js.map} +0 -0
  378. /package/dist/cli-bundle/chunks/{chunk-JYUGUXFW.js.map → chunk-5CT5BW6E.js.map} +0 -0
  379. /package/dist/cli-bundle/chunks/{chunk-QGH6WL6L.js.map → chunk-655STMGA.js.map} +0 -0
  380. /package/dist/cli-bundle/chunks/{chunk-DGKBWCMA.js.map → chunk-6IIVBC56.js.map} +0 -0
  381. /package/dist/cli-bundle/chunks/{chunk-D4GPNYYP.js.map → chunk-6OTZMORS.js.map} +0 -0
  382. /package/dist/cli-bundle/chunks/{chunk-JVRVXO6M.js.map → chunk-6PKA3SJQ.js.map} +0 -0
  383. /package/dist/cli-bundle/chunks/{close-many-AUHTVFUQ.js.map → chunk-6X5MZ5R2.js.map} +0 -0
  384. /package/dist/cli-bundle/chunks/{close-CU56F47E.js.map → chunk-76UBY2EE.js.map} +0 -0
  385. /package/dist/cli-bundle/chunks/{chunk-ZS2KPCJN.js.map → chunk-7QDSYUMF.js.map} +0 -0
  386. /package/dist/cli-bundle/chunks/{chunk-Z7TFPIJ6.js.map → chunk-7TQMR6LK.js.map} +0 -0
  387. /package/dist/cli-bundle/chunks/{chunk-AHA4POA6.js.map → chunk-ABRCOSDC.js.map} +0 -0
  388. /package/dist/cli-bundle/chunks/{chunk-KQJVTQVK.js.map → chunk-ANSJHDOZ.js.map} +0 -0
  389. /package/dist/cli-bundle/chunks/{close-many-ZQ2WP67J.js.map → chunk-B7SWOIP6.js.map} +0 -0
  390. /package/dist/cli-bundle/chunks/{chunk-HXTCZSAI.js.map → chunk-DBZVUJTK.js.map} +0 -0
  391. /package/dist/cli-bundle/chunks/{chunk-2QNOWOIB.js.map → chunk-DO5RGJXT.js.map} +0 -0
  392. /package/dist/cli-bundle/chunks/{chunk-MKONZ4UO.js.map → chunk-DRNJPEPQ.js.map} +0 -0
  393. /package/dist/cli-bundle/chunks/{chunk-H36FXA7B.js.map → chunk-DYEX6NFH.js.map} +0 -0
  394. /package/dist/cli-bundle/chunks/{chunk-GAJ7U7B4.js.map → chunk-ERL2YFJ2.js.map} +0 -0
  395. /package/dist/cli-bundle/chunks/{chunk-FPEYOFEF.js.map → chunk-F7PSHRNO.js.map} +0 -0
  396. /package/dist/cli-bundle/chunks/{chunk-UH7OLT6F.js.map → chunk-FDSBDNYE.js.map} +0 -0
  397. /package/dist/cli-bundle/chunks/{chunk-RQAY7C5T.js.map → chunk-FJZDA6MS.js.map} +0 -0
  398. /package/dist/cli-bundle/chunks/{chunk-B4TVNGRX.js.map → chunk-FO7GMJKG.js.map} +0 -0
  399. /package/dist/cli-bundle/chunks/{comments-UDUMKXL6.js.map → chunk-FRQ63VPB.js.map} +0 -0
  400. /package/dist/cli-bundle/chunks/{chunk-U252II47.js.map → chunk-FTQLW4JD.js.map} +0 -0
  401. /package/dist/cli-bundle/chunks/{chunk-AGD4VZXH.js.map → chunk-H2QBAKLQ.js.map} +0 -0
  402. /package/dist/cli-bundle/chunks/{chunk-CJVQ4XIG.js.map → chunk-HAMLIWAF.js.map} +0 -0
  403. /package/dist/cli-bundle/chunks/{chunk-7QOIQTPB.js.map → chunk-HLHSQ5CA.js.map} +0 -0
  404. /package/dist/cli-bundle/chunks/{chunk-AHC7J6XD.js.map → chunk-IA3YFTXT.js.map} +0 -0
  405. /package/dist/cli-bundle/chunks/{chunk-5ZCVF4WF.js.map → chunk-IAPHYPRL.js.map} +0 -0
  406. /package/dist/cli-bundle/chunks/{chunk-OCSQWIOW.js.map → chunk-IFZA4VB5.js.map} +0 -0
  407. /package/dist/cli-bundle/chunks/{chunk-4WMFM77X.js.map → chunk-J4NZOP3I.js.map} +0 -0
  408. /package/dist/cli-bundle/chunks/{chunk-MTNKSSSO.js.map → chunk-JL7WZ4O2.js.map} +0 -0
  409. /package/dist/cli-bundle/chunks/{chunk-AZ52LTCY.js.map → chunk-K7WNZ7KD.js.map} +0 -0
  410. /package/dist/cli-bundle/chunks/{chunk-2OLSXXIV.js.map → chunk-KADLSPIU.js.map} +0 -0
  411. /package/dist/cli-bundle/chunks/{chunk-RQKORMM4.js.map → chunk-KB726FMH.js.map} +0 -0
  412. /package/dist/cli-bundle/chunks/{chunk-TZTQ4TVV.js.map → chunk-M6ASXYCU.js.map} +0 -0
  413. /package/dist/cli-bundle/chunks/{chunk-WDDOAU7Z.js.map → chunk-M7EWN4TF.js.map} +0 -0
  414. /package/dist/cli-bundle/chunks/{chunk-327DSGW2.js.map → chunk-MD6ULIPJ.js.map} +0 -0
  415. /package/dist/cli-bundle/chunks/{chunk-M52DG2QJ.js.map → chunk-MQZ3PLCF.js.map} +0 -0
  416. /package/dist/cli-bundle/chunks/{chunk-GQ2CQNGI.js.map → chunk-N3CMP4NI.js.map} +0 -0
  417. /package/dist/cli-bundle/chunks/{chunk-J7SBFUZC.js.map → chunk-NAQYVWSQ.js.map} +0 -0
  418. /package/dist/cli-bundle/chunks/{chunk-U2GMYP3L.js.map → chunk-NKW36AMT.js.map} +0 -0
  419. /package/dist/cli-bundle/chunks/{chunk-FTQQAPRX.js.map → chunk-PHKP3AGR.js.map} +0 -0
  420. /package/dist/cli-bundle/chunks/{chunk-WVUXNIYO.js.map → chunk-Q37E63AM.js.map} +0 -0
  421. /package/dist/cli-bundle/chunks/{chunk-JVXV7ANV.js.map → chunk-Q7E6OYZK.js.map} +0 -0
  422. /package/dist/cli-bundle/chunks/{chunk-WVUYATII.js.map → chunk-QABYZYLU.js.map} +0 -0
  423. /package/dist/cli-bundle/chunks/{chunk-7TQPV7HR.js.map → chunk-QSPARJWF.js.map} +0 -0
  424. /package/dist/cli-bundle/chunks/{chunk-GTKILM6F.js.map → chunk-QZ7LT3XE.js.map} +0 -0
  425. /package/dist/cli-bundle/chunks/{chunk-L3VKY6R6.js.map → chunk-RA5AIAMP.js.map} +0 -0
  426. /package/dist/cli-bundle/chunks/{chunk-BJS27ALI.js.map → chunk-RGXD5JJR.js.map} +0 -0
  427. /package/dist/cli-bundle/chunks/{chunk-TSEPW2P6.js.map → chunk-RMF3IOYQ.js.map} +0 -0
  428. /package/dist/cli-bundle/chunks/{chunk-TGGTXC52.js.map → chunk-TH7U4KLY.js.map} +0 -0
  429. /package/dist/cli-bundle/chunks/{chunk-LP4UATP6.js.map → chunk-TWLDBKQU.js.map} +0 -0
  430. /package/dist/cli-bundle/chunks/{chunk-UK222BHQ.js.map → chunk-TZRTLMWM.js.map} +0 -0
  431. /package/dist/cli-bundle/chunks/{chunk-6E6S2X6S.js.map → chunk-UB2QYSTO.js.map} +0 -0
  432. /package/dist/cli-bundle/chunks/{chunk-S6CXUSYC.js.map → chunk-UGTVWL3E.js.map} +0 -0
  433. /package/dist/cli-bundle/chunks/{chunk-BNS6QHTZ.js.map → chunk-UJ4HJYWL.js.map} +0 -0
  434. /package/dist/cli-bundle/chunks/{chunk-BYVOEJPQ.js.map → chunk-UKUIIBDW.js.map} +0 -0
  435. /package/dist/cli-bundle/chunks/{chunk-SGDBVR7X.js.map → chunk-UVBA6F5A.js.map} +0 -0
  436. /package/dist/cli-bundle/chunks/{chunk-DZRZMBBF.js.map → chunk-VJTAEIPC.js.map} +0 -0
  437. /package/dist/cli-bundle/chunks/{chunk-74PWVJON.js.map → chunk-W6HZ55JO.js.map} +0 -0
  438. /package/dist/cli-bundle/chunks/{chunk-P7IFURWH.js.map → chunk-WPAWZW7S.js.map} +0 -0
  439. /package/dist/cli-bundle/chunks/{chunk-36LEOWSX.js.map → chunk-WQUEHPZB.js.map} +0 -0
  440. /package/dist/cli-bundle/chunks/{chunk-FCKJF7G2.js.map → chunk-WRKB56FC.js.map} +0 -0
  441. /package/dist/cli-bundle/chunks/{chunk-KR5EHAN4.js.map → chunk-X3GYR4P2.js.map} +0 -0
  442. /package/dist/cli-bundle/chunks/{chunk-OWW2KXOV.js.map → chunk-YQYG2V23.js.map} +0 -0
  443. /package/dist/cli-bundle/chunks/{chunk-G2SCT7BC.js.map → chunk-YVKE5ZDM.js.map} +0 -0
  444. /package/dist/cli-bundle/chunks/{chunk-QHIN4UTF.js.map → chunk-ZAYYDNB3.js.map} +0 -0
  445. /package/dist/cli-bundle/chunks/{comments-7D5VPBZI.js.map → chunk-ZHBI2AP7.js.map} +0 -0
  446. /package/dist/cli-bundle/chunks/{chunk-GNVBUNJQ.js.map → chunk-ZTRBSABY.js.map} +0 -0
  447. /package/dist/cli-bundle/chunks/{chunk-PY32KGQU.js.map → chunk-ZUKSZVBW.js.map} +0 -0
  448. /package/dist/cli-bundle/chunks/{copy-VFHECFBV.js.map → close-LZECOMHO.js.map} +0 -0
  449. /package/dist/cli-bundle/chunks/{copy-QJ6ZVWZV.js.map → close-RI4JQQHU.js.map} +0 -0
  450. /package/dist/cli-bundle/chunks/{create-FGMTTYOI.js.map → close-many-LY2XJ52M.js.map} +0 -0
  451. /package/dist/cli-bundle/chunks/{create-CE2X3SGF.js.map → close-many-ZHI6A5TN.js.map} +0 -0
  452. /package/dist/cli-bundle/chunks/{delete-L2GMMMPR.js.map → comments-35M273DN.js.map} +0 -0
  453. /package/dist/cli-bundle/chunks/{delete-2JXQCHHT.js.map → comments-AJWRTFZ5.js.map} +0 -0
  454. /package/dist/cli-bundle/chunks/{deps-FPXNLO6C.js.map → copy-GMXYKBXT.js.map} +0 -0
  455. /package/dist/cli-bundle/chunks/{deps-KTFI4RWD.js.map → copy-NPYM7M7U.js.map} +0 -0
  456. /package/dist/cli-bundle/chunks/{docs-VNURA275.js.map → create-F53OBTOU.js.map} +0 -0
  457. /package/dist/cli-bundle/chunks/{docs-AMAR4OHU.js.map → create-HU4Q7RJX.js.map} +0 -0
  458. /package/dist/cli-bundle/chunks/{files-JFHN7DYM.js.map → delete-GSDZLTRC.js.map} +0 -0
  459. /package/dist/cli-bundle/chunks/{files-UNFPZLTG.js.map → delete-ODRWJWAM.js.map} +0 -0
  460. /package/dist/cli-bundle/chunks/{focus-MI2UHBP4.js.map → deps-U57I7EAK.js.map} +0 -0
  461. /package/dist/cli-bundle/chunks/{focus-QFN2RRZ7.js.map → deps-WWB7P2GT.js.map} +0 -0
  462. /package/dist/cli-bundle/chunks/{history-compact-SAHT5D46.js.map → docs-G7N4E2JO.js.map} +0 -0
  463. /package/dist/cli-bundle/chunks/{history-compact-G34XMABV.js.map → docs-MQIY2ZQS.js.map} +0 -0
  464. /package/dist/cli-bundle/chunks/{history-redact-VAHGBUHI.js.map → files-TBZD7V6H.js.map} +0 -0
  465. /package/dist/cli-bundle/chunks/{history-redact-IFJDNKLZ.js.map → files-TTY6N2AV.js.map} +0 -0
  466. /package/dist/cli-bundle/chunks/{history-repair-DDYQXR43.js.map → focus-U5TRVCRS.js.map} +0 -0
  467. /package/dist/cli-bundle/chunks/{history-repair-NXLQTCVN.js.map → focus-XT6YVFFX.js.map} +0 -0
  468. /package/dist/cli-bundle/chunks/{learnings-5CZKAMBS.js.map → history-compact-KKVUWB4V.js.map} +0 -0
  469. /package/dist/cli-bundle/chunks/{learnings-VWJEKHEO.js.map → history-compact-M7GHYVFN.js.map} +0 -0
  470. /package/dist/cli-bundle/chunks/{notes-POMK37UI.js.map → history-redact-3DVZOILD.js.map} +0 -0
  471. /package/dist/cli-bundle/chunks/{notes-NGVJJJQO.js.map → history-redact-JIHZLHDP.js.map} +0 -0
  472. /package/dist/cli-bundle/chunks/{plan-YBNYNT3A.js.map → history-repair-ITDUMK4N.js.map} +0 -0
  473. /package/dist/cli-bundle/chunks/{plan-U6SQJUFI.js.map → history-repair-NAFCHLH7.js.map} +0 -0
  474. /package/dist/cli-bundle/chunks/{profile-JNKSU6EQ.js.map → learnings-FGO3NSFW.js.map} +0 -0
  475. /package/dist/cli-bundle/chunks/{profile-A2WPVG6I.js.map → learnings-SONGPSHI.js.map} +0 -0
  476. /package/dist/cli-bundle/chunks/{restore-AX6ZMGHZ.js.map → notes-BSD53H2W.js.map} +0 -0
  477. /package/dist/cli-bundle/chunks/{restore-IVS5XGYR.js.map → notes-NQ6RXVW6.js.map} +0 -0
  478. /package/dist/cli-bundle/chunks/{schema-R3U2REY4.js.map → plan-2NNEO46V.js.map} +0 -0
  479. /package/dist/cli-bundle/chunks/{schema-P2MF23JO.js.map → plan-AWLYGBNV.js.map} +0 -0
  480. /package/dist/cli-bundle/chunks/{update-YBIQESMH.js.map → profile-AAQUU6T3.js.map} +0 -0
  481. /package/dist/cli-bundle/chunks/{update-XYHF3YZF.js.map → profile-U725ATWZ.js.map} +0 -0
  482. /package/dist/cli-bundle/chunks/{register-mutation-3OXYXBKH.js.map → register-mutation-4FMGJJF7.js.map} +0 -0
  483. /package/dist/cli-bundle/chunks/{register-mutation-WK265BM7.js.map → register-mutation-UELYYOR7.js.map} +0 -0
  484. /package/dist/cli-bundle/chunks/{register-setup-CCK7CJVR.js.map → register-setup-5XNGKJ22.js.map} +0 -0
  485. /package/dist/cli-bundle/chunks/{register-setup-CPZBGSOJ.js.map → register-setup-ZTNY6S7R.js.map} +0 -0
  486. /package/dist/cli-bundle/chunks/{update-many-5HKVHFUL.js.map → restore-66GLMHIX.js.map} +0 -0
  487. /package/dist/cli-bundle/chunks/{update-many-F3CIV5SQ.js.map → restore-B3BAB6X2.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]="6f51d218-2e3d-5794-b264-be91d2e7e30e")}catch(e){}}();
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]="09714dbd-c38d-58f3-bb28-ce6144e44f75")}catch(e){}}();
13
13
  import { collectBlockedByIds, computeActionabilityReport, } from "../../core/item/actionability.js";
14
14
  import { resolveRuntimeStatusRegistry, } from "../../core/schema/runtime-schema.js";
15
15
  import { EXIT_CODE } from "../../core/shared/constants.js";
@@ -19,9 +19,10 @@ import { normalizeStatusInput, normalizeStatusForRegistry, } from "../../core/it
19
19
  import { resolvePmRoot } from "../../core/store/paths.js";
20
20
  import { readSettings } from "../../core/store/settings.js";
21
21
  import { parseIntegerLimit } from "../shared-parsers.js";
22
- import { buildChildrenByParent, buildItemContextRelevanceCandidates, collectSubtreeIds, compareCriticalItems, toContextRankingSummary, toContextFocusItem, } from "./context.js";
22
+ import { buildChildrenByParent, buildItemContextRelevanceCandidates, collectSubtreeIds, compareCriticalItems, packRankedContextItems, toContextPackingSummary, toContextRankingSummary, toContextFocusItem, } from "./context.js";
23
23
  import { runList } from "./list.js";
24
24
  import { scoreContextCandidatesWithActiveExtensions } from "../../sdk/context-relevance.js";
25
+ import { readContextUsageAffinity, recordContextUsageServing, } from "../../sdk/context-usage.js";
25
26
  /** Supported values accepted by the next output contract. */
26
27
  export const NEXT_OUTPUT_VALUES = ["markdown", "toon", "json"];
27
28
  const DEFAULT_NEXT_LIMIT = 5;
@@ -222,6 +223,55 @@ function buildNextTruncation(decisionCount, heldCount, limit) {
222
223
  }
223
224
  return Object.keys(truncation).length > 0 ? truncation : undefined;
224
225
  }
226
+ async function attachNextUsageFeedback(params) {
227
+ try {
228
+ const included = new Set(params.packing.included.map((entry) => entry.id));
229
+ await recordContextUsageServing({
230
+ pmRoot: params.pmRoot,
231
+ author: params.author,
232
+ surface: "next",
233
+ profile: params.packing.profile,
234
+ rows: params.ranking.ranked.map((entry) => ({
235
+ id: entry.id,
236
+ rank: entry.rank,
237
+ included: included.has(entry.id),
238
+ })),
239
+ enabled: process.env.PM_CONTEXT_USAGE_DISABLED !== "1",
240
+ });
241
+ }
242
+ catch {
243
+ params.result.warnings = [
244
+ ...new Set([
245
+ ...(params.result.warnings ?? []),
246
+ "context_usage_feedback_write_failed",
247
+ ]),
248
+ ].sort((left, right) => left.localeCompare(right));
249
+ }
250
+ }
251
+ async function finalizeNextResult(params) {
252
+ const warnings = [
253
+ ...new Set([
254
+ ...(params.candidatesWarnings ?? []),
255
+ ...(params.corpusWarnings ?? []),
256
+ ...(params.readyRanking.warnings ?? []),
257
+ ]),
258
+ ].sort((left, right) => left.localeCompare(right));
259
+ if (warnings.length > 0)
260
+ params.result.warnings = warnings;
261
+ if (params.explainRanking) {
262
+ params.result.ranking = toContextRankingSummary(params.readyRanking);
263
+ params.result.packing = toContextPackingSummary(params.packing);
264
+ }
265
+ params.result.suggestions = buildNextSuggestions(params.recommended, params.blockedRows);
266
+ await attachNextUsageFeedback({
267
+ result: params.result,
268
+ pmRoot: params.pmRoot,
269
+ author: params.author,
270
+ packing: params.packing,
271
+ ranking: params.readyRanking,
272
+ });
273
+ return params.result;
274
+ }
225
275
  function filterCandidatesByParentScope(candidates, corpus, parentScope) {
226
276
  if (!parentScope) {
227
277
  return candidates;
@@ -232,10 +282,16 @@ function filterCandidatesByParentScope(candidates, corpus, parentScope) {
232
282
  }
233
283
  return candidates.filter((item) => subtree.ids.has(item.id.trim().toLowerCase()));
234
284
  }
235
- async function rankReadyEntriesWithRelevance(rankedReady, childrenByParent, statusRegistry, now, callerAuthor) {
285
+ async function rankReadyEntriesWithRelevance(rankedReady, childrenByParent, statusRegistry, now, callerAuthor, pmRoot, tokenBudget) {
236
286
  const concreteReady = rankedReady.filter((entry) => !hasCompletedDescendants(entry.item, childrenByParent));
237
287
  const structuralReady = concreteReady.length > 0 ? concreteReady : rankedReady;
238
- const ranking = await scoreContextCandidatesWithActiveExtensions("next", buildItemContextRelevanceCandidates(structuralReady.map((entry) => entry.item), statusRegistry, now, callerAuthor ?? process.env.PM_AUTHOR));
288
+ const usage = await readContextUsageAffinity({
289
+ pmRoot,
290
+ author: callerAuthor,
291
+ enabled: process.env.PM_CONTEXT_USAGE_DISABLED !== "1",
292
+ });
293
+ const ranking = await scoreContextCandidatesWithActiveExtensions("next", buildItemContextRelevanceCandidates(structuralReady.map((entry) => entry.item), statusRegistry, now, callerAuthor, usage.affinity));
294
+ const packing = packRankedContextItems(ranking, tokenBudget, new Set(), "next");
239
295
  const readyById = new Map(structuralReady.map((entry) => [entry.item.id, entry]));
240
296
  const projectedReady = ranking.ranked
241
297
  .map((entry) => readyById.get(entry.id))
@@ -244,12 +300,14 @@ async function rankReadyEntriesWithRelevance(rankedReady, childrenByParent, stat
244
300
  projectedReady,
245
301
  ranking,
246
302
  completedContainer: concreteReady.length === 0,
303
+ packing,
247
304
  };
248
305
  }
249
306
  /** Implements `pm next`: computes the ranked ready/blocked actionable queues and a single recommended next item with rationale for the public runtime surface. */
250
307
  export async function runNext(options, global) {
251
308
  const pmRoot = resolvePmRoot(process.cwd(), global.path);
252
309
  const settings = await readSettings(pmRoot);
310
+ const callerAuthor = options.callerAuthor ?? process.env.PM_AUTHOR ?? settings.author_default;
253
311
  const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);
254
312
  const now = nowIso();
255
313
  const limit = parseNextLimit(options.limit, "--limit", DEFAULT_NEXT_LIMIT);
@@ -268,10 +326,10 @@ export async function runNext(options, global) {
268
326
  const report = computeActionabilityReport(candidates, corpus, statusRegistry);
269
327
  const childrenByParent = buildChildrenByParent(corpus);
270
328
  const partitionedByDecision = partitionDecisionEntries(report.ready, options.includeDecisions === true);
271
- const callerPartition = partitionCallerOwnedReady(partitionedByDecision.agent, settings.author_default, options.callerAuthor);
329
+ const callerPartition = partitionCallerOwnedReady(partitionedByDecision.agent, settings.author_default, callerAuthor);
272
330
  const rankedReady = rankNextReadyEntries(callerPartition.available, childrenByParent, statusRegistry);
273
331
  const rankedBlocked = [...report.blocked].sort((left, right) => compareCriticalItems(left.item, right.item, statusRegistry));
274
- const { projectedReady, ranking: readyRanking, completedContainer, } = await rankReadyEntriesWithRelevance(rankedReady, childrenByParent, statusRegistry, now, options.callerAuthor);
332
+ const { projectedReady, ranking: readyRanking, completedContainer, packing: readyPacking, } = await rankReadyEntriesWithRelevance(rankedReady, childrenByParent, statusRegistry, now, callerAuthor, pmRoot, Math.max(192, limit * 128));
275
333
  const readyRows = projectedReady.map((entry, index) => toNextActionableItem(entry, statusRegistry, childrenByParent, index + 1));
276
334
  const blockedRows = rankedBlocked.map((entry, index) => toNextActionableItem(entry, statusRegistry, childrenByParent, index + 1));
277
335
  const decisionRows = rankNextReadyEntries(partitionedByDecision.decisions, childrenByParent, statusRegistry).map((entry, index) => toNextActionableItem(entry, statusRegistry, childrenByParent, index + 1));
@@ -317,19 +375,18 @@ export async function runNext(options, global) {
317
375
  },
318
376
  truncation,
319
377
  };
320
- const warnings = [
321
- ...new Set([
322
- ...(candidatesList.warnings ?? []),
323
- ...(corpusList.warnings ?? []),
324
- ...(readyRanking.warnings ?? []),
325
- ]),
326
- ].sort((a, b) => a.localeCompare(b));
327
- if (warnings.length > 0)
328
- result.warnings = warnings;
329
- if (options.explainRanking === true)
330
- result.ranking = toContextRankingSummary(readyRanking);
331
- result.suggestions = buildNextSuggestions(recommended, blockedRows);
332
- return result;
378
+ return finalizeNextResult({
379
+ result,
380
+ recommended,
381
+ blockedRows,
382
+ candidatesWarnings: candidatesList.warnings,
383
+ corpusWarnings: corpusList.warnings,
384
+ readyRanking,
385
+ explainRanking: options.explainRanking === true,
386
+ pmRoot,
387
+ author: callerAuthor,
388
+ packing: readyPacking,
389
+ });
333
390
  }
334
391
  /**
335
392
  * Renders a {@link NextResult} as compact agent-readable markdown: the
@@ -399,4 +456,4 @@ function formatNextLine(item) {
399
456
  return `${rankToken}${item.id} p${item.priority} ${item.status} ${item.type} deadline:${deadlineToken}${parentToken}${unblocksToken} ${item.title}`;
400
457
  }
401
458
  //# sourceMappingURL=next.js.map
402
- //# debugId=6f51d218-2e3d-5794-b264-be91d2e7e30e
459
+ //# debugId=09714dbd-c38d-58f3-bb28-ce6144e44f75
@@ -1 +1 @@
1
- {"version":3,"file":"next.js","sources":["cli/commands/next.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module cli/commands/next\n *\n * Implements the `pm next` command: the distilled \"what should I work on now?\"\n * query. It loads the active corpus, computes dependency-aware actionability\n * (ready vs blocked leaf work), and returns a single ranked recommendation with a\n * deterministic rationale plus the ranked ready/blocked queues — so an agent gets\n * the next action and the reason for it in one token-efficient read instead of\n * re-deriving readiness from a full `pm context` snapshot every turn.\n */\nimport {\n collectBlockedByIds,\n computeActionabilityReport,\n type ActionableEntry,\n} from \"../../core/item/actionability.js\";\nimport {\n resolveRuntimeStatusRegistry,\n type RuntimeStatusRegistry,\n} from \"../../core/schema/runtime-schema.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\nimport {\n normalizeStatusInput,\n normalizeStatusForRegistry,\n} from \"../../core/item/status.js\";\nimport { resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport type { ItemMetadata, ItemStatus } from \"../../types/index.js\";\nimport { parseIntegerLimit } from \"../shared-parsers.js\";\nimport {\n buildChildrenByParent,\n buildItemContextRelevanceCandidates,\n collectSubtreeIds,\n compareCriticalItems,\n toContextRankingSummary,\n toContextFocusItem,\n type ContextFocusItem,\n type ContextRankingSummary,\n} from \"./context.js\";\nimport { runList, type ListOptions } from \"./list.js\";\nimport { scoreContextCandidatesWithActiveExtensions } from \"../../sdk/context-relevance.js\";\n\n/** Supported values accepted by the next output contract. */\nexport const NEXT_OUTPUT_VALUES = [\"markdown\", \"toon\", \"json\"] as const;\n/** Restricts `pm next` output format values accepted by command, SDK, and storage contracts. */\nexport type NextOutputFormat = (typeof NEXT_OUTPUT_VALUES)[number];\n\nconst DEFAULT_NEXT_LIMIT = 5;\nconst MS_PER_DAY = 24 * 60 * 60 * 1000;\n\n/** Documents the `pm next` options payload exchanged by command, SDK, and package integrations. */\nexport interface NextOptions {\n /** Schema type that determines the shape and validation rules for this value. */\n type?: string;\n /** Value that configures or reports tag for this contract. */\n tag?: string;\n /** Value that configures or reports priority for this contract. */\n priority?: string | number;\n /** Value that configures or reports assignee for this contract. */\n assignee?: string;\n /** Value that configures or reports assignee filter for this contract. */\n assigneeFilter?: string;\n /** Value that configures or reports sprint for this contract. */\n sprint?: string;\n /** Value that configures or reports release for this contract. */\n release?: string;\n /** Value that configures or reports parent for this contract. */\n parent?: string;\n /** Value that configures or reports limit for this contract. */\n limit?: string;\n /** Value that configures or reports blocked limit for this contract. */\n blockedLimit?: string;\n /** Value that configures or reports ready only for this contract. */\n readyOnly?: boolean;\n /** Value that configures or reports format for this contract. */\n format?: string;\n /** Value that configures or reports explain ranking for this contract. */\n explainRanking?: boolean;\n /** Include human-gated Decision items in the claimable ready queue. */\n includeDecisions?: boolean;\n /** Internal caller override used to align claim-next ranking with --author. */\n callerAuthor?: string;\n [key: string]: unknown;\n}\n\n/** A blocker reference projected onto the `pm next` output. */\nexport interface NextBlockerRef {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports title for this contract. */\n title: string | null;\n /** Lifecycle state reported for status. */\n status: ItemStatus | null;\n}\n\n/**\n * A classified actionable item on the `pm next` output: a {@link ContextFocusItem}\n * focus row augmented with its open-blocker references and the downstream items it\n * would unblock.\n */\nexport interface NextActionableItem extends ContextFocusItem {\n /** One-based position in the complete ranked actionable queue. */\n rank: number;\n /** Number of open blocker entries represented by this result. */\n open_blocker_count: number;\n /** Value that configures or reports blockers for this contract. */\n blockers: NextBlockerRef[];\n /** Value that configures or reports unblocks for this contract. */\n unblocks: string[];\n}\n\n/** The single recommended next item: an actionable row plus its rationale. */\nexport interface NextRecommendation extends NextActionableItem {\n /** Value that configures or reports reasons for this contract. */\n reasons: string[];\n}\n\ninterface NextSummary {\n recommended: boolean;\n ready: number;\n blocked: number;\n in_progress: number;\n candidates: number;\n containers: number;\n 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 /** 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\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 | undefined,\n): Promise<{\n projectedReady: ActionableEntry[];\n ranking: Awaited<\n ReturnType<\n typeof scoreContextCandidatesWithActiveExtensions<ItemMetadata>\n >\n >;\n completedContainer: boolean;\n}> {\n const concreteReady = rankedReady.filter(\n (entry) => !hasCompletedDescendants(entry.item, childrenByParent),\n );\n const structuralReady =\n concreteReady.length > 0 ? concreteReady : rankedReady;\n const ranking = await scoreContextCandidatesWithActiveExtensions(\n \"next\",\n buildItemContextRelevanceCandidates(\n structuralReady.map((entry) => entry.item),\n statusRegistry,\n now,\n callerAuthor ?? process.env.PM_AUTHOR,\n ),\n );\n const readyById = new Map(\n structuralReady.map((entry) => [entry.item.id, entry]),\n );\n const projectedReady = ranking.ranked\n .map((entry) => readyById.get(entry.id))\n .filter((entry): entry is ActionableEntry => entry !== undefined);\n return {\n projectedReady,\n ranking,\n completedContainer: concreteReady.length === 0,\n };\n}\n\n/** Implements `pm next`: computes the ranked ready/blocked actionable queues and a single recommended next item with rationale for the public runtime surface. */\nexport async function runNext(\n options: NextOptions,\n global: GlobalOptions,\n): Promise<NextResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n const settings = await readSettings(pmRoot);\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const now = nowIso();\n const limit = parseNextLimit(options.limit, \"--limit\", DEFAULT_NEXT_LIMIT);\n const blockedLimit = parseNextLimit(\n options.blockedLimit,\n \"--blocked-limit\",\n limit,\n );\n const readyOnly = options.readyOnly === true;\n const parentScope =\n typeof options.parent === \"string\" ? options.parent.trim() : \"\";\n\n // Active (non-terminal) candidates honor the caller's filters; the corpus is the\n // FULL, UNFILTERED set (every status, every item) so blocker and descendant\n // resolution still sees items outside the caller's filters or --parent subtree —\n // otherwise a real blocker assigned to someone else (or a parent of a different\n // type) would be missing and the blocked item misread as ready.\n const candidatesList = await runList(\n undefined,\n nextListOptions(options, { excludeTerminal: true }),\n global,\n );\n const corpusList = await runList(\n undefined,\n { excludeTerminal: false, noTruncate: true },\n global,\n );\n const candidates = filterCandidatesByParentScope(\n candidatesList.items as 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 options.callerAuthor,\n );\n const rankedReady = rankNextReadyEntries(\n callerPartition.available,\n childrenByParent,\n statusRegistry,\n );\n const rankedBlocked = [...report.blocked].sort((left, right) =>\n compareCriticalItems(left.item, right.item, statusRegistry),\n );\n const {\n projectedReady,\n ranking: readyRanking,\n completedContainer,\n } = await rankReadyEntriesWithRelevance(\n rankedReady,\n childrenByParent,\n statusRegistry,\n now,\n options.callerAuthor,\n );\n\n const readyRows = projectedReady.map((entry, index) =>\n toNextActionableItem(entry, statusRegistry, childrenByParent, index + 1),\n );\n const blockedRows = rankedBlocked.map((entry, index) =>\n toNextActionableItem(entry, statusRegistry, childrenByParent, index + 1),\n );\n const decisionRows = rankNextReadyEntries(\n partitionedByDecision.decisions,\n childrenByParent,\n statusRegistry,\n ).map((entry, index) =>\n toNextActionableItem(entry, statusRegistry, childrenByParent, index + 1),\n );\n\n const recommended = buildNextRecommendation({\n projectedReady,\n readyRows,\n statusRegistry,\n now,\n completedContainer,\n });\n 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 const warnings = [\n ...new Set([\n ...(candidatesList.warnings ?? []),\n ...(corpusList.warnings ?? []),\n ...(readyRanking.warnings ?? []),\n ]),\n ].sort((a, b) => a.localeCompare(b));\n if (warnings.length > 0) result.warnings = warnings;\n if (options.explainRanking === true)\n result.ranking = toContextRankingSummary(readyRanking);\n\n result.suggestions = buildNextSuggestions(recommended, blockedRows);\n\n return result;\n}\n\n/**\n * Renders a {@link NextResult} as compact agent-readable markdown: the\n * recommendation with its rationale, the ranked ready queue, and (unless\n * `--ready-only`) the blocked queue annotated with each item's open blockers.\n */\nexport function renderNextMarkdown(result: NextResult): string {\n const lines: string[] = [\"# pm next\", \"\", ...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;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AAa,GAAG,WAAW,GAAG,aAAa,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;AACtJ,CAAC","debugId":"6f51d218-2e3d-5794-b264-be91d2e7e30e"}
1
+ {"version":3,"file":"next.js","sources":["cli/commands/next.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module cli/commands/next\n *\n * Implements the `pm next` command: the distilled \"what should I work on now?\"\n * query. It loads the active corpus, computes dependency-aware actionability\n * (ready vs blocked leaf work), and returns a single ranked recommendation with a\n * deterministic rationale plus the ranked ready/blocked queues — so an agent gets\n * the next action and the reason for it in one token-efficient read instead of\n * re-deriving readiness from a full `pm context` snapshot every turn.\n */\nimport {\n collectBlockedByIds,\n computeActionabilityReport,\n type ActionableEntry,\n} from \"../../core/item/actionability.js\";\nimport {\n resolveRuntimeStatusRegistry,\n type RuntimeStatusRegistry,\n} from \"../../core/schema/runtime-schema.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\nimport {\n normalizeStatusInput,\n normalizeStatusForRegistry,\n} from \"../../core/item/status.js\";\nimport { resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport type { 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,\n now,\n callerAuthor,\n 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,kCAAkC,CAAC;AAC1C,OAAO,EACL,4BAA4B,GAE7B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EACL,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5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ACpD,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":"09714dbd-c38d-58f3-bb28-ce6144e44f75"}
@@ -4,11 +4,11 @@
4
4
  * Implements the pm update many 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]="aee29c00-c350-5f1d-9ad7-129538e5cf1a")}catch(e){}}();
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]="66fd8f1d-25f8-55fc-85ea-ea3000479f01")}catch(e){}}();
8
8
  import { pathExists } from "../../core/fs/fs-utils.js";
9
9
  import { createCheckpointId, loadMutationCheckpoint, restoreCheckpointItems, writeMutationCheckpoint, } from "../../core/checkpoint/mutation-checkpoint.js";
10
10
  import { toItemRecord } from "../../core/item/item-record.js";
11
- import { applyTagRemovals, mergeAdditiveTags, parseTags, } from "../../core/item/parse.js";
11
+ import { applyTagRemovals, mergeAdditiveTags, parseOptionalNonNegativeInteger, parseTags, } from "../../core/item/parse.js";
12
12
  import { resolvePriority } from "../../core/item/priority.js";
13
13
  import { normalizeStatusInput } from "../../core/item/status.js";
14
14
  import { resolveItemTypeRegistry, resolveTypeName, } from "../../core/item/type-registry.js";
@@ -451,6 +451,9 @@ function assertPlannedUpdateValuesValid(update, settings, statusRegistry, pmRoot
451
451
  if (update.deadline !== undefined) {
452
452
  resolveIsoOrRelative(update.deadline, new Date(), "deadline");
453
453
  }
454
+ if (update.estimatedMinutes !== undefined) {
455
+ parseOptionalNonNegativeInteger(update.estimatedMinutes, "estimated-minutes");
456
+ }
454
457
  }
455
458
  async function runUpdateManyRollback(params) {
456
459
  const checkpoint = await loadMutationCheckpoint(params.pmRoot, UPDATE_MANY_CHECKPOINT_SUBDIR, params.rollbackId, UPDATE_MANY_CHECKPOINT_SCHEMA_VERSION);
@@ -648,4 +651,4 @@ export const _testOnlyUpdateManyCommand = {
648
651
  toComparablePreviewValue,
649
652
  };
650
653
  //# sourceMappingURL=update-many.js.map
651
- //# debugId=aee29c00-c350-5f1d-9ad7-129538e5cf1a
654
+ //# debugId=66fd8f1d-25f8-55fc-85ea-ea3000479f01