@unbrained/pm-cli 2026.7.8 → 2026.7.10

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 (446) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +1 -0
  3. package/dist/cli/bootstrap-args.js +6 -3
  4. package/dist/cli/bootstrap-args.js.map +1 -1
  5. package/dist/cli/commands/close.js +5 -2
  6. package/dist/cli/commands/close.js.map +1 -1
  7. package/dist/cli/commands/completion.js +8 -2
  8. package/dist/cli/commands/completion.js.map +1 -1
  9. package/dist/cli/commands/context.d.ts +23 -0
  10. package/dist/cli/commands/context.js +96 -7
  11. package/dist/cli/commands/context.js.map +1 -1
  12. package/dist/cli/commands/contracts.d.ts +11 -0
  13. package/dist/cli/commands/contracts.js +112 -15
  14. package/dist/cli/commands/contracts.js.map +1 -1
  15. package/dist/cli/commands/create.js +4 -2
  16. package/dist/cli/commands/create.js.map +1 -1
  17. package/dist/cli/commands/extension.d.ts +1 -1
  18. package/dist/cli/commands/extension.js +91 -32
  19. package/dist/cli/commands/extension.js.map +1 -1
  20. package/dist/cli/commands/init.d.ts +19 -3
  21. package/dist/cli/commands/init.js +57 -24
  22. package/dist/cli/commands/init.js.map +1 -1
  23. package/dist/cli/commands/list.d.ts +4 -0
  24. package/dist/cli/commands/list.js +32 -3
  25. package/dist/cli/commands/list.js.map +1 -1
  26. package/dist/cli/commands/next.d.ts +3 -1
  27. package/dist/cli/commands/next.js +19 -7
  28. package/dist/cli/commands/next.js.map +1 -1
  29. package/dist/cli/commands/update.d.ts +32 -1
  30. package/dist/cli/commands/update.js +37 -10
  31. package/dist/cli/commands/update.js.map +1 -1
  32. package/dist/cli/register-list-query.js +10 -4
  33. package/dist/cli/register-list-query.js.map +1 -1
  34. package/dist/cli/register-operations.js +4 -2
  35. package/dist/cli/register-operations.js.map +1 -1
  36. package/dist/cli/register-setup.js +11 -2
  37. package/dist/cli/register-setup.js.map +1 -1
  38. package/dist/cli/registration-helpers.js +4 -2
  39. package/dist/cli/registration-helpers.js.map +1 -1
  40. package/dist/cli-bundle/chunks/append-G7NGOQVU.js +11 -0
  41. package/dist/cli-bundle/chunks/{append-RSPHC423.js → append-SIECQAPH.js} +5 -5
  42. package/dist/cli-bundle/chunks/{chunk-CGDUIPJL.js → chunk-22PW73KV.js} +3 -3
  43. package/dist/cli-bundle/chunks/{chunk-ML27MHNM.js → chunk-2RW5DWHQ.js} +98 -22
  44. package/dist/cli-bundle/chunks/chunk-2RW5DWHQ.js.map +1 -0
  45. package/dist/cli-bundle/chunks/{chunk-GO2X6ZRB.js → chunk-35U3AVRY.js} +3 -3
  46. package/dist/cli-bundle/chunks/{chunk-4I7KS5ES.js → chunk-3JFQRPOI.js} +2 -2
  47. package/dist/cli-bundle/chunks/{chunk-NRMDT4OV.js → chunk-3THCOPYI.js} +4 -4
  48. package/dist/cli-bundle/chunks/{chunk-D6J5673C.js → chunk-4BINCIRM.js} +4 -4
  49. package/dist/cli-bundle/chunks/{chunk-D63PEJTB.js → chunk-4P2GYOM5.js} +7 -7
  50. package/dist/cli-bundle/chunks/{chunk-LHDHS4Z6.js → chunk-4QE5HOJY.js} +5 -5
  51. package/dist/cli-bundle/chunks/{chunk-5VAZHYVQ.js → chunk-56J3MPGE.js} +2 -2
  52. package/dist/cli-bundle/chunks/{chunk-UCRYCT5M.js → chunk-5BFBDJ4R.js} +38 -16
  53. package/dist/cli-bundle/chunks/chunk-5BFBDJ4R.js.map +1 -0
  54. package/dist/cli-bundle/chunks/{chunk-IINCZYM3.js → chunk-62ECRG6J.js} +3 -3
  55. package/dist/cli-bundle/chunks/{chunk-EYPIUFWJ.js → chunk-62KPBB2W.js} +10 -10
  56. package/dist/cli-bundle/chunks/{chunk-3FUXM574.js → chunk-6MK6M35B.js} +4 -4
  57. package/dist/cli-bundle/chunks/{chunk-XN5BEN2B.js → chunk-6PBZBIS6.js} +35 -8
  58. package/dist/cli-bundle/chunks/chunk-6PBZBIS6.js.map +1 -0
  59. package/dist/cli-bundle/chunks/{chunk-GQOKFX2G.js → chunk-6WIP52LQ.js} +8 -8
  60. package/dist/cli-bundle/chunks/{chunk-GLMJLBLR.js → chunk-75NAGPEL.js} +3 -3
  61. package/dist/cli-bundle/chunks/{chunk-6TD5QGIB.js → chunk-77CWXIAC.js} +4 -4
  62. package/dist/cli-bundle/chunks/{chunk-3FRNNVWY.js → chunk-7S2UC7S6.js} +427 -133
  63. package/dist/cli-bundle/chunks/chunk-7S2UC7S6.js.map +7 -0
  64. package/dist/cli-bundle/chunks/{chunk-PAWPLIWW.js → chunk-7THLDY3D.js} +5 -5
  65. package/dist/cli-bundle/chunks/{chunk-QJZM5WO5.js → chunk-7TRCAREE.js} +3 -3
  66. package/dist/cli-bundle/chunks/{chunk-EEJKHF7M.js → chunk-7TRVVYPI.js} +5 -5
  67. package/dist/cli-bundle/chunks/{chunk-PJPZTE7P.js → chunk-A62N3BM3.js} +8 -6
  68. package/dist/cli-bundle/chunks/chunk-A62N3BM3.js.map +7 -0
  69. package/dist/cli-bundle/chunks/{chunk-TU5P744I.js → chunk-A7DJG5EF.js} +55 -6
  70. package/dist/cli-bundle/chunks/chunk-A7DJG5EF.js.map +7 -0
  71. package/dist/cli-bundle/chunks/{chunk-ZMOPZFVT.js → chunk-AD4HJKQZ.js} +49 -7
  72. package/dist/cli-bundle/chunks/chunk-AD4HJKQZ.js.map +1 -0
  73. package/dist/cli-bundle/chunks/{chunk-7QKSLAHB.js → chunk-AIWGQK6K.js} +2 -2
  74. package/dist/cli-bundle/chunks/{chunk-P2WE5KCU.js → chunk-AKCHJXJ4.js} +7 -7
  75. package/dist/cli-bundle/chunks/{chunk-KFL3XHMA.js → chunk-AYPXY3HF.js} +2 -2
  76. package/dist/cli-bundle/chunks/{chunk-RL24NAUX.js → chunk-B7FCPO65.js} +4 -4
  77. package/dist/cli-bundle/chunks/{chunk-4OCWJ2AP.js → chunk-BC7QBM2A.js} +7 -7
  78. package/dist/cli-bundle/chunks/{chunk-LD2NBQ5T.js → chunk-BST7GFIX.js} +3 -3
  79. package/dist/cli-bundle/chunks/{chunk-GE44TQMC.js → chunk-CUBPPDDF.js} +145 -62
  80. package/dist/cli-bundle/chunks/chunk-CUBPPDDF.js.map +1 -0
  81. package/dist/cli-bundle/chunks/{chunk-FJR2S7S4.js → chunk-CYBW4HK7.js} +7 -7
  82. package/dist/cli-bundle/chunks/{chunk-7UCBLJDF.js → chunk-DDF7UMVV.js} +2 -2
  83. package/dist/cli-bundle/chunks/{chunk-YQEKE4FO.js → chunk-DLHFJZ2S.js} +7 -7
  84. package/dist/cli-bundle/chunks/{chunk-PCBZ2VJD.js → chunk-DMD2TENU.js} +4 -4
  85. package/dist/cli-bundle/chunks/{chunk-SCJPFQQT.js → chunk-DN67YDFH.js} +3 -3
  86. package/dist/cli-bundle/chunks/{chunk-7TBUV7XS.js → chunk-DNHILSD7.js} +4 -4
  87. package/dist/cli-bundle/chunks/{chunk-FFB3WITE.js → chunk-DT6NDP53.js} +3 -3
  88. package/dist/cli-bundle/chunks/{chunk-G4FKP4ID.js → chunk-DWGHHSDC.js} +9 -7
  89. package/dist/cli-bundle/chunks/chunk-DWGHHSDC.js.map +1 -0
  90. package/dist/cli-bundle/chunks/{chunk-3V5C7PUH.js → chunk-DYUAQVDK.js} +2 -2
  91. package/dist/cli-bundle/chunks/{chunk-MCH6IKK7.js → chunk-E2RJZQNW.js} +3 -3
  92. package/dist/cli-bundle/chunks/{chunk-6ZKDMEVT.js → chunk-ECXJ7OHI.js} +3 -3
  93. package/dist/cli-bundle/chunks/{chunk-LG4N6YOK.js → chunk-ESXG6VFX.js} +5 -5
  94. package/dist/cli-bundle/chunks/{chunk-TR2C6V5T.js → chunk-EXG6XTJC.js} +101 -25
  95. package/dist/cli-bundle/chunks/chunk-EXG6XTJC.js.map +7 -0
  96. package/dist/cli-bundle/chunks/{chunk-BPJ5NYSJ.js → chunk-F7UA74OZ.js} +54 -7
  97. package/dist/cli-bundle/chunks/chunk-F7UA74OZ.js.map +7 -0
  98. package/dist/cli-bundle/chunks/{chunk-GSQVQINP.js → chunk-FBD2WUNS.js} +4 -4
  99. package/dist/cli-bundle/chunks/{chunk-YSRXFGNV.js → chunk-FSD7W7Y2.js} +3 -3
  100. package/dist/cli-bundle/chunks/{chunk-JYVPLGOW.js → chunk-FWL5XVYI.js} +4 -4
  101. package/dist/cli-bundle/chunks/{chunk-KMXVZ2P7.js → chunk-FYMHD6VX.js} +122 -27
  102. package/dist/cli-bundle/chunks/chunk-FYMHD6VX.js.map +1 -0
  103. package/dist/cli-bundle/chunks/{chunk-SIQGG335.js → chunk-GMNCW27N.js} +7 -7
  104. package/dist/cli-bundle/chunks/{chunk-3SHDAKMF.js → chunk-GPPWUJMR.js} +3 -3
  105. package/dist/cli-bundle/chunks/{chunk-W2VFNVSJ.js → chunk-H3HKQXQJ.js} +3 -3
  106. package/dist/cli-bundle/chunks/{chunk-UIHDZS6X.js → chunk-HFQ7QQZL.js} +7 -7
  107. package/dist/cli-bundle/chunks/{chunk-Z6RLSNUX.js → chunk-HLUB7G6J.js} +3 -3
  108. package/dist/cli-bundle/chunks/{chunk-ASMRSIDX.js → chunk-HWUIK7YL.js} +121 -26
  109. package/dist/cli-bundle/chunks/chunk-HWUIK7YL.js.map +7 -0
  110. package/dist/cli-bundle/chunks/{chunk-U72GF3I2.js → chunk-INAZHXOI.js} +3 -3
  111. package/dist/cli-bundle/chunks/{chunk-INOWVPUD.js → chunk-J3ELHLOJ.js} +5 -5
  112. package/dist/cli-bundle/chunks/{chunk-2BVD4ZD2.js → chunk-J3FDNQWM.js} +4 -3
  113. package/dist/cli-bundle/chunks/chunk-J3FDNQWM.js.map +7 -0
  114. package/dist/cli-bundle/chunks/{chunk-UH6VFRV6.js → chunk-J3Z2JMDV.js} +3 -3
  115. package/dist/cli-bundle/chunks/{chunk-HI27UADG.js → chunk-JDEXIVKQ.js} +372 -20
  116. package/dist/cli-bundle/chunks/chunk-JDEXIVKQ.js.map +1 -0
  117. package/dist/cli-bundle/chunks/{chunk-MYHFZNBO.js → chunk-JFOBTM4D.js} +8 -8
  118. package/dist/cli-bundle/chunks/{chunk-J6AD3GWC.js → chunk-JNELC5UO.js} +2 -2
  119. package/dist/cli-bundle/chunks/{chunk-YUCKM3MD.js → chunk-JQ5NB6O2.js} +4 -4
  120. package/dist/cli-bundle/chunks/{chunk-3UXIMY62.js → chunk-KFC6X4PI.js} +3 -3
  121. package/dist/cli-bundle/chunks/{chunk-C3YU3TXX.js → chunk-L2SWAZ3S.js} +2 -2
  122. package/dist/cli-bundle/chunks/{chunk-QLEH6FTQ.js → chunk-LVVZLEW5.js} +4 -4
  123. package/dist/cli-bundle/chunks/{chunk-RFHLRMLQ.js → chunk-M66PC7JI.js} +3 -3
  124. package/dist/cli-bundle/chunks/{chunk-UVFJSKTF.js → chunk-M7DWRMNY.js} +10 -7
  125. package/dist/cli-bundle/chunks/chunk-M7DWRMNY.js.map +1 -0
  126. package/dist/cli-bundle/chunks/{chunk-UEATYUZW.js → chunk-M7JYEBPT.js} +2 -2
  127. package/dist/cli-bundle/chunks/{chunk-Z2JQH2MG.js → chunk-MQ632QRB.js} +2 -2
  128. package/dist/cli-bundle/chunks/{chunk-IYRG5AEC.js → chunk-N7N3PUUP.js} +7 -7
  129. package/dist/cli-bundle/chunks/{chunk-3YJDIJIE.js → chunk-NPJLTZQZ.js} +3 -3
  130. package/dist/cli-bundle/chunks/{chunk-TUDAYIO7.js → chunk-NQTIOKHL.js} +12 -10
  131. package/dist/cli-bundle/chunks/{chunk-TUDAYIO7.js.map → chunk-NQTIOKHL.js.map} +1 -1
  132. package/dist/cli-bundle/chunks/{chunk-BFNFTHWQ.js → chunk-O67XP4FD.js} +3 -3
  133. package/dist/cli-bundle/chunks/{chunk-XPSGJ4IV.js → chunk-OVYXSZOQ.js} +11 -9
  134. package/dist/cli-bundle/chunks/{chunk-XPSGJ4IV.js.map → chunk-OVYXSZOQ.js.map} +2 -2
  135. package/dist/cli-bundle/chunks/{chunk-FOJEBRDD.js → chunk-P7PDLLCE.js} +5 -5
  136. package/dist/cli-bundle/chunks/{chunk-SN5X5GTU.js → chunk-PEACKWHL.js} +4 -4
  137. package/dist/cli-bundle/chunks/{chunk-HZZ3AC27.js → chunk-PFRGQZG2.js} +3 -3
  138. package/dist/cli-bundle/chunks/{chunk-Q3CFSOQZ.js → chunk-PMU2OJ3N.js} +4 -4
  139. package/dist/cli-bundle/chunks/{chunk-5STY7NVM.js → chunk-PUMTJMMF.js} +4 -4
  140. package/dist/cli-bundle/chunks/{chunk-K52C6YPA.js → chunk-QTJCMK2S.js} +5 -5
  141. package/dist/cli-bundle/chunks/{chunk-6FU5BVRB.js → chunk-RAE2SLNO.js} +4 -4
  142. package/dist/cli-bundle/chunks/{chunk-YR5R4FMQ.js → chunk-RYA7QE7B.js} +10 -10
  143. package/dist/cli-bundle/chunks/{chunk-TTCJCKUJ.js → chunk-SL337EYZ.js} +379 -20
  144. package/dist/cli-bundle/chunks/chunk-SL337EYZ.js.map +7 -0
  145. package/dist/cli-bundle/chunks/{chunk-RDJXIAJB.js → chunk-SMKQFGDI.js} +9 -6
  146. package/dist/cli-bundle/chunks/chunk-SMKQFGDI.js.map +7 -0
  147. package/dist/cli-bundle/chunks/{chunk-UFNFHCAC.js → chunk-SWQMU4AD.js} +2 -2
  148. package/dist/cli-bundle/chunks/{chunk-MFLLULHU.js → chunk-TB2CZJAQ.js} +5 -4
  149. package/dist/cli-bundle/chunks/chunk-TB2CZJAQ.js.map +1 -0
  150. package/dist/cli-bundle/chunks/{chunk-WVEMZZCR.js → chunk-TEKAGPZV.js} +3 -3
  151. package/dist/cli-bundle/chunks/{chunk-JH5XDDYS.js → chunk-TM5E2IED.js} +5 -5
  152. package/dist/cli-bundle/chunks/{chunk-C6XSTACC.js → chunk-TTRL5GE6.js} +3 -3
  153. package/dist/cli-bundle/chunks/{chunk-AEOFBBWO.js → chunk-UA2VI62P.js} +3 -3
  154. package/dist/cli-bundle/chunks/{chunk-6RR4XM5H.js → chunk-UYK26VRP.js} +3 -3
  155. package/dist/cli-bundle/chunks/{chunk-CXH7EMSB.js → chunk-VBDQTL3Z.js} +3 -3
  156. package/dist/cli-bundle/chunks/{chunk-NGBWEYNY.js → chunk-W2FXYQ6D.js} +5 -5
  157. package/dist/cli-bundle/chunks/{chunk-UURYLDDC.js → chunk-WZ7EPGUX.js} +5 -5
  158. package/dist/cli-bundle/chunks/{chunk-2RADY7IB.js → chunk-XES6AVCK.js} +427 -126
  159. package/dist/cli-bundle/chunks/chunk-XES6AVCK.js.map +1 -0
  160. package/dist/cli-bundle/chunks/{chunk-QYZMZD4L.js → chunk-XVCB574W.js} +4 -4
  161. package/dist/cli-bundle/chunks/{chunk-F5DDGY6R.js → chunk-XWS3Z57Q.js} +3 -3
  162. package/dist/cli-bundle/chunks/{chunk-EP2CKDS7.js → chunk-XXJB4GLJ.js} +2 -2
  163. package/dist/cli-bundle/chunks/{chunk-NTOOEVJ4.js → chunk-Y5Q4FEE4.js} +47 -7
  164. package/dist/cli-bundle/chunks/chunk-Y5Q4FEE4.js.map +1 -0
  165. package/dist/cli-bundle/chunks/{chunk-DUBC6TI3.js → chunk-YA4B6P3L.js} +37 -15
  166. package/dist/cli-bundle/chunks/chunk-YA4B6P3L.js.map +7 -0
  167. package/dist/cli-bundle/chunks/{chunk-FL625JJM.js → chunk-Z3R2Z5KW.js} +145 -62
  168. package/dist/cli-bundle/chunks/chunk-Z3R2Z5KW.js.map +7 -0
  169. package/dist/cli-bundle/chunks/{chunk-RLHQ3G4M.js → chunk-Z5MFM54X.js} +34 -7
  170. package/dist/cli-bundle/chunks/chunk-Z5MFM54X.js.map +7 -0
  171. package/dist/cli-bundle/chunks/{chunk-6WCXSC5V.js → chunk-ZGDJA6WI.js} +5 -5
  172. package/dist/cli-bundle/chunks/{chunk-TKWTJGD6.js → chunk-ZIU35KME.js} +5 -5
  173. package/dist/cli-bundle/chunks/{chunk-YUMNZS3X.js → chunk-ZQ2KEWE7.js} +3 -3
  174. package/dist/cli-bundle/chunks/close-2NVUCJXV.js +12 -0
  175. package/dist/cli-bundle/chunks/{close-K6BFI3OX.js → close-BZPS37KL.js} +5 -5
  176. package/dist/cli-bundle/chunks/{close-many-6NBL3PM4.js → close-many-KKNCGLVR.js} +13 -13
  177. package/dist/cli-bundle/chunks/close-many-S5WKLWVO.js +22 -0
  178. package/dist/cli-bundle/chunks/{comments-PLFK5ZKK.js → comments-PV5XG342.js} +7 -7
  179. package/dist/cli-bundle/chunks/comments-XAM2ADHO.js +13 -0
  180. package/dist/cli-bundle/chunks/copy-OJ2YNJ7S.js +9 -0
  181. package/dist/cli-bundle/chunks/{copy-VH3L4MN2.js → copy-OZDYDQUG.js} +4 -4
  182. package/dist/cli-bundle/chunks/create-5O3QK3PX.js +25 -0
  183. package/dist/cli-bundle/chunks/{create-TRIBYORN.js → create-WGFKEJAK.js} +9 -9
  184. package/dist/cli-bundle/chunks/{delete-ZNXUNCZR.js → delete-NTYXFL7A.js} +4 -4
  185. package/dist/cli-bundle/chunks/delete-V7FPW6JL.js +10 -0
  186. package/dist/cli-bundle/chunks/{deps-CVDY7FFK.js → deps-7WVENNH3.js} +4 -4
  187. package/dist/cli-bundle/chunks/{deps-SZXQHV73.js → deps-Z6RD6RWW.js} +4 -4
  188. package/dist/cli-bundle/chunks/{docs-DR74ITCD.js → docs-2NIRGHAN.js} +6 -6
  189. package/dist/cli-bundle/chunks/docs-SOY2CMH3.js +14 -0
  190. package/dist/cli-bundle/chunks/{files-QEFQ2M3H.js → files-4OH2I663.js} +6 -6
  191. package/dist/cli-bundle/chunks/{files-H5YCA74Z.js → files-5KNAFW67.js} +6 -6
  192. package/dist/cli-bundle/chunks/{focus-55TRYSNA.js → focus-CLNZWWKW.js} +5 -5
  193. package/dist/cli-bundle/chunks/focus-JUKXZN3J.js +10 -0
  194. package/dist/cli-bundle/chunks/{history-compact-JJZ4EFL3.js → history-compact-R3T3XPD4.js} +9 -9
  195. package/dist/cli-bundle/chunks/history-compact-WKAKPLFQ.js +21 -0
  196. package/dist/cli-bundle/chunks/{history-redact-TPPUT3A5.js → history-redact-CLJDCBNF.js} +7 -7
  197. package/dist/cli-bundle/chunks/history-redact-Y67UDKD3.js +17 -0
  198. package/dist/cli-bundle/chunks/history-repair-2WLXWQAM.js +19 -0
  199. package/dist/cli-bundle/chunks/{history-repair-J7PIZ6ZP.js → history-repair-LNA7V2VI.js} +9 -9
  200. package/dist/cli-bundle/chunks/{learnings-KB6BT4NR.js → learnings-2L72KBOE.js} +7 -7
  201. package/dist/cli-bundle/chunks/learnings-PNK7WUWO.js +13 -0
  202. package/dist/cli-bundle/chunks/{notes-ZTHXVOKM.js → notes-USDIABZV.js} +7 -7
  203. package/dist/cli-bundle/chunks/notes-X4SWEJSB.js +13 -0
  204. package/dist/cli-bundle/chunks/plan-JU454RMZ.js +24 -0
  205. package/dist/cli-bundle/chunks/{plan-CJPKFRBK.js → plan-U4RWU56Z.js} +10 -10
  206. package/dist/cli-bundle/chunks/{profile-AQNHXOYA.js → profile-COBKZJUQ.js} +9 -9
  207. package/dist/cli-bundle/chunks/{profile-HTBFINKQ.js → profile-RKIRCXH7.js} +9 -9
  208. package/dist/cli-bundle/chunks/{register-list-query-EEF33SUJ.js → register-list-query-2VBANNFM.js} +20 -18
  209. package/dist/cli-bundle/chunks/register-list-query-2VBANNFM.js.map +1 -0
  210. package/dist/cli-bundle/chunks/{register-list-query-S4FBWIWN.js → register-list-query-4AZEKWZ5.js} +19 -17
  211. package/dist/cli-bundle/chunks/register-list-query-4AZEKWZ5.js.map +7 -0
  212. package/dist/cli-bundle/chunks/{register-mutation-QFLRBCI7.js → register-mutation-JGXTDEIZ.js} +29 -29
  213. package/dist/cli-bundle/chunks/{register-mutation-L5Q7AUDN.js → register-mutation-XVO4GGZI.js} +29 -29
  214. package/dist/cli-bundle/chunks/{register-operations-HDE4FVW4.js → register-operations-4EEFV5KJ.js} +30 -29
  215. package/dist/cli-bundle/chunks/register-operations-4EEFV5KJ.js.map +1 -0
  216. package/dist/cli-bundle/chunks/{register-operations-QDU43FCG.js → register-operations-UV25Z4BN.js} +29 -28
  217. package/dist/cli-bundle/chunks/register-operations-UV25Z4BN.js.map +7 -0
  218. package/dist/cli-bundle/chunks/{register-setup-EGMTAXDC.js → register-setup-MMXQQC5J.js} +27 -19
  219. package/dist/cli-bundle/chunks/register-setup-MMXQQC5J.js.map +1 -0
  220. package/dist/cli-bundle/chunks/{register-setup-PNIO3L2P.js → register-setup-NQE5MW63.js} +26 -18
  221. package/dist/cli-bundle/chunks/register-setup-NQE5MW63.js.map +7 -0
  222. package/dist/cli-bundle/chunks/restore-54HR2EYD.js +15 -0
  223. package/dist/cli-bundle/chunks/{restore-BTBEZ5CK.js → restore-BINCHJIY.js} +7 -7
  224. package/dist/cli-bundle/chunks/{schema-DGSTYYQB.js → schema-2JZNEQSG.js} +6 -6
  225. package/dist/cli-bundle/chunks/{schema-HAIBEE24.js → schema-VV3K5WZI.js} +6 -6
  226. package/dist/cli-bundle/chunks/{update-MP4XLU56.js → update-DK3GAY5D.js} +12 -12
  227. package/dist/cli-bundle/chunks/update-OIMRKTX6.js +21 -0
  228. package/dist/cli-bundle/chunks/update-many-5KI6MW76.js +31 -0
  229. package/dist/cli-bundle/chunks/update-many-IOLDHIZT.js +35 -0
  230. package/dist/cli-bundle/main.js +16 -54
  231. package/dist/cli-bundle/main.js.map +3 -3
  232. package/dist/cli-bundle/sdk-runtime.js +117 -53
  233. package/dist/cli-bundle/sdk-testing.js +6 -6
  234. package/dist/cli-bundle/sdk.js +142 -58
  235. package/dist/cli-bundle/sdk.js.map +3 -3
  236. package/dist/core/extensions/extension-types.d.ts +1 -1
  237. package/dist/core/extensions/extension-types.js +3 -2
  238. package/dist/core/extensions/extension-types.js.map +1 -1
  239. package/dist/core/extensions/index.d.ts +1 -0
  240. package/dist/core/extensions/index.js +3 -2
  241. package/dist/core/extensions/index.js.map +1 -1
  242. package/dist/core/store/front-matter-cache.d.ts +8 -0
  243. package/dist/core/store/front-matter-cache.js +22 -9
  244. package/dist/core/store/front-matter-cache.js.map +1 -1
  245. package/dist/sdk/cli-contracts/commander-mutation-options.js +4 -4
  246. package/dist/sdk/cli-contracts/commander-mutation-options.js.map +1 -1
  247. package/dist/sdk/cli-contracts/enum-contracts.d.ts +1 -1
  248. package/dist/sdk/cli-contracts/flag-contracts.js +10 -2
  249. package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
  250. package/dist/sdk/cli-contracts/tool-option-contracts.js +10 -5
  251. package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
  252. package/dist/sdk/cli-contracts/tool-parameter-tables.js +12 -4
  253. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  254. package/dist/sdk/cli-contracts/tool-schema.d.ts +4 -0
  255. package/dist/sdk/cli-contracts/tool-schema.js +66 -11
  256. package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
  257. package/dist/sdk/context-relevance.d.ts +166 -0
  258. package/dist/sdk/context-relevance.js +299 -0
  259. package/dist/sdk/context-relevance.js.map +1 -0
  260. package/dist/sdk/index.d.ts +2 -1
  261. package/dist/sdk/index.js +4 -3
  262. package/dist/sdk/index.js.map +1 -1
  263. package/dist/sdk/runtime.d.ts +340 -25
  264. package/dist/sdk/runtime.js +413 -25
  265. package/dist/sdk/runtime.js.map +1 -1
  266. package/docs/AGENT_GUIDE.md +3 -0
  267. package/docs/COMMANDS.md +17 -2
  268. package/docs/EXTENSIONS.md +3 -1
  269. package/docs/SDK.md +115 -0
  270. package/docs/TESTING.md +40 -1
  271. package/package.json +4 -2
  272. package/dist/cli-bundle/chunks/append-CDPAYYSB.js +0 -11
  273. package/dist/cli-bundle/chunks/chunk-2BVD4ZD2.js.map +0 -7
  274. package/dist/cli-bundle/chunks/chunk-2RADY7IB.js.map +0 -1
  275. package/dist/cli-bundle/chunks/chunk-3FRNNVWY.js.map +0 -7
  276. package/dist/cli-bundle/chunks/chunk-ASMRSIDX.js.map +0 -7
  277. package/dist/cli-bundle/chunks/chunk-BPJ5NYSJ.js.map +0 -7
  278. package/dist/cli-bundle/chunks/chunk-DUBC6TI3.js.map +0 -7
  279. package/dist/cli-bundle/chunks/chunk-FL625JJM.js.map +0 -7
  280. package/dist/cli-bundle/chunks/chunk-G4FKP4ID.js.map +0 -1
  281. package/dist/cli-bundle/chunks/chunk-GE44TQMC.js.map +0 -1
  282. package/dist/cli-bundle/chunks/chunk-HI27UADG.js.map +0 -1
  283. package/dist/cli-bundle/chunks/chunk-KMXVZ2P7.js.map +0 -1
  284. package/dist/cli-bundle/chunks/chunk-MFLLULHU.js.map +0 -1
  285. package/dist/cli-bundle/chunks/chunk-ML27MHNM.js.map +0 -1
  286. package/dist/cli-bundle/chunks/chunk-NTOOEVJ4.js.map +0 -1
  287. package/dist/cli-bundle/chunks/chunk-PJPZTE7P.js.map +0 -7
  288. package/dist/cli-bundle/chunks/chunk-RDJXIAJB.js.map +0 -7
  289. package/dist/cli-bundle/chunks/chunk-RLHQ3G4M.js.map +0 -7
  290. package/dist/cli-bundle/chunks/chunk-TR2C6V5T.js.map +0 -7
  291. package/dist/cli-bundle/chunks/chunk-TTCJCKUJ.js.map +0 -7
  292. package/dist/cli-bundle/chunks/chunk-TU5P744I.js.map +0 -7
  293. package/dist/cli-bundle/chunks/chunk-UCRYCT5M.js.map +0 -1
  294. package/dist/cli-bundle/chunks/chunk-UVFJSKTF.js.map +0 -1
  295. package/dist/cli-bundle/chunks/chunk-XN5BEN2B.js.map +0 -1
  296. package/dist/cli-bundle/chunks/chunk-ZMOPZFVT.js.map +0 -1
  297. package/dist/cli-bundle/chunks/close-E3RLZSP2.js +0 -12
  298. package/dist/cli-bundle/chunks/close-many-X4YKS3RO.js +0 -22
  299. package/dist/cli-bundle/chunks/comments-ZNOD5PTV.js +0 -13
  300. package/dist/cli-bundle/chunks/copy-F7BUFY4J.js +0 -9
  301. package/dist/cli-bundle/chunks/create-AMBMYP6F.js +0 -25
  302. package/dist/cli-bundle/chunks/delete-6KQHZYIP.js +0 -10
  303. package/dist/cli-bundle/chunks/docs-WCVYY6I7.js +0 -14
  304. package/dist/cli-bundle/chunks/focus-N2QGNS5D.js +0 -10
  305. package/dist/cli-bundle/chunks/history-compact-GWQ4UOEI.js +0 -21
  306. package/dist/cli-bundle/chunks/history-redact-4GJOLXCM.js +0 -17
  307. package/dist/cli-bundle/chunks/history-repair-HVCVCGUF.js +0 -19
  308. package/dist/cli-bundle/chunks/learnings-YYY3U2Y7.js +0 -13
  309. package/dist/cli-bundle/chunks/notes-BGG7VL72.js +0 -13
  310. package/dist/cli-bundle/chunks/plan-MK2QY3GA.js +0 -24
  311. package/dist/cli-bundle/chunks/register-list-query-EEF33SUJ.js.map +0 -1
  312. package/dist/cli-bundle/chunks/register-list-query-S4FBWIWN.js.map +0 -7
  313. package/dist/cli-bundle/chunks/register-operations-HDE4FVW4.js.map +0 -1
  314. package/dist/cli-bundle/chunks/register-operations-QDU43FCG.js.map +0 -7
  315. package/dist/cli-bundle/chunks/register-setup-EGMTAXDC.js.map +0 -1
  316. package/dist/cli-bundle/chunks/register-setup-PNIO3L2P.js.map +0 -7
  317. package/dist/cli-bundle/chunks/restore-EX4UUZL6.js +0 -15
  318. package/dist/cli-bundle/chunks/update-SDIRJGSY.js +0 -21
  319. package/dist/cli-bundle/chunks/update-many-34AIU6W7.js +0 -31
  320. package/dist/cli-bundle/chunks/update-many-JUPCNOKV.js +0 -35
  321. /package/dist/cli-bundle/chunks/{append-CDPAYYSB.js.map → append-G7NGOQVU.js.map} +0 -0
  322. /package/dist/cli-bundle/chunks/{append-RSPHC423.js.map → append-SIECQAPH.js.map} +0 -0
  323. /package/dist/cli-bundle/chunks/{chunk-CGDUIPJL.js.map → chunk-22PW73KV.js.map} +0 -0
  324. /package/dist/cli-bundle/chunks/{chunk-GO2X6ZRB.js.map → chunk-35U3AVRY.js.map} +0 -0
  325. /package/dist/cli-bundle/chunks/{chunk-4I7KS5ES.js.map → chunk-3JFQRPOI.js.map} +0 -0
  326. /package/dist/cli-bundle/chunks/{chunk-NRMDT4OV.js.map → chunk-3THCOPYI.js.map} +0 -0
  327. /package/dist/cli-bundle/chunks/{chunk-D6J5673C.js.map → chunk-4BINCIRM.js.map} +0 -0
  328. /package/dist/cli-bundle/chunks/{chunk-D63PEJTB.js.map → chunk-4P2GYOM5.js.map} +0 -0
  329. /package/dist/cli-bundle/chunks/{chunk-LHDHS4Z6.js.map → chunk-4QE5HOJY.js.map} +0 -0
  330. /package/dist/cli-bundle/chunks/{chunk-5VAZHYVQ.js.map → chunk-56J3MPGE.js.map} +0 -0
  331. /package/dist/cli-bundle/chunks/{chunk-IINCZYM3.js.map → chunk-62ECRG6J.js.map} +0 -0
  332. /package/dist/cli-bundle/chunks/{chunk-EYPIUFWJ.js.map → chunk-62KPBB2W.js.map} +0 -0
  333. /package/dist/cli-bundle/chunks/{chunk-3FUXM574.js.map → chunk-6MK6M35B.js.map} +0 -0
  334. /package/dist/cli-bundle/chunks/{chunk-GQOKFX2G.js.map → chunk-6WIP52LQ.js.map} +0 -0
  335. /package/dist/cli-bundle/chunks/{chunk-GLMJLBLR.js.map → chunk-75NAGPEL.js.map} +0 -0
  336. /package/dist/cli-bundle/chunks/{chunk-6TD5QGIB.js.map → chunk-77CWXIAC.js.map} +0 -0
  337. /package/dist/cli-bundle/chunks/{chunk-PAWPLIWW.js.map → chunk-7THLDY3D.js.map} +0 -0
  338. /package/dist/cli-bundle/chunks/{chunk-QJZM5WO5.js.map → chunk-7TRCAREE.js.map} +0 -0
  339. /package/dist/cli-bundle/chunks/{chunk-EEJKHF7M.js.map → chunk-7TRVVYPI.js.map} +0 -0
  340. /package/dist/cli-bundle/chunks/{chunk-7QKSLAHB.js.map → chunk-AIWGQK6K.js.map} +0 -0
  341. /package/dist/cli-bundle/chunks/{chunk-P2WE5KCU.js.map → chunk-AKCHJXJ4.js.map} +0 -0
  342. /package/dist/cli-bundle/chunks/{chunk-KFL3XHMA.js.map → chunk-AYPXY3HF.js.map} +0 -0
  343. /package/dist/cli-bundle/chunks/{chunk-RL24NAUX.js.map → chunk-B7FCPO65.js.map} +0 -0
  344. /package/dist/cli-bundle/chunks/{chunk-4OCWJ2AP.js.map → chunk-BC7QBM2A.js.map} +0 -0
  345. /package/dist/cli-bundle/chunks/{chunk-LD2NBQ5T.js.map → chunk-BST7GFIX.js.map} +0 -0
  346. /package/dist/cli-bundle/chunks/{chunk-FJR2S7S4.js.map → chunk-CYBW4HK7.js.map} +0 -0
  347. /package/dist/cli-bundle/chunks/{chunk-7UCBLJDF.js.map → chunk-DDF7UMVV.js.map} +0 -0
  348. /package/dist/cli-bundle/chunks/{chunk-YQEKE4FO.js.map → chunk-DLHFJZ2S.js.map} +0 -0
  349. /package/dist/cli-bundle/chunks/{chunk-PCBZ2VJD.js.map → chunk-DMD2TENU.js.map} +0 -0
  350. /package/dist/cli-bundle/chunks/{chunk-SCJPFQQT.js.map → chunk-DN67YDFH.js.map} +0 -0
  351. /package/dist/cli-bundle/chunks/{chunk-7TBUV7XS.js.map → chunk-DNHILSD7.js.map} +0 -0
  352. /package/dist/cli-bundle/chunks/{chunk-FFB3WITE.js.map → chunk-DT6NDP53.js.map} +0 -0
  353. /package/dist/cli-bundle/chunks/{chunk-3V5C7PUH.js.map → chunk-DYUAQVDK.js.map} +0 -0
  354. /package/dist/cli-bundle/chunks/{chunk-MCH6IKK7.js.map → chunk-E2RJZQNW.js.map} +0 -0
  355. /package/dist/cli-bundle/chunks/{chunk-6ZKDMEVT.js.map → chunk-ECXJ7OHI.js.map} +0 -0
  356. /package/dist/cli-bundle/chunks/{chunk-LG4N6YOK.js.map → chunk-ESXG6VFX.js.map} +0 -0
  357. /package/dist/cli-bundle/chunks/{chunk-GSQVQINP.js.map → chunk-FBD2WUNS.js.map} +0 -0
  358. /package/dist/cli-bundle/chunks/{chunk-YSRXFGNV.js.map → chunk-FSD7W7Y2.js.map} +0 -0
  359. /package/dist/cli-bundle/chunks/{chunk-JYVPLGOW.js.map → chunk-FWL5XVYI.js.map} +0 -0
  360. /package/dist/cli-bundle/chunks/{chunk-SIQGG335.js.map → chunk-GMNCW27N.js.map} +0 -0
  361. /package/dist/cli-bundle/chunks/{chunk-3SHDAKMF.js.map → chunk-GPPWUJMR.js.map} +0 -0
  362. /package/dist/cli-bundle/chunks/{chunk-W2VFNVSJ.js.map → chunk-H3HKQXQJ.js.map} +0 -0
  363. /package/dist/cli-bundle/chunks/{chunk-UIHDZS6X.js.map → chunk-HFQ7QQZL.js.map} +0 -0
  364. /package/dist/cli-bundle/chunks/{chunk-Z6RLSNUX.js.map → chunk-HLUB7G6J.js.map} +0 -0
  365. /package/dist/cli-bundle/chunks/{chunk-U72GF3I2.js.map → chunk-INAZHXOI.js.map} +0 -0
  366. /package/dist/cli-bundle/chunks/{chunk-INOWVPUD.js.map → chunk-J3ELHLOJ.js.map} +0 -0
  367. /package/dist/cli-bundle/chunks/{chunk-UH6VFRV6.js.map → chunk-J3Z2JMDV.js.map} +0 -0
  368. /package/dist/cli-bundle/chunks/{chunk-MYHFZNBO.js.map → chunk-JFOBTM4D.js.map} +0 -0
  369. /package/dist/cli-bundle/chunks/{chunk-J6AD3GWC.js.map → chunk-JNELC5UO.js.map} +0 -0
  370. /package/dist/cli-bundle/chunks/{chunk-YUCKM3MD.js.map → chunk-JQ5NB6O2.js.map} +0 -0
  371. /package/dist/cli-bundle/chunks/{chunk-3UXIMY62.js.map → chunk-KFC6X4PI.js.map} +0 -0
  372. /package/dist/cli-bundle/chunks/{chunk-C3YU3TXX.js.map → chunk-L2SWAZ3S.js.map} +0 -0
  373. /package/dist/cli-bundle/chunks/{chunk-QLEH6FTQ.js.map → chunk-LVVZLEW5.js.map} +0 -0
  374. /package/dist/cli-bundle/chunks/{chunk-RFHLRMLQ.js.map → chunk-M66PC7JI.js.map} +0 -0
  375. /package/dist/cli-bundle/chunks/{chunk-UEATYUZW.js.map → chunk-M7JYEBPT.js.map} +0 -0
  376. /package/dist/cli-bundle/chunks/{chunk-Z2JQH2MG.js.map → chunk-MQ632QRB.js.map} +0 -0
  377. /package/dist/cli-bundle/chunks/{chunk-IYRG5AEC.js.map → chunk-N7N3PUUP.js.map} +0 -0
  378. /package/dist/cli-bundle/chunks/{chunk-3YJDIJIE.js.map → chunk-NPJLTZQZ.js.map} +0 -0
  379. /package/dist/cli-bundle/chunks/{chunk-BFNFTHWQ.js.map → chunk-O67XP4FD.js.map} +0 -0
  380. /package/dist/cli-bundle/chunks/{chunk-FOJEBRDD.js.map → chunk-P7PDLLCE.js.map} +0 -0
  381. /package/dist/cli-bundle/chunks/{chunk-SN5X5GTU.js.map → chunk-PEACKWHL.js.map} +0 -0
  382. /package/dist/cli-bundle/chunks/{chunk-HZZ3AC27.js.map → chunk-PFRGQZG2.js.map} +0 -0
  383. /package/dist/cli-bundle/chunks/{chunk-Q3CFSOQZ.js.map → chunk-PMU2OJ3N.js.map} +0 -0
  384. /package/dist/cli-bundle/chunks/{chunk-5STY7NVM.js.map → chunk-PUMTJMMF.js.map} +0 -0
  385. /package/dist/cli-bundle/chunks/{chunk-K52C6YPA.js.map → chunk-QTJCMK2S.js.map} +0 -0
  386. /package/dist/cli-bundle/chunks/{chunk-6FU5BVRB.js.map → chunk-RAE2SLNO.js.map} +0 -0
  387. /package/dist/cli-bundle/chunks/{chunk-YR5R4FMQ.js.map → chunk-RYA7QE7B.js.map} +0 -0
  388. /package/dist/cli-bundle/chunks/{chunk-UFNFHCAC.js.map → chunk-SWQMU4AD.js.map} +0 -0
  389. /package/dist/cli-bundle/chunks/{chunk-WVEMZZCR.js.map → chunk-TEKAGPZV.js.map} +0 -0
  390. /package/dist/cli-bundle/chunks/{chunk-JH5XDDYS.js.map → chunk-TM5E2IED.js.map} +0 -0
  391. /package/dist/cli-bundle/chunks/{chunk-C6XSTACC.js.map → chunk-TTRL5GE6.js.map} +0 -0
  392. /package/dist/cli-bundle/chunks/{chunk-AEOFBBWO.js.map → chunk-UA2VI62P.js.map} +0 -0
  393. /package/dist/cli-bundle/chunks/{chunk-6RR4XM5H.js.map → chunk-UYK26VRP.js.map} +0 -0
  394. /package/dist/cli-bundle/chunks/{chunk-CXH7EMSB.js.map → chunk-VBDQTL3Z.js.map} +0 -0
  395. /package/dist/cli-bundle/chunks/{chunk-NGBWEYNY.js.map → chunk-W2FXYQ6D.js.map} +0 -0
  396. /package/dist/cli-bundle/chunks/{chunk-UURYLDDC.js.map → chunk-WZ7EPGUX.js.map} +0 -0
  397. /package/dist/cli-bundle/chunks/{chunk-QYZMZD4L.js.map → chunk-XVCB574W.js.map} +0 -0
  398. /package/dist/cli-bundle/chunks/{chunk-F5DDGY6R.js.map → chunk-XWS3Z57Q.js.map} +0 -0
  399. /package/dist/cli-bundle/chunks/{chunk-EP2CKDS7.js.map → chunk-XXJB4GLJ.js.map} +0 -0
  400. /package/dist/cli-bundle/chunks/{chunk-6WCXSC5V.js.map → chunk-ZGDJA6WI.js.map} +0 -0
  401. /package/dist/cli-bundle/chunks/{chunk-TKWTJGD6.js.map → chunk-ZIU35KME.js.map} +0 -0
  402. /package/dist/cli-bundle/chunks/{chunk-YUMNZS3X.js.map → chunk-ZQ2KEWE7.js.map} +0 -0
  403. /package/dist/cli-bundle/chunks/{close-E3RLZSP2.js.map → close-2NVUCJXV.js.map} +0 -0
  404. /package/dist/cli-bundle/chunks/{close-K6BFI3OX.js.map → close-BZPS37KL.js.map} +0 -0
  405. /package/dist/cli-bundle/chunks/{close-many-6NBL3PM4.js.map → close-many-KKNCGLVR.js.map} +0 -0
  406. /package/dist/cli-bundle/chunks/{close-many-X4YKS3RO.js.map → close-many-S5WKLWVO.js.map} +0 -0
  407. /package/dist/cli-bundle/chunks/{comments-PLFK5ZKK.js.map → comments-PV5XG342.js.map} +0 -0
  408. /package/dist/cli-bundle/chunks/{comments-ZNOD5PTV.js.map → comments-XAM2ADHO.js.map} +0 -0
  409. /package/dist/cli-bundle/chunks/{copy-F7BUFY4J.js.map → copy-OJ2YNJ7S.js.map} +0 -0
  410. /package/dist/cli-bundle/chunks/{copy-VH3L4MN2.js.map → copy-OZDYDQUG.js.map} +0 -0
  411. /package/dist/cli-bundle/chunks/{create-AMBMYP6F.js.map → create-5O3QK3PX.js.map} +0 -0
  412. /package/dist/cli-bundle/chunks/{create-TRIBYORN.js.map → create-WGFKEJAK.js.map} +0 -0
  413. /package/dist/cli-bundle/chunks/{delete-ZNXUNCZR.js.map → delete-NTYXFL7A.js.map} +0 -0
  414. /package/dist/cli-bundle/chunks/{delete-6KQHZYIP.js.map → delete-V7FPW6JL.js.map} +0 -0
  415. /package/dist/cli-bundle/chunks/{deps-CVDY7FFK.js.map → deps-7WVENNH3.js.map} +0 -0
  416. /package/dist/cli-bundle/chunks/{deps-SZXQHV73.js.map → deps-Z6RD6RWW.js.map} +0 -0
  417. /package/dist/cli-bundle/chunks/{docs-DR74ITCD.js.map → docs-2NIRGHAN.js.map} +0 -0
  418. /package/dist/cli-bundle/chunks/{docs-WCVYY6I7.js.map → docs-SOY2CMH3.js.map} +0 -0
  419. /package/dist/cli-bundle/chunks/{files-QEFQ2M3H.js.map → files-4OH2I663.js.map} +0 -0
  420. /package/dist/cli-bundle/chunks/{files-H5YCA74Z.js.map → files-5KNAFW67.js.map} +0 -0
  421. /package/dist/cli-bundle/chunks/{focus-55TRYSNA.js.map → focus-CLNZWWKW.js.map} +0 -0
  422. /package/dist/cli-bundle/chunks/{focus-N2QGNS5D.js.map → focus-JUKXZN3J.js.map} +0 -0
  423. /package/dist/cli-bundle/chunks/{history-compact-JJZ4EFL3.js.map → history-compact-R3T3XPD4.js.map} +0 -0
  424. /package/dist/cli-bundle/chunks/{history-compact-GWQ4UOEI.js.map → history-compact-WKAKPLFQ.js.map} +0 -0
  425. /package/dist/cli-bundle/chunks/{history-redact-TPPUT3A5.js.map → history-redact-CLJDCBNF.js.map} +0 -0
  426. /package/dist/cli-bundle/chunks/{history-redact-4GJOLXCM.js.map → history-redact-Y67UDKD3.js.map} +0 -0
  427. /package/dist/cli-bundle/chunks/{history-repair-HVCVCGUF.js.map → history-repair-2WLXWQAM.js.map} +0 -0
  428. /package/dist/cli-bundle/chunks/{history-repair-J7PIZ6ZP.js.map → history-repair-LNA7V2VI.js.map} +0 -0
  429. /package/dist/cli-bundle/chunks/{learnings-KB6BT4NR.js.map → learnings-2L72KBOE.js.map} +0 -0
  430. /package/dist/cli-bundle/chunks/{learnings-YYY3U2Y7.js.map → learnings-PNK7WUWO.js.map} +0 -0
  431. /package/dist/cli-bundle/chunks/{notes-ZTHXVOKM.js.map → notes-USDIABZV.js.map} +0 -0
  432. /package/dist/cli-bundle/chunks/{notes-BGG7VL72.js.map → notes-X4SWEJSB.js.map} +0 -0
  433. /package/dist/cli-bundle/chunks/{plan-MK2QY3GA.js.map → plan-JU454RMZ.js.map} +0 -0
  434. /package/dist/cli-bundle/chunks/{plan-CJPKFRBK.js.map → plan-U4RWU56Z.js.map} +0 -0
  435. /package/dist/cli-bundle/chunks/{profile-AQNHXOYA.js.map → profile-COBKZJUQ.js.map} +0 -0
  436. /package/dist/cli-bundle/chunks/{profile-HTBFINKQ.js.map → profile-RKIRCXH7.js.map} +0 -0
  437. /package/dist/cli-bundle/chunks/{register-mutation-QFLRBCI7.js.map → register-mutation-JGXTDEIZ.js.map} +0 -0
  438. /package/dist/cli-bundle/chunks/{register-mutation-L5Q7AUDN.js.map → register-mutation-XVO4GGZI.js.map} +0 -0
  439. /package/dist/cli-bundle/chunks/{restore-EX4UUZL6.js.map → restore-54HR2EYD.js.map} +0 -0
  440. /package/dist/cli-bundle/chunks/{restore-BTBEZ5CK.js.map → restore-BINCHJIY.js.map} +0 -0
  441. /package/dist/cli-bundle/chunks/{schema-DGSTYYQB.js.map → schema-2JZNEQSG.js.map} +0 -0
  442. /package/dist/cli-bundle/chunks/{schema-HAIBEE24.js.map → schema-VV3K5WZI.js.map} +0 -0
  443. /package/dist/cli-bundle/chunks/{update-MP4XLU56.js.map → update-DK3GAY5D.js.map} +0 -0
  444. /package/dist/cli-bundle/chunks/{update-SDIRJGSY.js.map → update-OIMRKTX6.js.map} +0 -0
  445. /package/dist/cli-bundle/chunks/{update-many-34AIU6W7.js.map → update-many-5KI6MW76.js.map} +0 -0
  446. /package/dist/cli-bundle/chunks/{update-many-JUPCNOKV.js.map → update-many-IOLDHIZT.js.map} +0 -0
@@ -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 { resolveRuntimeStatusRegistry, type RuntimeStatusRegistry } 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 { normalizeStatusInput, normalizeStatusForRegistry } from \"../../core/item/status.js\";\nimport { resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport type { ItemFrontMatter, ItemStatus } from \"../../types/index.js\";\nimport { parseIntegerLimit } from \"../shared-parsers.js\";\nimport {\n buildChildrenByParent,\n collectSubtreeIds,\n compareCriticalItems,\n toContextFocusItem,\n type ContextFocusItem,\n} from \"./context.js\";\nimport { runList, type ListOptions } from \"./list.js\";\n\nexport const NEXT_OUTPUT_VALUES = [\"markdown\", \"toon\", \"json\"] as const;\n/**\n * Restricts `pm next` output format values accepted by command, SDK, and storage contracts.\n */\nexport type NextOutputFormat = (typeof NEXT_OUTPUT_VALUES)[number];\n\nconst DEFAULT_NEXT_LIMIT = 5;\nconst MS_PER_DAY = 24 * 60 * 60 * 1000;\n\n/**\n * Documents the `pm next` options payload exchanged by command, SDK, and package integrations.\n */\nexport interface NextOptions {\n type?: string;\n tag?: string;\n priority?: string;\n assignee?: string;\n assigneeFilter?: string;\n sprint?: string;\n release?: string;\n parent?: string;\n limit?: string;\n blockedLimit?: string;\n readyOnly?: boolean;\n format?: string;\n [key: string]: unknown;\n}\n\n/** A blocker reference projected onto the `pm next` output. */\nexport interface NextBlockerRef {\n id: string;\n title: string | null;\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 open_blocker_count: number;\n blockers: NextBlockerRef[];\n unblocks: string[];\n}\n\n/** The single recommended next item: an actionable row plus its rationale. */\nexport interface NextRecommendation extends NextActionableItem {\n reasons: string[];\n}\n\ninterface NextSummary {\n recommended: boolean;\n ready: number;\n blocked: number;\n in_progress: number;\n candidates: number;\n containers: number;\n}\n\n/**\n * Documents the `pm next` result payload exchanged by command, SDK, and package integrations.\n */\nexport interface NextResult {\n output_default: \"toon\";\n now: string;\n recommended: NextRecommendation | null;\n ready: NextActionableItem[];\n blocked: NextActionableItem[];\n summary: NextSummary;\n filters: {\n type: string | null;\n tag: string | null;\n priority: string | null;\n assignee: string | null;\n assignee_filter: string | null;\n sprint: string | null;\n release: string | null;\n parent: string | null;\n limit: number;\n blocked_limit: number;\n ready_only: boolean;\n };\n suggestions?: string[];\n warnings?: string[];\n}\n\nfunction parseNextOutputFormat(raw: string | undefined): 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(\"Next format must be one of markdown|toon|json\", EXIT_CODE.USAGE);\n }\n return normalized as NextOutputFormat;\n}\n\n/**\n * Resolves the effective `pm next` output format from the command `--format` flag\n * and the global `--json` switch, rejecting the contradictory `--json --format\n * markdown|toon` combination. Defaults to `toon`.\n */\nexport function resolveNextOutputFormat(options: NextOptions, global: GlobalOptions): NextOutputFormat {\n const commandFormat = parseNextOutputFormat(options.format);\n if (global.json && commandFormat && commandFormat !== \"json\") {\n throw new PmCliError(\"Cannot combine --json with --format markdown|toon\", EXIT_CODE.USAGE);\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(raw: string | undefined, flag: string, fallback: number): number {\n const parsed = parseIntegerLimit(raw, flag);\n if (parsed === undefined || parsed <= 0) return fallback;\n return parsed;\n}\n\n// Projects an actionable entry onto its output row. Ready entries carry no\n// blockers; blocked entries surface their unresolved blockers for the agent.\nfunction toNextActionableItem(\n entry: ActionableEntry,\n statusRegistry: RuntimeStatusRegistry,\n childrenByParent: Map<string, ItemFrontMatter[]>,\n): NextActionableItem {\n return {\n ...toContextFocusItem(entry.item, statusRegistry, childrenByParent),\n open_blocker_count: entry.open_blockers.length,\n blockers: entry.open_blockers.map((blocker) => ({ id: blocker.id, title: blocker.title, status: blocker.status })),\n unblocks: entry.unblocks,\n };\n}\n\n// Builds the human+agent readable rationale for the recommended item, ordering\n// clauses from most to least decisive (status, priority, deadline, blocker\n// clearance, parent advancement, downstream unblocks).\nfunction buildRecommendationReasons(\n entry: ActionableEntry,\n statusRegistry: RuntimeStatusRegistry,\n now: string,\n completedContainer: boolean,\n): string[] {\n const item = entry.item;\n const reasons: string[] = [];\n const inProgressStatus = normalizeStatusInput(\"in_progress\", statusRegistry);\n reasons.push(\n normalizeStatusForRegistry(item.status, statusRegistry) === inProgressStatus\n ? \"in progress — resume to finish\"\n : \"open and ready to start\",\n );\n if (completedContainer) {\n reasons.push(\"completed container — governance closeout\");\n }\n reasons.push(`priority p${item.priority}${item.priority === 0 ? \" (highest)\" : \"\"}`);\n if (typeof item.deadline === \"string\" && item.deadline.trim().length > 0) {\n reasons.push(describeDeadline(item.deadline, now));\n }\n reasons.push(collectBlockedByIds(item).length > 0 ? \"all blockers resolved\" : \"no blockers\");\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(`unblocks ${entry.unblocks.length} item(s): ${entry.unblocks.join(\", \")}`);\n }\n return reasons;\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((Date.parse(dateToken) - Date.parse(nowToken)) / MS_PER_DAY);\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(ready: NextActionableItem[], statusRegistry: RuntimeStatusRegistry): number {\n const inProgressStatus = normalizeStatusInput(\"in_progress\", statusRegistry);\n return ready.filter((item) => normalizeStatusForRegistry(item.status, statusRegistry) === inProgressStatus).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(item: ItemFrontMatter, childrenByParent: Map<string, ItemFrontMatter[]>): 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(options: NextOptions, extra: Partial<ListOptions>): ListOptions {\n return {\n type: options.type,\n tag: options.tag,\n priority: options.priority,\n assignee: options.assignee,\n assigneeFilter: options.assigneeFilter,\n sprint: options.sprint,\n release: options.release,\n noTruncate: true,\n ...extra,\n };\n}\n\nfunction rankNextReadyEntries(\n ready: ActionableEntry[],\n childrenByParent: Map<string, ItemFrontMatter[]>,\n statusRegistry: RuntimeStatusRegistry,\n): ActionableEntry[] {\n return [...ready].sort((left, right) => {\n const leftCompletedContainer = hasCompletedDescendants(left.item, childrenByParent);\n const rightCompletedContainer = hasCompletedDescendants(right.item, childrenByParent);\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(recommended: NextRecommendation | null, blockedRows: NextActionableItem[]): string[] | undefined {\n if (recommended !== null) {\n return undefined;\n }\n if (blockedRows.length > 0) {\n return [\n `${blockedRows.length} item(s) are blocked; unblock the top one by closing ${blockedRows[0].blockers\n .map((blocker) => blocker.id)\n .join(\", \")}`,\n \"pm next --ready-only after a blocker closes to re-check ready work\",\n 'pm create --type Task --title \"...\" to add new ready work',\n ];\n }\n return [\n 'pm create --type Task --title \"...\" to add a new work item',\n \"pm list --status in_progress to review work already underway\",\n \"pm context --depth deep for the full project snapshot\",\n ];\n}\n\nfunction filterCandidatesByParentScope(\n candidates: ItemFrontMatter[],\n corpus: ItemFrontMatter[],\n parentScope: string,\n): ItemFrontMatter[] {\n if (!parentScope) {\n return candidates;\n }\n const subtree = collectSubtreeIds(corpus, parentScope);\n if (!subtree.found) {\n throw new PmCliError(`Next --parent item not found: ${parentScope}`, EXIT_CODE.NOT_FOUND);\n }\n return candidates.filter((item) => subtree.ids.has(item.id.trim().toLowerCase()));\n}\n\n/**\n * Implements `pm next`: computes the ranked ready/blocked actionable queues and a\n * single recommended next item with rationale for the public runtime surface.\n */\nexport async function runNext(options: NextOptions, global: GlobalOptions): 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(options.blockedLimit, \"--blocked-limit\", limit);\n const readyOnly = options.readyOnly === true;\n const parentScope = 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(undefined, nextListOptions(options, { excludeTerminal: true }), global);\n const corpusList = await runList(undefined, { excludeTerminal: false, noTruncate: true }, global);\n const candidates = filterCandidatesByParentScope(candidatesList.items as ItemFrontMatter[], corpusList.items as ItemFrontMatter[], parentScope);\n const corpus = corpusList.items as ItemFrontMatter[];\n\n const report = computeActionabilityReport(candidates, corpus, statusRegistry);\n const childrenByParent = buildChildrenByParent(corpus);\n const rankedReady = rankNextReadyEntries(report.ready, childrenByParent, statusRegistry);\n const rankedBlocked = [...report.blocked].sort((left, right) =>\n compareCriticalItems(left.item, right.item, statusRegistry),\n );\n const concreteReady = rankedReady.filter((entry) => !hasCompletedDescendants(entry.item, childrenByParent));\n const projectedReady = concreteReady.length > 0 ? concreteReady : rankedReady;\n\n const readyRows = projectedReady.map((entry) => toNextActionableItem(entry, statusRegistry, childrenByParent));\n const blockedRows = rankedBlocked.map((entry) => toNextActionableItem(entry, statusRegistry, childrenByParent));\n\n const recommended = buildNextRecommendation({\n projectedReady,\n readyRows,\n statusRegistry,\n now,\n completedContainer: concreteReady.length === 0,\n });\n\n const result: NextResult = {\n output_default: \"toon\",\n now,\n recommended,\n ready: readyRows.slice(0, limit),\n blocked: readyOnly ? [] : blockedRows.slice(0, blockedLimit),\n summary: {\n recommended: recommended !== null,\n ready: readyRows.length,\n blocked: blockedRows.length,\n in_progress: inProgressReadyCount(readyRows, statusRegistry),\n candidates: report.active_count,\n containers: report.container_count,\n },\n filters: {\n type: options.type ?? null,\n tag: options.tag ?? null,\n priority: options.priority ?? null,\n assignee: options.assignee ?? null,\n assignee_filter: options.assigneeFilter ?? null,\n sprint: options.sprint ?? null,\n release: options.release ?? null,\n parent: parentScope.length > 0 ? parentScope : null,\n limit,\n blocked_limit: blockedLimit,\n ready_only: readyOnly,\n },\n };\n\n const warnings = [...new Set([...(candidatesList.warnings ?? []), ...(corpusList.warnings ?? [])])].sort((a, b) =>\n a.localeCompare(b),\n );\n if (warnings.length > 0) result.warnings = warnings;\n\n result.suggestions = buildNextSuggestions(recommended, blockedRows);\n\n return result;\n}\n\n/**\n * Renders a {@link NextResult} as compact agent-readable markdown: the\n * recommendation with its rationale, the ranked ready queue, and (unless\n * `--ready-only`) the blocked queue annotated with each item's open blockers.\n */\nexport function renderNextMarkdown(result: NextResult): string {\n const lines: string[] = [\"# pm next\", \"\"];\n lines.push(`- now: ${result.now}`);\n lines.push(\n `- ready: ${result.summary.ready} (in_progress: ${result.summary.in_progress}), blocked: ${result.summary.blocked}, candidates: ${result.summary.candidates}`,\n );\n if (result.filters.parent) {\n lines.push(`- scope: subtree of ${result.filters.parent}`);\n }\n lines.push(\"\");\n\n lines.push(\"## Recommended\");\n if (result.recommended) {\n lines.push(`- ${formatNextLine(result.recommended)}`);\n lines.push(` why: ${result.recommended.reasons.join(\"; \")}`);\n } else {\n lines.push(\"No ready work.\");\n }\n lines.push(\"\");\n\n lines.push(\"## Ready\");\n if (result.ready.length === 0) {\n lines.push(\"No ready items.\");\n } else {\n for (const item of result.ready) {\n lines.push(`- ${formatNextLine(item)}`);\n }\n }\n lines.push(\"\");\n\n if (!result.filters.ready_only) {\n lines.push(\"## Blocked\");\n if (result.blocked.length === 0) {\n lines.push(\"No blocked items.\");\n } else {\n for (const item of result.blocked) {\n const by = item.blockers\n .map((blocker) => `${blocker.id}(${blocker.status ?? \"?\"})`)\n .join(\", \");\n lines.push(`- ${formatNextLine(item)} blocked_by:${by}`);\n }\n }\n lines.push(\"\");\n }\n\n if (result.suggestions && result.suggestions.length > 0) {\n lines.push(\"## Suggestions\");\n for (const suggestion of result.suggestions) {\n lines.push(`- ${suggestion}`);\n }\n }\n\n return lines.join(\"\\n\").trimEnd();\n}\n\n// Formats a single actionable row: id, priority, status, type, deadline, parent,\n// downstream-unblock count, and title. Mirrors the context focus-line shape.\nfunction formatNextLine(item: NextActionableItem): string {\n const deadlineToken = item.deadline ?? \"-\";\n const parentToken = item.parent ? ` parent:${item.parent}` : \"\";\n const unblocksToken = item.unblocks.length > 0 ? ` unblocks:${item.unblocks.length}` : \"\";\n return `${item.id} p${item.priority} ${item.status} ${item.type} deadline:${deadlineToken}${parentToken}${unblocksToken} ${item.title}`;\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;;;AACH,OAAO,EACL,mBAAmB,EACnB,0BAA0B,GAE3B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,4BAA4B,EAA8B,MAAM,qCAAqC,CAAC;AAC/G,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,2BA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,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;YAC3D,CAAC;QACH,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjB,CAAC;IAED,IAAI,MAAM,CAAC,WAAW,IAAI,MAAM,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACxD,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAC7B,KAAK,MAAM,UAAU,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;YAC5C,KAAK,CAAC,IAAI,CAAC,KAAK,UAAU,EAAE,CAAC,CAAC;QAChC,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;AACpC,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,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1F,OAAO,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;AAC1I,CAAC","debugId":"d9a631ec-bdfe-5b4d-8b69-60965965f73f"}
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 { resolveRuntimeStatusRegistry, type RuntimeStatusRegistry } 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 { normalizeStatusInput, normalizeStatusForRegistry } from \"../../core/item/status.js\";\nimport { resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport type { ItemFrontMatter, ItemStatus } from \"../../types/index.js\";\nimport { parseIntegerLimit } from \"../shared-parsers.js\";\nimport {\n buildChildrenByParent,\n buildItemContextRelevanceCandidates,\n collectSubtreeIds,\n compareCriticalItems,\n toContextRankingSummary,\n toContextFocusItem,\n type ContextFocusItem,\n type ContextRankingSummary,\n} from \"./context.js\";\nimport { runList, type ListOptions } from \"./list.js\";\nimport { scoreContextCandidatesWithActiveExtensions } from \"../../sdk/context-relevance.js\";\n\nexport const NEXT_OUTPUT_VALUES = [\"markdown\", \"toon\", \"json\"] as const;\n/**\n * Restricts `pm next` output format values accepted by command, SDK, and storage contracts.\n */\nexport type NextOutputFormat = (typeof NEXT_OUTPUT_VALUES)[number];\n\nconst DEFAULT_NEXT_LIMIT = 5;\nconst MS_PER_DAY = 24 * 60 * 60 * 1000;\n\n/**\n * Documents the `pm next` options payload exchanged by command, SDK, and package integrations.\n */\nexport interface NextOptions {\n type?: string;\n tag?: string;\n priority?: string;\n assignee?: string;\n assigneeFilter?: string;\n sprint?: string;\n release?: string;\n parent?: string;\n limit?: string;\n blockedLimit?: string;\n readyOnly?: boolean;\n format?: string;\n explainRanking?: boolean;\n [key: string]: unknown;\n}\n\n/** A blocker reference projected onto the `pm next` output. */\nexport interface NextBlockerRef {\n id: string;\n title: string | null;\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 open_blocker_count: number;\n blockers: NextBlockerRef[];\n unblocks: string[];\n}\n\n/** The single recommended next item: an actionable row plus its rationale. */\nexport interface NextRecommendation extends NextActionableItem {\n reasons: string[];\n}\n\ninterface NextSummary {\n recommended: boolean;\n ready: number;\n blocked: number;\n in_progress: number;\n candidates: number;\n containers: number;\n}\n\n/**\n * Documents the `pm next` result payload exchanged by command, SDK, and package integrations.\n */\nexport interface NextResult {\n output_default: \"toon\";\n now: string;\n recommended: NextRecommendation | null;\n ready: NextActionableItem[];\n blocked: NextActionableItem[];\n summary: NextSummary;\n filters: {\n type: string | null;\n tag: string | null;\n priority: string | null;\n assignee: string | null;\n assignee_filter: string | null;\n sprint: string | null;\n release: string | null;\n parent: string | null;\n limit: number;\n blocked_limit: number;\n ready_only: boolean;\n };\n suggestions?: string[];\n warnings?: string[];\n ranking?: ContextRankingSummary;\n}\n\nfunction parseNextOutputFormat(raw: string | undefined): 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(\"Next format must be one of markdown|toon|json\", EXIT_CODE.USAGE);\n }\n return normalized as NextOutputFormat;\n}\n\n/**\n * Resolves the effective `pm next` output format from the command `--format` flag\n * and the global `--json` switch, rejecting the contradictory `--json --format\n * markdown|toon` combination. Defaults to `toon`.\n */\nexport function resolveNextOutputFormat(options: NextOptions, global: GlobalOptions): NextOutputFormat {\n const commandFormat = parseNextOutputFormat(options.format);\n if (global.json && commandFormat && commandFormat !== \"json\") {\n throw new PmCliError(\"Cannot combine --json with --format markdown|toon\", EXIT_CODE.USAGE);\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(raw: string | undefined, flag: string, fallback: number): number {\n const parsed = parseIntegerLimit(raw, flag);\n if (parsed === undefined || parsed <= 0) return fallback;\n return parsed;\n}\n\n// Projects an actionable entry onto its output row. Ready entries carry no\n// blockers; blocked entries surface their unresolved blockers for the agent.\nfunction toNextActionableItem(\n entry: ActionableEntry,\n statusRegistry: RuntimeStatusRegistry,\n childrenByParent: Map<string, ItemFrontMatter[]>,\n): NextActionableItem {\n return {\n ...toContextFocusItem(entry.item, statusRegistry, childrenByParent),\n open_blocker_count: entry.open_blockers.length,\n blockers: entry.open_blockers.map((blocker) => ({ id: blocker.id, title: blocker.title, status: blocker.status })),\n unblocks: entry.unblocks,\n };\n}\n\n// Builds the human+agent readable rationale for the recommended item, ordering\n// clauses from most to least decisive (status, priority, deadline, blocker\n// clearance, parent advancement, downstream unblocks).\nfunction buildRecommendationReasons(\n entry: ActionableEntry,\n statusRegistry: RuntimeStatusRegistry,\n now: string,\n completedContainer: boolean,\n): string[] {\n const item = entry.item;\n const reasons: string[] = [];\n const inProgressStatus = normalizeStatusInput(\"in_progress\", statusRegistry);\n reasons.push(\n normalizeStatusForRegistry(item.status, statusRegistry) === inProgressStatus\n ? \"in progress — resume to finish\"\n : \"open and ready to start\",\n );\n if (completedContainer) {\n reasons.push(\"completed container — governance closeout\");\n }\n reasons.push(`priority p${item.priority}${item.priority === 0 ? \" (highest)\" : \"\"}`);\n if (typeof item.deadline === \"string\" && item.deadline.trim().length > 0) {\n reasons.push(describeDeadline(item.deadline, now));\n }\n reasons.push(collectBlockedByIds(item).length > 0 ? \"all blockers resolved\" : \"no blockers\");\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(`unblocks ${entry.unblocks.length} item(s): ${entry.unblocks.join(\", \")}`);\n }\n return reasons;\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((Date.parse(dateToken) - Date.parse(nowToken)) / MS_PER_DAY);\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(ready: NextActionableItem[], statusRegistry: RuntimeStatusRegistry): number {\n const inProgressStatus = normalizeStatusInput(\"in_progress\", statusRegistry);\n return ready.filter((item) => normalizeStatusForRegistry(item.status, statusRegistry) === inProgressStatus).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(item: ItemFrontMatter, childrenByParent: Map<string, ItemFrontMatter[]>): 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(options: NextOptions, extra: Partial<ListOptions>): ListOptions {\n return {\n type: options.type,\n tag: options.tag,\n priority: options.priority,\n assignee: options.assignee,\n assigneeFilter: options.assigneeFilter,\n sprint: options.sprint,\n release: options.release,\n noTruncate: true,\n ...extra,\n };\n}\n\nfunction rankNextReadyEntries(\n ready: ActionableEntry[],\n childrenByParent: Map<string, ItemFrontMatter[]>,\n statusRegistry: RuntimeStatusRegistry,\n): ActionableEntry[] {\n return [...ready].sort((left, right) => {\n const leftCompletedContainer = hasCompletedDescendants(left.item, childrenByParent);\n const rightCompletedContainer = hasCompletedDescendants(right.item, childrenByParent);\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(recommended: NextRecommendation | null, blockedRows: NextActionableItem[]): string[] | undefined {\n if (recommended !== null) {\n return undefined;\n }\n if (blockedRows.length > 0) {\n return [\n `${blockedRows.length} item(s) are blocked; unblock the top one by closing ${blockedRows[0].blockers\n .map((blocker) => blocker.id)\n .join(\", \")}`,\n \"pm next --ready-only after a blocker closes to re-check ready work\",\n 'pm create --type Task --title \"...\" to add new ready work',\n ];\n }\n return [\n 'pm create --type Task --title \"...\" to add a new work item',\n \"pm list --status in_progress to review work already underway\",\n \"pm context --depth deep for the full project snapshot\",\n ];\n}\n\nfunction filterCandidatesByParentScope(\n candidates: ItemFrontMatter[],\n corpus: ItemFrontMatter[],\n parentScope: string,\n): ItemFrontMatter[] {\n if (!parentScope) {\n return candidates;\n }\n const subtree = collectSubtreeIds(corpus, parentScope);\n if (!subtree.found) {\n throw new PmCliError(`Next --parent item not found: ${parentScope}`, EXIT_CODE.NOT_FOUND);\n }\n return candidates.filter((item) => subtree.ids.has(item.id.trim().toLowerCase()));\n}\n\nasync function rankReadyEntriesWithRelevance(\n rankedReady: ActionableEntry[],\n childrenByParent: Map<string, ItemFrontMatter[]>,\n statusRegistry: RuntimeStatusRegistry,\n now: string,\n): Promise<{\n projectedReady: ActionableEntry[];\n ranking: Awaited<ReturnType<typeof scoreContextCandidatesWithActiveExtensions<ItemFrontMatter>>>;\n completedContainer: boolean;\n}> {\n const concreteReady = rankedReady.filter((entry) => !hasCompletedDescendants(entry.item, childrenByParent));\n const structuralReady = concreteReady.length > 0 ? concreteReady : rankedReady;\n const ranking = await scoreContextCandidatesWithActiveExtensions(\n \"next\",\n buildItemContextRelevanceCandidates(\n structuralReady.map((entry) => entry.item),\n statusRegistry,\n now,\n process.env.PM_AUTHOR,\n ),\n );\n const readyById = new Map(structuralReady.map((entry) => [entry.item.id, entry]));\n const projectedReady = ranking.ranked\n .map((entry) => readyById.get(entry.id))\n .filter((entry): entry is ActionableEntry => entry !== undefined);\n return { projectedReady, ranking, completedContainer: concreteReady.length === 0 };\n}\n\n/**\n * Implements `pm next`: computes the ranked ready/blocked actionable queues and a\n * single recommended next item with rationale for the public runtime surface.\n */\nexport async function runNext(options: NextOptions, global: GlobalOptions): 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(options.blockedLimit, \"--blocked-limit\", limit);\n const readyOnly = options.readyOnly === true;\n const parentScope = 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(undefined, nextListOptions(options, { excludeTerminal: true }), global);\n const corpusList = await runList(undefined, { excludeTerminal: false, noTruncate: true }, global);\n const candidates = filterCandidatesByParentScope(candidatesList.items as ItemFrontMatter[], corpusList.items as ItemFrontMatter[], parentScope);\n const corpus = corpusList.items as ItemFrontMatter[];\n\n const report = computeActionabilityReport(candidates, corpus, statusRegistry);\n const childrenByParent = buildChildrenByParent(corpus);\n const rankedReady = rankNextReadyEntries(report.ready, childrenByParent, statusRegistry);\n const rankedBlocked = [...report.blocked].sort((left, right) =>\n compareCriticalItems(left.item, right.item, statusRegistry),\n );\n const { projectedReady, ranking: readyRanking, completedContainer } = await rankReadyEntriesWithRelevance(\n rankedReady,\n childrenByParent,\n statusRegistry,\n now,\n );\n\n const readyRows = projectedReady.map((entry) => toNextActionableItem(entry, statusRegistry, childrenByParent));\n const blockedRows = rankedBlocked.map((entry) => toNextActionableItem(entry, statusRegistry, childrenByParent));\n\n const recommended = buildNextRecommendation({\n projectedReady,\n readyRows,\n statusRegistry,\n now,\n completedContainer,\n });\n\n const result: NextResult = {\n output_default: \"toon\",\n now,\n recommended,\n ready: readyRows.slice(0, limit),\n blocked: readyOnly ? [] : blockedRows.slice(0, blockedLimit),\n summary: {\n recommended: recommended !== null,\n ready: readyRows.length,\n blocked: blockedRows.length,\n in_progress: inProgressReadyCount(readyRows, statusRegistry),\n candidates: report.active_count,\n containers: report.container_count,\n },\n filters: {\n type: options.type ?? null,\n tag: options.tag ?? null,\n priority: options.priority ?? null,\n assignee: options.assignee ?? null,\n assignee_filter: options.assigneeFilter ?? null,\n sprint: options.sprint ?? null,\n release: options.release ?? null,\n parent: parentScope.length > 0 ? parentScope : null,\n limit,\n blocked_limit: blockedLimit,\n ready_only: readyOnly,\n },\n };\n\n const warnings = [...new Set([...(candidatesList.warnings ?? []), ...(corpusList.warnings ?? []), ...(readyRanking.warnings ?? [])])].sort((a, b) =>\n a.localeCompare(b),\n );\n if (warnings.length > 0) result.warnings = warnings;\n if (options.explainRanking === true) result.ranking = toContextRankingSummary(readyRanking);\n\n result.suggestions = buildNextSuggestions(recommended, blockedRows);\n\n return result;\n}\n\n/**\n * Renders a {@link NextResult} as compact agent-readable markdown: the\n * recommendation with its rationale, the ranked ready queue, and (unless\n * `--ready-only`) the blocked queue annotated with each item's open blockers.\n */\nexport function renderNextMarkdown(result: NextResult): string {\n const lines: string[] = [\"# pm next\", \"\"];\n lines.push(`- now: ${result.now}`);\n lines.push(\n `- ready: ${result.summary.ready} (in_progress: ${result.summary.in_progress}), blocked: ${result.summary.blocked}, candidates: ${result.summary.candidates}`,\n );\n if (result.filters.parent) {\n lines.push(`- scope: subtree of ${result.filters.parent}`);\n }\n lines.push(\"\");\n\n lines.push(\"## Recommended\");\n if (result.recommended) {\n lines.push(`- ${formatNextLine(result.recommended)}`);\n lines.push(` why: ${result.recommended.reasons.join(\"; \")}`);\n } else {\n lines.push(\"No ready work.\");\n }\n lines.push(\"\");\n\n lines.push(\"## Ready\");\n if (result.ready.length === 0) {\n lines.push(\"No ready items.\");\n } else {\n for (const item of result.ready) {\n lines.push(`- ${formatNextLine(item)}`);\n }\n }\n lines.push(\"\");\n\n if (!result.filters.ready_only) {\n lines.push(\"## Blocked\");\n if (result.blocked.length === 0) {\n lines.push(\"No blocked items.\");\n } else {\n for (const item of result.blocked) {\n const by = item.blockers\n .map((blocker) => `${blocker.id}(${blocker.status ?? \"?\"})`)\n .join(\", \");\n lines.push(`- ${formatNextLine(item)} blocked_by:${by}`);\n }\n }\n lines.push(\"\");\n }\n\n if (result.suggestions && result.suggestions.length > 0) {\n lines.push(\"## Suggestions\");\n for (const suggestion of result.suggestions) {\n lines.push(`- ${suggestion}`);\n }\n }\n\n return lines.join(\"\\n\").trimEnd();\n}\n\n// Formats a single actionable row: id, priority, status, type, deadline, parent,\n// downstream-unblock count, and title. Mirrors the context focus-line shape.\nfunction formatNextLine(item: NextActionableItem): string {\n const deadlineToken = item.deadline ?? \"-\";\n const parentToken = item.parent ? ` parent:${item.parent}` : \"\";\n const unblocksToken = item.unblocks.length > 0 ? ` unblocks:${item.unblocks.length}` : \"\";\n return `${item.id} p${item.priority} ${item.status} ${item.type} deadline:${deadlineToken}${parentToken}${unblocksToken} ${item.title}`;\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;;;AACH,OAAO,EACL,mBAAmB,EACnB,0BAA0B,GAE3B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,4BAA4B,EAA8B,MAAM,qCAAqC,CAAC;AAC/G,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,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAC7F,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EACL,qBAAqB,EACrB,mCAAmC,EACnC,iBAAiB,EACjB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,GAGnB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,OAAO,EAAoB,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,0CAA0C,EAAE,MAAM,gCAAgC,CAAC;AAE5F,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAU,CAAC;AAMxE,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAC7B,MAAM,UAAU,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAkFvC,SAAS,qBAAqB,CAAC,GAAuB;IACpD,IAAI,CAAC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AM,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1F,OAAO,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;AAC1I,CAAC","debugId":"d5cba08f-3c08-5e34-a556-42a3920b20ec"}
@@ -1,9 +1,13 @@
1
+ import { resolveItemTypeRegistry } from "../../core/item/type-registry.js";
1
2
  import { type RuntimeFieldRegistry, type RuntimeStatusRegistry } from "../../core/schema/runtime-schema.js";
2
3
  import { type NormalizedTypeWorkflow } from "../../core/schema/type-workflows.js";
3
4
  import type { GlobalOptions } from "../../core/shared/command-types.js";
4
5
  import { PmCliError } from "../../core/shared/errors.js";
5
- import type { Dependency, GovernanceWorkflowEnforcement } from "../../types/index.js";
6
+ import { getActiveExtensionRegistrations } from "../../core/extensions/index.js";
7
+ import { readSettings } from "../../core/store/settings.js";
8
+ import type { Dependency, GovernanceWorkflowEnforcement, ItemDocument } from "../../types/index.js";
6
9
  import { DEPENDENCY_KIND_VALUES } from "../../types/index.js";
10
+ import { parseDocs, parseFiles, parseLogSeed, parseTests } from "./create.js";
7
11
  import type { MutationMetadataCommandOptions, SharedLinkedResourceClearOptions, SharedLinkedResourceOptions } from "./mutation-command-options.js";
8
12
  /**
9
13
  * Documents the update command options payload exchanged by command, SDK, and package integrations.
@@ -83,11 +87,38 @@ declare function reconcileBlockedByDependency(current: Dependency[] | undefined,
83
87
  declare function matchesDependencySelector(value: Dependency, selector: DependencyRemovalSelector): boolean;
84
88
  declare function normalizeUpdatePolicyOptionKey(raw: string, typeName: string): string;
85
89
  declare function collectProvidedUpdatePolicyOptions(options: UpdateCommandOptions, runtimeFieldRegistry: RuntimeFieldRegistry, extensionFieldNames: readonly string[]): Set<string>;
90
+ interface UpdateMutationContext {
91
+ options: UpdateCommandOptions;
92
+ settings: Awaited<ReturnType<typeof readSettings>>;
93
+ typeRegistry: ReturnType<typeof resolveItemTypeRegistry>;
94
+ statusRegistry: RuntimeStatusRegistry;
95
+ runtimeFieldRegistry: RuntimeFieldRegistry;
96
+ extensionRegistrations: ReturnType<typeof getActiveExtensionRegistrations>;
97
+ extensionFieldNames: readonly string[];
98
+ clearFrontMatterKeys: ReadonlySet<string>;
99
+ dependencyUpdates: ParsedDependencyUpdates;
100
+ dependencyRemovals: DependencyRemovalSelector[];
101
+ commentUpdates: ReturnType<typeof parseLogSeed>;
102
+ noteUpdates: ReturnType<typeof parseLogSeed>;
103
+ learningUpdates: ReturnType<typeof parseLogSeed>;
104
+ fileUpdates: ReturnType<typeof parseFiles>;
105
+ testUpdates: ReturnType<typeof parseTests>;
106
+ docUpdates: ReturnType<typeof parseDocs>;
107
+ resolvedParentValue: string | undefined;
108
+ resolvedBlockedByDependencyId: string | undefined;
109
+ runtimeFieldUpdates: Record<string, unknown>;
110
+ nowValue: Date;
111
+ nowIso: string;
112
+ author: string;
113
+ pmRoot: string;
114
+ }
115
+ declare function applyStatusAndCloseReasonMutations(document: ItemDocument, context: Pick<UpdateMutationContext, "options" | "statusRegistry" | "clearFrontMatterKeys" | "nowIso">, previousStatusNormalized: string, changedFields: string[]): void;
86
116
  /**
87
117
  * Implements run update for the public runtime surface of this module.
88
118
  */
89
119
  export declare function runUpdate(id: string, options: UpdateCommandOptions, global: GlobalOptions): Promise<UpdateResult>;
90
120
  export declare const _testOnlyUpdateCommand: {
121
+ applyStatusAndCloseReasonMutations: typeof applyStatusAndCloseReasonMutations;
91
122
  collectProvidedUpdatePolicyOptions: typeof collectProvidedUpdatePolicyOptions;
92
123
  buildAuditScopeRestrictedOptionsError: typeof buildAuditScopeRestrictedOptionsError;
93
124
  enforceAllowAuditUpdateScope: typeof enforceAllowAuditUpdateScope;
@@ -4,7 +4,7 @@
4
4
  * Implements the pm update command surface and its agent-facing runtime behavior.
5
5
  */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="74de80a0-4291-5c52-b619-620900850237")}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]="fd8e39c5-3271-5558-ab46-c0dc22a59cbe")}catch(e){}}();
8
8
  import { pathExists } from "../../core/fs/fs-utils.js";
9
9
  import { COMMON_MUTATION_COMMAND_OPTION_KEYS, canonicalizeCommandOptionKey, commandOptionFlagLabel, resolveItemTypeRegistry, resolveCommandOptionPolicyState, resolveTypeDefinition, resolveTypeName, validateTypeOptions, } from "../../core/item/type-registry.js";
10
10
  import { normalizeItemId } from "../../core/item/id.js";
@@ -476,17 +476,25 @@ function dependencyKey(value) {
476
476
  // pm-kyd6: `--blocked-by` writes the `blocked_by` scalar, but the dependency
477
477
  // graph (`pm deps`) is built only from the `dependencies` array. Mirror the
478
478
  // behaviour create.ts already has so the metadata and the graph agree: a
479
- // resolvable blocker also gets a `blocked_by` dependency edge, clearing the
480
- // scalar removes that edge, and re-pointing it replaces the prior edge.
479
+ // resolvable blocker also gets a `blocked_by` dependency edge. Repeated
480
+ // `--blocked-by` updates preserve prior blocker edges because the graph is the
481
+ // full dependency record; the scalar remains the latest primary blocker for
482
+ // backward compatibility. Clearing the scalar removes all derived blocker edges.
481
483
  function reconcileBlockedByDependency(current, nextBlockedById, nowIsoValue, author) {
482
484
  let next = [...(current ?? [])];
483
485
  let changed = false;
484
- const filtered = next.filter((dep) => dep.kind !== "blocked_by" || dep.id === nextBlockedById);
485
- if (filtered.length !== next.length) {
486
- next = filtered;
487
- changed = true;
486
+ if (nextBlockedById === undefined) {
487
+ const filtered = next.filter((dep) => dep.kind !== "blocked_by");
488
+ if (filtered.length !== next.length) {
489
+ next = filtered;
490
+ changed = true;
491
+ }
492
+ if (!changed) {
493
+ return { dependencies: current, changed: false };
494
+ }
495
+ return { dependencies: next.length > 0 ? next : undefined, changed: true };
488
496
  }
489
- if (nextBlockedById && !next.some((dep) => dep.kind === "blocked_by" && dep.id === nextBlockedById)) {
497
+ if (!next.some((dep) => dep.kind === "blocked_by" && dep.id === nextBlockedById)) {
490
498
  next.push({ id: nextBlockedById, kind: "blocked_by", created_at: nowIsoValue, author });
491
499
  changed = true;
492
500
  }
@@ -1083,11 +1091,27 @@ function applySimpleItemMutations(document, options, statusRegistry, changedFiel
1083
1091
  }
1084
1092
  return normalizeStatusInput(document.metadata.status, statusRegistry) ?? document.metadata.status;
1085
1093
  }
1094
+ function hasClosedAt(metadata) {
1095
+ return metadata.closed_at !== undefined && metadata.closed_at !== null;
1096
+ }
1097
+ function hasClosedAtProperty(metadata) {
1098
+ return metadata.closed_at !== undefined;
1099
+ }
1086
1100
  function applyStatusAndCloseReasonMutations(document, context, previousStatusNormalized, changedFields) {
1087
1101
  if (context.options.status !== undefined) {
1088
1102
  const status = parseStatus(context.options.status, context.statusRegistry);
1089
1103
  document.metadata.status = status;
1090
1104
  changedFields.push("status");
1105
+ if (status === context.statusRegistry.close_status && !hasClosedAt(document.metadata)) {
1106
+ document.metadata.closed_at = context.nowIso;
1107
+ changedFields.push("closed_at");
1108
+ }
1109
+ else if (previousStatusNormalized === context.statusRegistry.close_status &&
1110
+ status !== context.statusRegistry.close_status &&
1111
+ hasClosedAtProperty(document.metadata)) {
1112
+ delete document.metadata.closed_at;
1113
+ changedFields.push("closed_at");
1114
+ }
1091
1115
  }
1092
1116
  if (context.options.closeReason !== undefined || context.clearFrontMatterKeys.has("close_reason")) {
1093
1117
  if (context.clearFrontMatterKeys.has("close_reason")) {
@@ -1357,7 +1381,9 @@ function applyBlockedByMutation(document, context, changedFields) {
1357
1381
  document.metadata.blocked_by = context.options.blockedBy?.trim() ?? "";
1358
1382
  }
1359
1383
  changedFields.push("blocked_by");
1360
- applyBlockedByDependencyEdge(document.metadata, context.resolvedBlockedByDependencyId, context.nowIso, context.author, changedFields);
1384
+ if (context.clearFrontMatterKeys.has("blocked_by") || context.resolvedBlockedByDependencyId !== undefined) {
1385
+ applyBlockedByDependencyEdge(document.metadata, context.resolvedBlockedByDependencyId, context.nowIso, context.author, changedFields);
1386
+ }
1361
1387
  }
1362
1388
  function applyScheduleMutations(document, context, changedFields) {
1363
1389
  if (context.options.reminder !== undefined || context.clearFrontMatterKeys.has("reminders")) {
@@ -1595,6 +1621,7 @@ export async function runUpdate(id, options, global) {
1595
1621
  }
1596
1622
  /* c8 ignore stop */
1597
1623
  export const _testOnlyUpdateCommand = {
1624
+ applyStatusAndCloseReasonMutations,
1598
1625
  collectProvidedUpdatePolicyOptions,
1599
1626
  buildAuditScopeRestrictedOptionsError,
1600
1627
  enforceAllowAuditUpdateScope,
@@ -1609,4 +1636,4 @@ export const _testOnlyUpdateCommand = {
1609
1636
  resolveRuntimeUnsetDefinition: (token, registry) => resolveRuntimeUnsetFieldDefinition(token, "update", registry),
1610
1637
  };
1611
1638
  //# sourceMappingURL=update.js.map
1612
- //# debugId=74de80a0-4291-5c52-b619-620900850237
1639
+ //# debugId=fd8e39c5-3271-5558-ab46-c0dc22a59cbe