@unbrained/pm-cli 2026.7.18 → 2026.7.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (497) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +17 -0
  3. package/dist/cli/commands/claim.js +6 -4
  4. package/dist/cli/commands/claim.js.map +1 -1
  5. package/dist/cli/commands/comments.js +5 -2
  6. package/dist/cli/commands/comments.js.map +1 -1
  7. package/dist/cli/commands/context.d.ts +10 -1
  8. package/dist/cli/commands/context.js +44 -6
  9. package/dist/cli/commands/context.js.map +1 -1
  10. package/dist/cli/commands/create.js +15 -4
  11. package/dist/cli/commands/create.js.map +1 -1
  12. package/dist/cli/commands/next.js +13 -3
  13. package/dist/cli/commands/next.js.map +1 -1
  14. package/dist/cli/commands/update.js +14 -3
  15. package/dist/cli/commands/update.js.map +1 -1
  16. package/dist/cli/error-guidance.js +23 -4
  17. package/dist/cli/error-guidance.js.map +1 -1
  18. package/dist/cli/extension-command-help.d.ts +11 -0
  19. package/dist/cli/extension-command-help.js +62 -2
  20. package/dist/cli/extension-command-help.js.map +1 -1
  21. package/dist/cli/main.d.ts +1 -0
  22. package/dist/cli/main.js +16 -11
  23. package/dist/cli/main.js.map +1 -1
  24. package/dist/cli-bundle/bundle-manifest.json +326 -350
  25. package/dist/cli-bundle/chunks/{append-5YF3TO7I.js → append-MBXHNWSX.js} +5 -5
  26. package/dist/cli-bundle/chunks/append-XUYF7NON.js +11 -0
  27. package/dist/cli-bundle/chunks/{chunk-BIRYX32V.js → chunk-2UCG5H6B.js} +3 -3
  28. package/dist/cli-bundle/chunks/{chunk-VE6ZSTQW.js → chunk-2XPDCXK5.js} +4 -4
  29. package/dist/cli-bundle/chunks/{chunk-I3INI567.js → chunk-3EZZTFL2.js} +909 -124
  30. package/dist/cli-bundle/chunks/chunk-3EZZTFL2.js.map +7 -0
  31. package/dist/cli-bundle/chunks/{chunk-GLZKZON6.js → chunk-3HSRP6T2.js} +2 -2
  32. package/dist/cli-bundle/chunks/{chunk-XWBD6DSR.js → chunk-3KPNOZOH.js} +23 -23
  33. package/dist/cli-bundle/chunks/{chunk-MR4SHYR4.js → chunk-3QNUDDY2.js} +104 -23
  34. package/dist/cli-bundle/chunks/chunk-3QNUDDY2.js.map +7 -0
  35. package/dist/cli-bundle/chunks/{chunk-SIPOACV5.js → chunk-46Z6FAVP.js} +888 -124
  36. package/dist/cli-bundle/chunks/chunk-46Z6FAVP.js.map +1 -0
  37. package/dist/cli-bundle/chunks/{chunk-HO4DLBNK.js → chunk-4M6RZJXF.js} +2 -2
  38. package/dist/cli-bundle/chunks/{chunk-RXPQ5Q23.js → chunk-4PSJVGRE.js} +11 -11
  39. package/dist/cli-bundle/chunks/{chunk-ADXDCAKP.js → chunk-5S6IZXK7.js} +146 -32
  40. package/dist/cli-bundle/chunks/{chunk-IL5SPRMH.js.map → chunk-5S6IZXK7.js.map} +7 -1
  41. package/dist/cli-bundle/chunks/chunk-66SRNEBK.js +143 -0
  42. package/dist/cli-bundle/chunks/chunk-66SRNEBK.js.map +7 -0
  43. package/dist/cli-bundle/chunks/{chunk-YFE7JHX3.js → chunk-6BNV3G6C.js} +2 -2
  44. package/dist/cli-bundle/chunks/{chunk-43UMFKCK.js → chunk-6V4T4RD3.js} +23 -23
  45. package/dist/cli-bundle/chunks/chunk-77XFQRTD.js +140 -0
  46. package/dist/cli-bundle/chunks/chunk-77XFQRTD.js.map +1 -0
  47. package/dist/cli-bundle/chunks/{chunk-EHJFUOXL.js → chunk-7B7IHMLH.js} +3 -3
  48. package/dist/cli-bundle/chunks/{chunk-I7DIDUSP.js → chunk-7CHWLT2J.js} +2 -2
  49. package/dist/cli-bundle/chunks/{chunk-L6FVNR7X.js → chunk-A3GAQLBH.js} +5 -5
  50. package/dist/cli-bundle/chunks/{chunk-B57RJHBZ.js → chunk-A4FVWFZY.js} +4 -4
  51. package/dist/cli-bundle/chunks/{chunk-D52ZN3BF.js → chunk-A5EQPNV7.js} +2 -2
  52. package/dist/cli-bundle/chunks/{chunk-TZAE66GQ.js → chunk-AGEBQRBG.js} +15 -15
  53. package/dist/cli-bundle/chunks/{chunk-WU3KAN6A.js → chunk-AQUNTB7G.js} +3 -3
  54. package/dist/cli-bundle/chunks/{chunk-OGVTB5VO.js → chunk-AR24KW26.js} +237 -36
  55. package/dist/cli-bundle/chunks/chunk-AR24KW26.js.map +7 -0
  56. package/dist/cli-bundle/chunks/{chunk-XWYQ2LT4.js → chunk-BBGR4FKQ.js} +4 -4
  57. package/dist/cli-bundle/chunks/{chunk-HTXXXF45.js → chunk-BDC4TW4B.js} +98 -24
  58. package/dist/cli-bundle/chunks/chunk-BDC4TW4B.js.map +1 -0
  59. package/dist/cli-bundle/chunks/{chunk-2FUOXSRN.js → chunk-BFJP4VYC.js} +4 -4
  60. package/dist/cli-bundle/chunks/{chunk-633PKXLT.js → chunk-BZKE2O5V.js} +3 -3
  61. package/dist/cli-bundle/chunks/{chunk-XPUTSGJU.js → chunk-CZA2DXCV.js} +230 -36
  62. package/dist/cli-bundle/chunks/chunk-CZA2DXCV.js.map +1 -0
  63. package/dist/cli-bundle/chunks/{chunk-KX62NMZC.js → chunk-D35WYXWC.js} +626 -5
  64. package/dist/cli-bundle/chunks/chunk-D35WYXWC.js.map +1 -0
  65. package/dist/cli-bundle/chunks/chunk-DOASIOQR.js +289 -0
  66. package/dist/cli-bundle/chunks/chunk-DOASIOQR.js.map +7 -0
  67. package/dist/cli-bundle/chunks/{chunk-L337QKWJ.js → chunk-DUDLSQFG.js} +5 -5
  68. package/dist/cli-bundle/chunks/{chunk-BVLOMU6O.js → chunk-E7KBMWEF.js} +2 -2
  69. package/dist/cli-bundle/chunks/{chunk-3QDR6ZLU.js → chunk-EAV3P54W.js} +9 -9
  70. package/dist/cli-bundle/chunks/{chunk-3QDR6ZLU.js.map → chunk-EAV3P54W.js.map} +2 -2
  71. package/dist/cli-bundle/chunks/{chunk-WQXRZMFN.js → chunk-EEECAV5M.js} +2 -2
  72. package/dist/cli-bundle/chunks/{chunk-35FHWD4C.js → chunk-EI3UIMZM.js} +4 -4
  73. package/dist/cli-bundle/chunks/{chunk-RGMWJLXF.js → chunk-EVAN5VJA.js} +8 -5
  74. package/dist/cli-bundle/chunks/{chunk-RGMWJLXF.js.map → chunk-EVAN5VJA.js.map} +2 -2
  75. package/dist/cli-bundle/chunks/{chunk-PT7MCCGD.js → chunk-FIUTBFC6.js} +2 -2
  76. package/dist/cli-bundle/chunks/{chunk-7H5NNCJ5.js → chunk-FQF6VVPH.js} +4 -4
  77. package/dist/cli-bundle/chunks/{chunk-6DYOZS6C.js → chunk-FQO5THHM.js} +2 -2
  78. package/dist/cli-bundle/chunks/{chunk-5HGZKQUL.js → chunk-FQODDTE7.js} +4 -4
  79. package/dist/cli-bundle/chunks/{chunk-67RO3H4N.js → chunk-G33XIMRT.js} +6 -6
  80. package/dist/cli-bundle/chunks/{chunk-D53RTYVI.js → chunk-GFZB5CLP.js} +20 -10
  81. package/dist/cli-bundle/chunks/chunk-GFZB5CLP.js.map +7 -0
  82. package/dist/cli-bundle/chunks/{chunk-QWBKN3QC.js → chunk-GKCEEXMA.js} +8 -8
  83. package/dist/cli-bundle/chunks/{chunk-DG2EQRIH.js → chunk-GRDK25BN.js} +7 -7
  84. package/dist/cli-bundle/chunks/{chunk-FXFCFL73.js → chunk-H3YKUVDR.js} +5 -5
  85. package/dist/cli-bundle/chunks/{chunk-IL5SPRMH.js → chunk-IEMXESIS.js} +123 -16
  86. package/dist/cli-bundle/chunks/chunk-IEMXESIS.js.map +1 -0
  87. package/dist/cli-bundle/chunks/{chunk-ARGDWQ4J.js → chunk-IGBBTPM5.js} +2 -2
  88. package/dist/cli-bundle/chunks/{chunk-QPGQNLPI.js → chunk-IR3GOO6E.js} +3842 -4109
  89. package/dist/cli-bundle/chunks/chunk-IR3GOO6E.js.map +1 -0
  90. package/dist/cli-bundle/chunks/{chunk-FY4RLHSC.js → chunk-IRJ6F23W.js} +2 -2
  91. package/dist/cli-bundle/chunks/{chunk-66MKH7SZ.js → chunk-IXG5CMBR.js} +4 -4
  92. package/dist/cli-bundle/chunks/{chunk-F3VC3GOV.js → chunk-JBW2S2C6.js} +2090 -253
  93. package/dist/cli-bundle/chunks/chunk-JBW2S2C6.js.map +7 -0
  94. package/dist/cli-bundle/chunks/{chunk-7UCY6DR5.js → chunk-JPWUZOMR.js} +2 -2
  95. package/dist/cli-bundle/chunks/{chunk-FVNWHUME.js → chunk-K2L6FZBX.js} +8 -8
  96. package/dist/cli-bundle/chunks/chunk-KGPLSHJD.js +286 -0
  97. package/dist/cli-bundle/chunks/chunk-KGPLSHJD.js.map +1 -0
  98. package/dist/cli-bundle/chunks/{chunk-YQEZWI3R.js → chunk-KZ5AC6B5.js} +5 -3
  99. package/dist/cli-bundle/chunks/chunk-KZ5AC6B5.js.map +7 -0
  100. package/dist/cli-bundle/chunks/{chunk-X2MGQMZO.js → chunk-LT5UWU7H.js} +2 -2
  101. package/dist/cli-bundle/chunks/{chunk-KH6QAHME.js → chunk-M4B4RK4J.js} +3 -3
  102. package/dist/cli-bundle/chunks/{chunk-QRZNCRNA.js → chunk-MI3346YW.js} +377 -240
  103. package/dist/cli-bundle/chunks/chunk-MI3346YW.js.map +1 -0
  104. package/dist/cli-bundle/chunks/{chunk-2XOSFSTH.js → chunk-MQOSMBWV.js} +5 -5
  105. package/dist/cli-bundle/chunks/{chunk-YIIIAKCE.js → chunk-MRXAHR4B.js} +28 -22
  106. package/dist/cli-bundle/chunks/chunk-MRXAHR4B.js.map +1 -0
  107. package/dist/cli-bundle/chunks/{chunk-7R6UIHYY.js → chunk-N2TEEOXJ.js} +5 -5
  108. package/dist/cli-bundle/chunks/{chunk-NTRQLE2R.js → chunk-N7FCFJ76.js} +2 -2
  109. package/dist/cli-bundle/chunks/{chunk-37DRDP2B.js → chunk-NPEYH6CE.js} +5 -5
  110. package/dist/cli-bundle/chunks/{chunk-GKPCTQYG.js → chunk-NTS2RKHN.js} +3942 -4216
  111. package/dist/cli-bundle/chunks/chunk-NTS2RKHN.js.map +7 -0
  112. package/dist/cli-bundle/chunks/{chunk-6VHUGVNP.js → chunk-ODEIDKGW.js} +2062 -246
  113. package/dist/cli-bundle/chunks/chunk-ODEIDKGW.js.map +1 -0
  114. package/dist/cli-bundle/chunks/{chunk-2CXL335K.js → chunk-OK7VSX3N.js} +3 -3
  115. package/dist/cli-bundle/chunks/{chunk-NNANAWFH.js → chunk-OKPZDH43.js} +3 -3
  116. package/dist/cli-bundle/chunks/{chunk-G6MYGULG.js → chunk-OKWJUL6F.js} +6 -6
  117. package/dist/cli-bundle/chunks/{chunk-HPAYDSR2.js → chunk-P24ZU5QV.js} +27 -21
  118. package/dist/cli-bundle/chunks/chunk-P24ZU5QV.js.map +7 -0
  119. package/dist/cli-bundle/chunks/{chunk-TGBTLGPX.js → chunk-Q4PSG2GV.js} +13 -4
  120. package/dist/cli-bundle/chunks/{chunk-TGBTLGPX.js.map → chunk-Q4PSG2GV.js.map} +1 -1
  121. package/dist/cli-bundle/chunks/{chunk-5UKQLQM2.js → chunk-Q5NHJ6RO.js} +6 -4
  122. package/dist/cli-bundle/chunks/chunk-Q5NHJ6RO.js.map +1 -0
  123. package/dist/cli-bundle/chunks/{chunk-D5XHO4Q7.js → chunk-Q6JPYR7I.js} +2 -2
  124. package/dist/cli-bundle/chunks/{chunk-P22HGFFI.js → chunk-QFG4MB7P.js} +5 -5
  125. package/dist/cli-bundle/chunks/{chunk-P22HGFFI.js.map → chunk-QFG4MB7P.js.map} +1 -1
  126. package/dist/cli-bundle/chunks/{chunk-IE5KRAKN.js → chunk-QQ77W23U.js} +4 -4
  127. package/dist/cli-bundle/chunks/{chunk-M7MVOKVV.js → chunk-QYGK2XQ3.js} +3 -3
  128. package/dist/cli-bundle/chunks/{chunk-646MQXFW.js → chunk-RLLOZAM2.js} +4 -4
  129. package/dist/cli-bundle/chunks/{chunk-646MQXFW.js.map → chunk-RLLOZAM2.js.map} +2 -2
  130. package/dist/cli-bundle/chunks/{chunk-X5YCTFKT.js → chunk-RWAIRGBC.js} +3 -3
  131. package/dist/cli-bundle/chunks/{chunk-W5E2UUSH.js → chunk-RX53WHFI.js} +3 -3
  132. package/dist/cli-bundle/chunks/{chunk-R5XTTZSJ.js → chunk-SBW7EQC4.js} +5 -5
  133. package/dist/cli-bundle/chunks/{chunk-TM5CIO3F.js → chunk-SGJB6PXA.js} +3 -3
  134. package/dist/cli-bundle/chunks/{chunk-DDFGYUCQ.js → chunk-STBCBDKF.js} +7 -7
  135. package/dist/cli-bundle/chunks/{chunk-EX7OQT3Y.js → chunk-SUNZKVAH.js} +10 -10
  136. package/dist/cli-bundle/chunks/{chunk-EX7OQT3Y.js.map → chunk-SUNZKVAH.js.map} +1 -1
  137. package/dist/cli-bundle/chunks/{chunk-FHOBCGQO.js → chunk-SVAWG7EE.js} +2 -2
  138. package/dist/cli-bundle/chunks/{chunk-6O44IN44.js → chunk-T6MOTLOJ.js} +2 -2
  139. package/dist/cli-bundle/chunks/{chunk-HSYV4ZYT.js → chunk-TELI67UP.js} +9 -6
  140. package/dist/cli-bundle/chunks/{chunk-HSYV4ZYT.js.map → chunk-TELI67UP.js.map} +1 -1
  141. package/dist/cli-bundle/chunks/{chunk-EWIT5WIC.js → chunk-U6RYD446.js} +11 -11
  142. package/dist/cli-bundle/chunks/{chunk-E4FXM2XB.js → chunk-UE7LK3RE.js} +5 -5
  143. package/dist/cli-bundle/chunks/{chunk-N33FD2UI.js → chunk-UNNCT5QY.js} +3 -3
  144. package/dist/cli-bundle/chunks/{chunk-2IPNL3DR.js → chunk-UOIFZ66L.js} +3 -3
  145. package/dist/cli-bundle/chunks/{chunk-LSOWTLEM.js → chunk-UU6EP25G.js} +2 -2
  146. package/dist/cli-bundle/chunks/{chunk-HYTOJW2Q.js → chunk-UW6HCMP2.js} +15 -15
  147. package/dist/cli-bundle/chunks/{chunk-47HXN6RX.js → chunk-UWAQI3B7.js} +3 -3
  148. package/dist/cli-bundle/chunks/{chunk-YKFHF37B.js → chunk-V4QHAMI5.js} +3 -3
  149. package/dist/cli-bundle/chunks/{chunk-VAHZIPWS.js → chunk-VA3H7VVC.js} +4 -4
  150. package/dist/cli-bundle/chunks/{chunk-XC2HEEOV.js → chunk-VFA5EIEN.js} +21 -11
  151. package/dist/cli-bundle/chunks/chunk-VFA5EIEN.js.map +1 -0
  152. package/dist/cli-bundle/chunks/{chunk-TLWJP5BF.js → chunk-VQOG2ETB.js} +4 -4
  153. package/dist/cli-bundle/chunks/{chunk-H5IOT54C.js → chunk-VSQE43NO.js} +8 -8
  154. package/dist/cli-bundle/chunks/{chunk-BDA35QG5.js → chunk-W6IEJXNC.js} +2 -2
  155. package/dist/cli-bundle/chunks/{chunk-WACRQ26A.js → chunk-WCBB6VI3.js} +637 -9
  156. package/dist/cli-bundle/chunks/chunk-WCBB6VI3.js.map +7 -0
  157. package/dist/cli-bundle/chunks/{chunk-OWP6QFBV.js → chunk-XDWXPG2E.js} +4 -4
  158. package/dist/cli-bundle/chunks/{chunk-CKX4WOPC.js → chunk-XKVHL3MB.js} +2 -2
  159. package/dist/cli-bundle/chunks/{chunk-WL3SS45P.js → chunk-XVB6BATY.js} +3 -3
  160. package/dist/cli-bundle/chunks/{chunk-NVZ6NVHJ.js → chunk-XXWDEQ6O.js} +4 -4
  161. package/dist/cli-bundle/chunks/{chunk-ILVOOAT4.js → chunk-Y2VSGFT4.js} +8 -8
  162. package/dist/cli-bundle/chunks/{chunk-NCVT6XEL.js → chunk-YG56M3NE.js} +11 -11
  163. package/dist/cli-bundle/chunks/{chunk-AFGKSHAM.js → chunk-YGEA4CLH.js} +4 -4
  164. package/dist/cli-bundle/chunks/{chunk-AXRT7K5V.js → chunk-YIC5NGXF.js} +11 -11
  165. package/dist/cli-bundle/chunks/{chunk-DHNG452T.js → chunk-ZF52NVRT.js} +396 -245
  166. package/dist/cli-bundle/chunks/chunk-ZF52NVRT.js.map +7 -0
  167. package/dist/cli-bundle/chunks/{chunk-XXLXJL7V.js → chunk-ZUCBPXNA.js} +4 -4
  168. package/dist/cli-bundle/chunks/{close-X3CF6FQP.js → close-7NWA3GLA.js} +5 -5
  169. package/dist/cli-bundle/chunks/close-ZZCDDWJT.js +12 -0
  170. package/dist/cli-bundle/chunks/close-many-QCZHFCON.js +23 -0
  171. package/dist/cli-bundle/chunks/{close-many-J7A5EHOQ.js → close-many-YALQ7AXS.js} +14 -14
  172. package/dist/cli-bundle/chunks/comments-FMQNYPSZ.js +13 -0
  173. package/dist/cli-bundle/chunks/{comments-TMHMALA5.js → comments-SQIQ5WYR.js} +7 -7
  174. package/dist/cli-bundle/chunks/copy-GI3RCVZP.js +9 -0
  175. package/dist/cli-bundle/chunks/{copy-FWQA5OU4.js → copy-YDAMENCP.js} +4 -4
  176. package/dist/cli-bundle/chunks/{create-AQ5SIGZC.js → create-JSL6CXU3.js} +11 -9
  177. package/dist/cli-bundle/chunks/create-LXMLYJNM.js +29 -0
  178. package/dist/cli-bundle/chunks/delete-5DFAXJNI.js +10 -0
  179. package/dist/cli-bundle/chunks/{delete-YYYFOSEA.js → delete-IGVOZEU2.js} +4 -4
  180. package/dist/cli-bundle/chunks/{deps-NIIKXLPB.js → deps-BQAXUQAK.js} +6 -6
  181. package/dist/cli-bundle/chunks/{deps-MQ4ZIGZB.js → deps-CBPPSS6J.js} +6 -6
  182. package/dist/cli-bundle/chunks/docs-KCWPLQOV.js +14 -0
  183. package/dist/cli-bundle/chunks/{docs-53NUGMIQ.js → docs-NS2AZWCN.js} +7 -7
  184. package/dist/cli-bundle/chunks/{files-3PXGXYDB.js → files-PVWEPT5J.js} +7 -7
  185. package/dist/cli-bundle/chunks/{files-EGLKHD7O.js → files-XUUBQ76I.js} +7 -7
  186. package/dist/cli-bundle/chunks/focus-3EJVFI3D.js +10 -0
  187. package/dist/cli-bundle/chunks/{focus-SRPASFTN.js → focus-DHBHKK3E.js} +5 -5
  188. package/dist/cli-bundle/chunks/{history-compact-G4DULDCX.js → history-compact-3TNPYVFG.js} +6 -6
  189. package/dist/cli-bundle/chunks/history-compact-JHYVDYLW.js +16 -0
  190. package/dist/cli-bundle/chunks/{history-redact-IUSJ6X3E.js → history-redact-ELRL73XN.js} +4 -4
  191. package/dist/cli-bundle/chunks/{history-redact-THHGRQXV.js → history-redact-KKFDICCF.js} +4 -4
  192. package/dist/cli-bundle/chunks/{history-repair-LUQWRS7X.js → history-repair-J7WKZFAG.js} +6 -6
  193. package/dist/cli-bundle/chunks/history-repair-REMI7DDI.js +16 -0
  194. package/dist/cli-bundle/chunks/learnings-O6V5WDCV.js +13 -0
  195. package/dist/cli-bundle/chunks/{learnings-2MRNBFJF.js → learnings-X4D6JCCG.js} +7 -7
  196. package/dist/cli-bundle/chunks/{notes-73JWKWUD.js → notes-UQC6VS6N.js} +7 -7
  197. package/dist/cli-bundle/chunks/notes-ZSZREWZA.js +13 -0
  198. package/dist/cli-bundle/chunks/{plan-AZPMCG37.js → plan-5GKRBJJO.js} +12 -10
  199. package/dist/cli-bundle/chunks/plan-EZW2YDDY.js +26 -0
  200. package/dist/cli-bundle/chunks/{profile-AVCIIZID.js → profile-5PQAPCLF.js} +10 -10
  201. package/dist/cli-bundle/chunks/{profile-LFYO3HHX.js → profile-CW4BD3FO.js} +10 -10
  202. package/dist/cli-bundle/chunks/{register-list-query-UKMF55FT.js → register-list-query-HTDQE6VI.js} +24 -24
  203. package/dist/cli-bundle/chunks/{register-list-query-MZUF2EEC.js → register-list-query-PHIPDFP2.js} +24 -24
  204. package/dist/cli-bundle/chunks/{register-mutation-T6RVNJC4.js → register-mutation-BLEWM5I6.js} +32 -32
  205. package/dist/cli-bundle/chunks/{register-mutation-2PBW2GEX.js → register-mutation-OTYHR7J6.js} +32 -32
  206. package/dist/cli-bundle/chunks/{register-operations-KHZYR6MG.js → register-operations-AMCUFYEW.js} +38 -40
  207. package/dist/cli-bundle/chunks/{register-operations-KHZYR6MG.js.map → register-operations-AMCUFYEW.js.map} +1 -1
  208. package/dist/cli-bundle/chunks/{register-operations-WPQ2LWZJ.js → register-operations-MRLHOZYR.js} +36 -38
  209. package/dist/cli-bundle/chunks/{register-operations-WPQ2LWZJ.js.map → register-operations-MRLHOZYR.js.map} +1 -1
  210. package/dist/cli-bundle/chunks/{register-setup-PGDNOXDQ.js → register-setup-N2FOSWAG.js} +15 -17
  211. package/dist/cli-bundle/chunks/{register-setup-PGDNOXDQ.js.map → register-setup-N2FOSWAG.js.map} +1 -1
  212. package/dist/cli-bundle/chunks/{register-setup-TDN7WAO6.js → register-setup-ZVKTDL4G.js} +17 -19
  213. package/dist/cli-bundle/chunks/{register-setup-TDN7WAO6.js.map → register-setup-ZVKTDL4G.js.map} +1 -1
  214. package/dist/cli-bundle/chunks/restore-A55MLFAI.js +14 -0
  215. package/dist/cli-bundle/chunks/{restore-E3PRGDN3.js → restore-HEQAG6EK.js} +6 -6
  216. package/dist/cli-bundle/chunks/{schema-5JNFQFUW.js → schema-MAXAIHEC.js} +6 -6
  217. package/dist/cli-bundle/chunks/{schema-TMIW4XZC.js → schema-Q5DAWJ2S.js} +6 -6
  218. package/dist/cli-bundle/chunks/update-5DTSCWVF.js +23 -0
  219. package/dist/cli-bundle/chunks/{update-SQYZA3ZW.js → update-DWFXXJKP.js} +15 -13
  220. package/dist/cli-bundle/chunks/update-many-6T4ZLZS7.js +34 -0
  221. package/dist/cli-bundle/chunks/update-many-MYRK6VBJ.js +38 -0
  222. package/dist/cli-bundle/main.js +152 -29
  223. package/dist/cli-bundle/main.js.map +3 -3
  224. package/dist/cli-bundle/sdk-runtime.js +72 -75
  225. package/dist/cli-bundle/sdk-testing.js +8 -8
  226. package/dist/cli-bundle/sdk.js +288 -642
  227. package/dist/cli-bundle/sdk.js.map +4 -4
  228. package/dist/core/extensions/activation-summary.d.ts +2 -0
  229. package/dist/core/extensions/activation-summary.js +7 -2
  230. package/dist/core/extensions/activation-summary.js.map +1 -1
  231. package/dist/core/extensions/capability-usage.d.ts +1 -1
  232. package/dist/core/extensions/capability-usage.js +5 -2
  233. package/dist/core/extensions/capability-usage.js.map +1 -1
  234. package/dist/core/extensions/extension-hook-runtime.js +3 -2
  235. package/dist/core/extensions/extension-hook-runtime.js.map +1 -1
  236. package/dist/core/extensions/extension-registries.js +3 -2
  237. package/dist/core/extensions/extension-registries.js.map +1 -1
  238. package/dist/core/extensions/extension-types.d.ts +38 -1
  239. package/dist/core/extensions/extension-types.js +3 -2
  240. package/dist/core/extensions/extension-types.js.map +1 -1
  241. package/dist/core/extensions/loader.js +36 -2
  242. package/dist/core/extensions/loader.js.map +1 -1
  243. package/dist/core/store/item-store.d.ts +4 -1
  244. package/dist/core/store/item-store.js +3 -3
  245. package/dist/core/store/item-store.js.map +1 -1
  246. package/dist/core/store/paths.d.ts +2 -0
  247. package/dist/core/store/paths.js +26 -3
  248. package/dist/core/store/paths.js.map +1 -1
  249. package/dist/sdk/cli-contracts/enum-contracts.d.ts +1 -1
  250. package/dist/sdk/compose.d.ts +3 -0
  251. package/dist/sdk/compose.js +14 -2
  252. package/dist/sdk/compose.js.map +1 -1
  253. package/dist/sdk/dependencies.js +3 -3
  254. package/dist/sdk/dependencies.js.map +1 -1
  255. package/dist/sdk/extension-command-context.d.ts +10 -0
  256. package/dist/sdk/extension-command-context.js +30 -0
  257. package/dist/sdk/extension-command-context.js.map +1 -0
  258. package/dist/sdk/graph/assembly.js +14 -4
  259. package/dist/sdk/graph/assembly.js.map +1 -1
  260. package/dist/sdk/graph/index.d.ts +1 -0
  261. package/dist/sdk/graph/index.js +3 -2
  262. package/dist/sdk/graph/index.js.map +1 -1
  263. package/dist/sdk/graph/mutation-advisory.d.ts +20 -0
  264. package/dist/sdk/graph/mutation-advisory.js +80 -0
  265. package/dist/sdk/graph/mutation-advisory.js.map +1 -0
  266. package/dist/sdk/graph/run.d.ts +5 -1
  267. package/dist/sdk/graph/run.js +11 -3
  268. package/dist/sdk/graph/run.js.map +1 -1
  269. package/dist/sdk/index.d.ts +4 -1
  270. package/dist/sdk/index.js +5 -2
  271. package/dist/sdk/index.js.map +1 -1
  272. package/dist/sdk/ownership-source.d.ts +2 -0
  273. package/dist/sdk/ownership-source.js +22 -0
  274. package/dist/sdk/ownership-source.js.map +1 -0
  275. package/dist/sdk/relationship-history.d.ts +38 -0
  276. package/dist/sdk/relationship-history.js +60 -2
  277. package/dist/sdk/relationship-history.js.map +1 -1
  278. package/dist/sdk/relationships.js +49 -8
  279. package/dist/sdk/relationships.js.map +1 -1
  280. package/dist/sdk/runtime-input.js +3 -2
  281. package/dist/sdk/runtime-input.js.map +1 -1
  282. package/dist/sdk/runtime.d.ts +2 -0
  283. package/dist/sdk/runtime.js +19 -2
  284. package/dist/sdk/runtime.js.map +1 -1
  285. package/dist/sdk/tracker-root-discovery.d.ts +6 -0
  286. package/dist/sdk/tracker-root-discovery.js +10 -0
  287. package/dist/sdk/tracker-root-discovery.js.map +1 -0
  288. package/dist/sdk/workspace-transaction.d.ts +83 -0
  289. package/dist/sdk/workspace-transaction.js +364 -0
  290. package/dist/sdk/workspace-transaction.js.map +1 -0
  291. package/docs/AGENT_UX_CONTRACTS.md +41 -0
  292. package/docs/EXTENSIONS.md +4 -4
  293. package/docs/README.md +1 -0
  294. package/docs/SDK.md +102 -1
  295. package/marketplace.json +2 -2
  296. package/package.json +1 -1
  297. package/packages/pm-beads/package.json +1 -1
  298. package/packages/pm-calendar/package.json +1 -1
  299. package/packages/pm-command-kit/package.json +1 -1
  300. package/packages/pm-governance-audit/package.json +1 -1
  301. package/packages/pm-guide-shell/package.json +1 -1
  302. package/packages/pm-kanban/package.json +1 -1
  303. package/packages/pm-lifecycle-hooks/package.json +1 -1
  304. package/packages/pm-linked-test-adapters/package.json +1 -1
  305. package/packages/pm-search-advanced/package.json +1 -1
  306. package/packages/pm-templates/package.json +1 -1
  307. package/packages/pm-todos/package.json +1 -1
  308. package/packages/pm-vcs/GAP_REPORT.md +31 -0
  309. package/packages/pm-vcs/README.md +62 -0
  310. package/packages/pm-vcs/extensions/vcs/index.ts +745 -0
  311. package/packages/pm-vcs/extensions/vcs/manifest.json +19 -0
  312. package/packages/pm-vcs/extensions/vcs/package.json +3 -0
  313. package/packages/pm-vcs/package.json +55 -0
  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-bundle/chunks/append-JHO5K6RP.js +0 -11
  317. package/dist/cli-bundle/chunks/chunk-2BX74BAS.js +0 -125
  318. package/dist/cli-bundle/chunks/chunk-2BX74BAS.js.map +0 -7
  319. package/dist/cli-bundle/chunks/chunk-3CUQZNQ6.js +0 -672
  320. package/dist/cli-bundle/chunks/chunk-3CUQZNQ6.js.map +0 -7
  321. package/dist/cli-bundle/chunks/chunk-5UKQLQM2.js.map +0 -1
  322. package/dist/cli-bundle/chunks/chunk-6VHUGVNP.js.map +0 -1
  323. package/dist/cli-bundle/chunks/chunk-74FKFFXO.js +0 -172
  324. package/dist/cli-bundle/chunks/chunk-74FKFFXO.js.map +0 -7
  325. package/dist/cli-bundle/chunks/chunk-ADXDCAKP.js.map +0 -7
  326. package/dist/cli-bundle/chunks/chunk-BAP7G3N2.js +0 -178
  327. package/dist/cli-bundle/chunks/chunk-BAP7G3N2.js.map +0 -7
  328. package/dist/cli-bundle/chunks/chunk-D53RTYVI.js.map +0 -7
  329. package/dist/cli-bundle/chunks/chunk-DHNG452T.js.map +0 -7
  330. package/dist/cli-bundle/chunks/chunk-EY7ZE3TG.js +0 -1831
  331. package/dist/cli-bundle/chunks/chunk-EY7ZE3TG.js.map +0 -1
  332. package/dist/cli-bundle/chunks/chunk-F3VC3GOV.js.map +0 -7
  333. package/dist/cli-bundle/chunks/chunk-FL4D53ND.js +0 -162
  334. package/dist/cli-bundle/chunks/chunk-FL4D53ND.js.map +0 -1
  335. package/dist/cli-bundle/chunks/chunk-GKPCTQYG.js.map +0 -7
  336. package/dist/cli-bundle/chunks/chunk-HPAYDSR2.js.map +0 -7
  337. package/dist/cli-bundle/chunks/chunk-HTXXXF45.js.map +0 -1
  338. package/dist/cli-bundle/chunks/chunk-I3INI567.js.map +0 -7
  339. package/dist/cli-bundle/chunks/chunk-KX62NMZC.js.map +0 -1
  340. package/dist/cli-bundle/chunks/chunk-L5BTTDU5.js +0 -662
  341. package/dist/cli-bundle/chunks/chunk-L5BTTDU5.js.map +0 -1
  342. package/dist/cli-bundle/chunks/chunk-MR4SHYR4.js.map +0 -7
  343. package/dist/cli-bundle/chunks/chunk-OGVTB5VO.js.map +0 -7
  344. package/dist/cli-bundle/chunks/chunk-QPGQNLPI.js.map +0 -1
  345. package/dist/cli-bundle/chunks/chunk-QRZNCRNA.js.map +0 -1
  346. package/dist/cli-bundle/chunks/chunk-RC4UOUXA.js +0 -122
  347. package/dist/cli-bundle/chunks/chunk-RC4UOUXA.js.map +0 -1
  348. package/dist/cli-bundle/chunks/chunk-RTBX3C4C.js +0 -1841
  349. package/dist/cli-bundle/chunks/chunk-RTBX3C4C.js.map +0 -7
  350. package/dist/cli-bundle/chunks/chunk-SIPOACV5.js.map +0 -1
  351. package/dist/cli-bundle/chunks/chunk-WACRQ26A.js.map +0 -7
  352. package/dist/cli-bundle/chunks/chunk-XC2HEEOV.js.map +0 -1
  353. package/dist/cli-bundle/chunks/chunk-XPUTSGJU.js.map +0 -1
  354. package/dist/cli-bundle/chunks/chunk-YIIIAKCE.js.map +0 -1
  355. package/dist/cli-bundle/chunks/chunk-YJSURTBB.js +0 -175
  356. package/dist/cli-bundle/chunks/chunk-YJSURTBB.js.map +0 -1
  357. package/dist/cli-bundle/chunks/chunk-YQEZWI3R.js.map +0 -7
  358. package/dist/cli-bundle/chunks/close-GPD7DTJV.js +0 -12
  359. package/dist/cli-bundle/chunks/close-many-NQLYGPYW.js +0 -23
  360. package/dist/cli-bundle/chunks/comments-2AOZQ5D2.js +0 -13
  361. package/dist/cli-bundle/chunks/copy-N3LCQBMC.js +0 -9
  362. package/dist/cli-bundle/chunks/create-KOGQ3JKD.js +0 -27
  363. package/dist/cli-bundle/chunks/delete-6G3MBZ6S.js +0 -10
  364. package/dist/cli-bundle/chunks/docs-OWRGDMNY.js +0 -14
  365. package/dist/cli-bundle/chunks/focus-KZLIA6WS.js +0 -10
  366. package/dist/cli-bundle/chunks/history-compact-HHIUOMZ7.js +0 -16
  367. package/dist/cli-bundle/chunks/history-repair-KG7SWXI6.js +0 -16
  368. package/dist/cli-bundle/chunks/learnings-ZVHSALJY.js +0 -13
  369. package/dist/cli-bundle/chunks/notes-BAKUL5DJ.js +0 -13
  370. package/dist/cli-bundle/chunks/plan-LEAGLPGP.js +0 -24
  371. package/dist/cli-bundle/chunks/restore-KIUYTAEJ.js +0 -14
  372. package/dist/cli-bundle/chunks/update-XZJYS5X7.js +0 -21
  373. package/dist/cli-bundle/chunks/update-many-R24B3GBK.js +0 -36
  374. package/dist/cli-bundle/chunks/update-many-WQ3R3J6N.js +0 -32
  375. /package/dist/cli-bundle/chunks/{append-5YF3TO7I.js.map → append-MBXHNWSX.js.map} +0 -0
  376. /package/dist/cli-bundle/chunks/{append-JHO5K6RP.js.map → append-XUYF7NON.js.map} +0 -0
  377. /package/dist/cli-bundle/chunks/{chunk-BIRYX32V.js.map → chunk-2UCG5H6B.js.map} +0 -0
  378. /package/dist/cli-bundle/chunks/{chunk-VE6ZSTQW.js.map → chunk-2XPDCXK5.js.map} +0 -0
  379. /package/dist/cli-bundle/chunks/{chunk-GLZKZON6.js.map → chunk-3HSRP6T2.js.map} +0 -0
  380. /package/dist/cli-bundle/chunks/{chunk-XWBD6DSR.js.map → chunk-3KPNOZOH.js.map} +0 -0
  381. /package/dist/cli-bundle/chunks/{chunk-HO4DLBNK.js.map → chunk-4M6RZJXF.js.map} +0 -0
  382. /package/dist/cli-bundle/chunks/{chunk-RXPQ5Q23.js.map → chunk-4PSJVGRE.js.map} +0 -0
  383. /package/dist/cli-bundle/chunks/{chunk-YFE7JHX3.js.map → chunk-6BNV3G6C.js.map} +0 -0
  384. /package/dist/cli-bundle/chunks/{chunk-43UMFKCK.js.map → chunk-6V4T4RD3.js.map} +0 -0
  385. /package/dist/cli-bundle/chunks/{chunk-EHJFUOXL.js.map → chunk-7B7IHMLH.js.map} +0 -0
  386. /package/dist/cli-bundle/chunks/{chunk-I7DIDUSP.js.map → chunk-7CHWLT2J.js.map} +0 -0
  387. /package/dist/cli-bundle/chunks/{chunk-L6FVNR7X.js.map → chunk-A3GAQLBH.js.map} +0 -0
  388. /package/dist/cli-bundle/chunks/{chunk-B57RJHBZ.js.map → chunk-A4FVWFZY.js.map} +0 -0
  389. /package/dist/cli-bundle/chunks/{chunk-D52ZN3BF.js.map → chunk-A5EQPNV7.js.map} +0 -0
  390. /package/dist/cli-bundle/chunks/{chunk-TZAE66GQ.js.map → chunk-AGEBQRBG.js.map} +0 -0
  391. /package/dist/cli-bundle/chunks/{chunk-WU3KAN6A.js.map → chunk-AQUNTB7G.js.map} +0 -0
  392. /package/dist/cli-bundle/chunks/{chunk-XWYQ2LT4.js.map → chunk-BBGR4FKQ.js.map} +0 -0
  393. /package/dist/cli-bundle/chunks/{chunk-2FUOXSRN.js.map → chunk-BFJP4VYC.js.map} +0 -0
  394. /package/dist/cli-bundle/chunks/{chunk-633PKXLT.js.map → chunk-BZKE2O5V.js.map} +0 -0
  395. /package/dist/cli-bundle/chunks/{chunk-L337QKWJ.js.map → chunk-DUDLSQFG.js.map} +0 -0
  396. /package/dist/cli-bundle/chunks/{chunk-BVLOMU6O.js.map → chunk-E7KBMWEF.js.map} +0 -0
  397. /package/dist/cli-bundle/chunks/{chunk-WQXRZMFN.js.map → chunk-EEECAV5M.js.map} +0 -0
  398. /package/dist/cli-bundle/chunks/{chunk-35FHWD4C.js.map → chunk-EI3UIMZM.js.map} +0 -0
  399. /package/dist/cli-bundle/chunks/{chunk-PT7MCCGD.js.map → chunk-FIUTBFC6.js.map} +0 -0
  400. /package/dist/cli-bundle/chunks/{chunk-7H5NNCJ5.js.map → chunk-FQF6VVPH.js.map} +0 -0
  401. /package/dist/cli-bundle/chunks/{chunk-6DYOZS6C.js.map → chunk-FQO5THHM.js.map} +0 -0
  402. /package/dist/cli-bundle/chunks/{chunk-5HGZKQUL.js.map → chunk-FQODDTE7.js.map} +0 -0
  403. /package/dist/cli-bundle/chunks/{chunk-67RO3H4N.js.map → chunk-G33XIMRT.js.map} +0 -0
  404. /package/dist/cli-bundle/chunks/{chunk-QWBKN3QC.js.map → chunk-GKCEEXMA.js.map} +0 -0
  405. /package/dist/cli-bundle/chunks/{chunk-DG2EQRIH.js.map → chunk-GRDK25BN.js.map} +0 -0
  406. /package/dist/cli-bundle/chunks/{chunk-FXFCFL73.js.map → chunk-H3YKUVDR.js.map} +0 -0
  407. /package/dist/cli-bundle/chunks/{chunk-ARGDWQ4J.js.map → chunk-IGBBTPM5.js.map} +0 -0
  408. /package/dist/cli-bundle/chunks/{chunk-FY4RLHSC.js.map → chunk-IRJ6F23W.js.map} +0 -0
  409. /package/dist/cli-bundle/chunks/{chunk-66MKH7SZ.js.map → chunk-IXG5CMBR.js.map} +0 -0
  410. /package/dist/cli-bundle/chunks/{chunk-7UCY6DR5.js.map → chunk-JPWUZOMR.js.map} +0 -0
  411. /package/dist/cli-bundle/chunks/{chunk-FVNWHUME.js.map → chunk-K2L6FZBX.js.map} +0 -0
  412. /package/dist/cli-bundle/chunks/{chunk-X2MGQMZO.js.map → chunk-LT5UWU7H.js.map} +0 -0
  413. /package/dist/cli-bundle/chunks/{chunk-KH6QAHME.js.map → chunk-M4B4RK4J.js.map} +0 -0
  414. /package/dist/cli-bundle/chunks/{chunk-2XOSFSTH.js.map → chunk-MQOSMBWV.js.map} +0 -0
  415. /package/dist/cli-bundle/chunks/{chunk-7R6UIHYY.js.map → chunk-N2TEEOXJ.js.map} +0 -0
  416. /package/dist/cli-bundle/chunks/{chunk-NTRQLE2R.js.map → chunk-N7FCFJ76.js.map} +0 -0
  417. /package/dist/cli-bundle/chunks/{chunk-37DRDP2B.js.map → chunk-NPEYH6CE.js.map} +0 -0
  418. /package/dist/cli-bundle/chunks/{chunk-2CXL335K.js.map → chunk-OK7VSX3N.js.map} +0 -0
  419. /package/dist/cli-bundle/chunks/{chunk-NNANAWFH.js.map → chunk-OKPZDH43.js.map} +0 -0
  420. /package/dist/cli-bundle/chunks/{chunk-G6MYGULG.js.map → chunk-OKWJUL6F.js.map} +0 -0
  421. /package/dist/cli-bundle/chunks/{chunk-D5XHO4Q7.js.map → chunk-Q6JPYR7I.js.map} +0 -0
  422. /package/dist/cli-bundle/chunks/{chunk-IE5KRAKN.js.map → chunk-QQ77W23U.js.map} +0 -0
  423. /package/dist/cli-bundle/chunks/{chunk-M7MVOKVV.js.map → chunk-QYGK2XQ3.js.map} +0 -0
  424. /package/dist/cli-bundle/chunks/{chunk-X5YCTFKT.js.map → chunk-RWAIRGBC.js.map} +0 -0
  425. /package/dist/cli-bundle/chunks/{chunk-W5E2UUSH.js.map → chunk-RX53WHFI.js.map} +0 -0
  426. /package/dist/cli-bundle/chunks/{chunk-R5XTTZSJ.js.map → chunk-SBW7EQC4.js.map} +0 -0
  427. /package/dist/cli-bundle/chunks/{chunk-TM5CIO3F.js.map → chunk-SGJB6PXA.js.map} +0 -0
  428. /package/dist/cli-bundle/chunks/{chunk-DDFGYUCQ.js.map → chunk-STBCBDKF.js.map} +0 -0
  429. /package/dist/cli-bundle/chunks/{chunk-FHOBCGQO.js.map → chunk-SVAWG7EE.js.map} +0 -0
  430. /package/dist/cli-bundle/chunks/{chunk-6O44IN44.js.map → chunk-T6MOTLOJ.js.map} +0 -0
  431. /package/dist/cli-bundle/chunks/{chunk-EWIT5WIC.js.map → chunk-U6RYD446.js.map} +0 -0
  432. /package/dist/cli-bundle/chunks/{chunk-E4FXM2XB.js.map → chunk-UE7LK3RE.js.map} +0 -0
  433. /package/dist/cli-bundle/chunks/{chunk-N33FD2UI.js.map → chunk-UNNCT5QY.js.map} +0 -0
  434. /package/dist/cli-bundle/chunks/{chunk-2IPNL3DR.js.map → chunk-UOIFZ66L.js.map} +0 -0
  435. /package/dist/cli-bundle/chunks/{chunk-LSOWTLEM.js.map → chunk-UU6EP25G.js.map} +0 -0
  436. /package/dist/cli-bundle/chunks/{chunk-HYTOJW2Q.js.map → chunk-UW6HCMP2.js.map} +0 -0
  437. /package/dist/cli-bundle/chunks/{chunk-47HXN6RX.js.map → chunk-UWAQI3B7.js.map} +0 -0
  438. /package/dist/cli-bundle/chunks/{chunk-YKFHF37B.js.map → chunk-V4QHAMI5.js.map} +0 -0
  439. /package/dist/cli-bundle/chunks/{chunk-VAHZIPWS.js.map → chunk-VA3H7VVC.js.map} +0 -0
  440. /package/dist/cli-bundle/chunks/{chunk-TLWJP5BF.js.map → chunk-VQOG2ETB.js.map} +0 -0
  441. /package/dist/cli-bundle/chunks/{chunk-H5IOT54C.js.map → chunk-VSQE43NO.js.map} +0 -0
  442. /package/dist/cli-bundle/chunks/{chunk-BDA35QG5.js.map → chunk-W6IEJXNC.js.map} +0 -0
  443. /package/dist/cli-bundle/chunks/{chunk-OWP6QFBV.js.map → chunk-XDWXPG2E.js.map} +0 -0
  444. /package/dist/cli-bundle/chunks/{chunk-CKX4WOPC.js.map → chunk-XKVHL3MB.js.map} +0 -0
  445. /package/dist/cli-bundle/chunks/{chunk-WL3SS45P.js.map → chunk-XVB6BATY.js.map} +0 -0
  446. /package/dist/cli-bundle/chunks/{chunk-NVZ6NVHJ.js.map → chunk-XXWDEQ6O.js.map} +0 -0
  447. /package/dist/cli-bundle/chunks/{chunk-ILVOOAT4.js.map → chunk-Y2VSGFT4.js.map} +0 -0
  448. /package/dist/cli-bundle/chunks/{chunk-NCVT6XEL.js.map → chunk-YG56M3NE.js.map} +0 -0
  449. /package/dist/cli-bundle/chunks/{chunk-AFGKSHAM.js.map → chunk-YGEA4CLH.js.map} +0 -0
  450. /package/dist/cli-bundle/chunks/{chunk-AXRT7K5V.js.map → chunk-YIC5NGXF.js.map} +0 -0
  451. /package/dist/cli-bundle/chunks/{chunk-XXLXJL7V.js.map → chunk-ZUCBPXNA.js.map} +0 -0
  452. /package/dist/cli-bundle/chunks/{close-X3CF6FQP.js.map → close-7NWA3GLA.js.map} +0 -0
  453. /package/dist/cli-bundle/chunks/{close-GPD7DTJV.js.map → close-ZZCDDWJT.js.map} +0 -0
  454. /package/dist/cli-bundle/chunks/{close-many-NQLYGPYW.js.map → close-many-QCZHFCON.js.map} +0 -0
  455. /package/dist/cli-bundle/chunks/{close-many-J7A5EHOQ.js.map → close-many-YALQ7AXS.js.map} +0 -0
  456. /package/dist/cli-bundle/chunks/{comments-2AOZQ5D2.js.map → comments-FMQNYPSZ.js.map} +0 -0
  457. /package/dist/cli-bundle/chunks/{comments-TMHMALA5.js.map → comments-SQIQ5WYR.js.map} +0 -0
  458. /package/dist/cli-bundle/chunks/{copy-N3LCQBMC.js.map → copy-GI3RCVZP.js.map} +0 -0
  459. /package/dist/cli-bundle/chunks/{copy-FWQA5OU4.js.map → copy-YDAMENCP.js.map} +0 -0
  460. /package/dist/cli-bundle/chunks/{create-AQ5SIGZC.js.map → create-JSL6CXU3.js.map} +0 -0
  461. /package/dist/cli-bundle/chunks/{create-KOGQ3JKD.js.map → create-LXMLYJNM.js.map} +0 -0
  462. /package/dist/cli-bundle/chunks/{delete-6G3MBZ6S.js.map → delete-5DFAXJNI.js.map} +0 -0
  463. /package/dist/cli-bundle/chunks/{delete-YYYFOSEA.js.map → delete-IGVOZEU2.js.map} +0 -0
  464. /package/dist/cli-bundle/chunks/{deps-NIIKXLPB.js.map → deps-BQAXUQAK.js.map} +0 -0
  465. /package/dist/cli-bundle/chunks/{deps-MQ4ZIGZB.js.map → deps-CBPPSS6J.js.map} +0 -0
  466. /package/dist/cli-bundle/chunks/{docs-OWRGDMNY.js.map → docs-KCWPLQOV.js.map} +0 -0
  467. /package/dist/cli-bundle/chunks/{docs-53NUGMIQ.js.map → docs-NS2AZWCN.js.map} +0 -0
  468. /package/dist/cli-bundle/chunks/{files-3PXGXYDB.js.map → files-PVWEPT5J.js.map} +0 -0
  469. /package/dist/cli-bundle/chunks/{files-EGLKHD7O.js.map → files-XUUBQ76I.js.map} +0 -0
  470. /package/dist/cli-bundle/chunks/{focus-KZLIA6WS.js.map → focus-3EJVFI3D.js.map} +0 -0
  471. /package/dist/cli-bundle/chunks/{focus-SRPASFTN.js.map → focus-DHBHKK3E.js.map} +0 -0
  472. /package/dist/cli-bundle/chunks/{history-compact-G4DULDCX.js.map → history-compact-3TNPYVFG.js.map} +0 -0
  473. /package/dist/cli-bundle/chunks/{history-compact-HHIUOMZ7.js.map → history-compact-JHYVDYLW.js.map} +0 -0
  474. /package/dist/cli-bundle/chunks/{history-redact-IUSJ6X3E.js.map → history-redact-ELRL73XN.js.map} +0 -0
  475. /package/dist/cli-bundle/chunks/{history-redact-THHGRQXV.js.map → history-redact-KKFDICCF.js.map} +0 -0
  476. /package/dist/cli-bundle/chunks/{history-repair-LUQWRS7X.js.map → history-repair-J7WKZFAG.js.map} +0 -0
  477. /package/dist/cli-bundle/chunks/{history-repair-KG7SWXI6.js.map → history-repair-REMI7DDI.js.map} +0 -0
  478. /package/dist/cli-bundle/chunks/{learnings-ZVHSALJY.js.map → learnings-O6V5WDCV.js.map} +0 -0
  479. /package/dist/cli-bundle/chunks/{learnings-2MRNBFJF.js.map → learnings-X4D6JCCG.js.map} +0 -0
  480. /package/dist/cli-bundle/chunks/{notes-73JWKWUD.js.map → notes-UQC6VS6N.js.map} +0 -0
  481. /package/dist/cli-bundle/chunks/{notes-BAKUL5DJ.js.map → notes-ZSZREWZA.js.map} +0 -0
  482. /package/dist/cli-bundle/chunks/{plan-AZPMCG37.js.map → plan-5GKRBJJO.js.map} +0 -0
  483. /package/dist/cli-bundle/chunks/{plan-LEAGLPGP.js.map → plan-EZW2YDDY.js.map} +0 -0
  484. /package/dist/cli-bundle/chunks/{profile-AVCIIZID.js.map → profile-5PQAPCLF.js.map} +0 -0
  485. /package/dist/cli-bundle/chunks/{profile-LFYO3HHX.js.map → profile-CW4BD3FO.js.map} +0 -0
  486. /package/dist/cli-bundle/chunks/{register-list-query-UKMF55FT.js.map → register-list-query-HTDQE6VI.js.map} +0 -0
  487. /package/dist/cli-bundle/chunks/{register-list-query-MZUF2EEC.js.map → register-list-query-PHIPDFP2.js.map} +0 -0
  488. /package/dist/cli-bundle/chunks/{register-mutation-T6RVNJC4.js.map → register-mutation-BLEWM5I6.js.map} +0 -0
  489. /package/dist/cli-bundle/chunks/{register-mutation-2PBW2GEX.js.map → register-mutation-OTYHR7J6.js.map} +0 -0
  490. /package/dist/cli-bundle/chunks/{restore-KIUYTAEJ.js.map → restore-A55MLFAI.js.map} +0 -0
  491. /package/dist/cli-bundle/chunks/{restore-E3PRGDN3.js.map → restore-HEQAG6EK.js.map} +0 -0
  492. /package/dist/cli-bundle/chunks/{schema-5JNFQFUW.js.map → schema-MAXAIHEC.js.map} +0 -0
  493. /package/dist/cli-bundle/chunks/{schema-TMIW4XZC.js.map → schema-Q5DAWJ2S.js.map} +0 -0
  494. /package/dist/cli-bundle/chunks/{update-XZJYS5X7.js.map → update-5DTSCWVF.js.map} +0 -0
  495. /package/dist/cli-bundle/chunks/{update-SQYZA3ZW.js.map → update-DWFXXJKP.js.map} +0 -0
  496. /package/dist/cli-bundle/chunks/{update-many-WQ3R3J6N.js.map → update-many-6T4ZLZS7.js.map} +0 -0
  497. /package/dist/cli-bundle/chunks/{update-many-R24B3GBK.js.map → update-many-MYRK6VBJ.js.map} +0 -0
@@ -6,14 +6,14 @@
6
6
  },
7
7
  "metadata": {
8
8
  "description": "Official marketplace for pm CLI — native git-based project management for Claude Code and AI coding agents.",
9
- "version": "2026.7.18"
9
+ "version": "2026.7.19"
10
10
  },
11
11
  "plugins": [
12
12
  {
13
13
  "name": "pm-claude",
14
14
  "source": "./plugins/pm-claude",
15
15
  "description": "Native pm CLI integration for Claude Code — 28 MCP tools, 5 workflow skills, 14 slash commands, 4 subagents, hybrid TUI task tracking, session context injection, and coordination subagents for git-based project management without leaving Claude Code.",
16
- "version": "2026.7.18",
16
+ "version": "2026.7.19",
17
17
  "author": {
18
18
  "name": "unbrained",
19
19
  "url": "https://github.com/unbraind/pm-cli"
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## 2026.7.19 - 2026-07-19
4
+
5
+ ### Added
6
+
7
+ - Public SDK transaction boundary: atomic multi-item + relationship-event commit primitive ([pm-4e12](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/features/pm-4e12.toon))
8
+ - Beyond-PM SDK exemplar spike: minimal VCS-style changeset workflow as a pm package (custom schema + event-sourced history + hooks) ([pm-xtrd](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/features/pm-xtrd.toon))
9
+
10
+ ### Fixed
11
+
12
+ - GH-588: pm comment --message exits 0 recording nothing — comment invocation without any comment text must fail fast ([pm-yp56](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-yp56.toon))
13
+ - GH-589: pm next --assignee X answers from anonymous-caller perspective and pm claim conflates assignment with claim ([pm-cj9v](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-cj9v.toon))
14
+ - GH-591: pm context agenda events re-embed full item payloads already listed in the same response (~35% of brief output) ([pm-6m1i](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-6m1i.toon))
15
+ - GH-592: tracker_not_initialized recovery re-suggests pm init even when a --pm-path tracker exists — following it silently splits workspace state ([pm-tmhs](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-tmhs.toon))
16
+ - GH-586: graph audit severity and code summaries mix finding and affected-item units ([pm-um4g](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-um4g.toon))
17
+ - GH-590: cycle-creating blocked_by mutations succeed silently — items deadlock out of pm next with no inline feedback ([pm-i6pi](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-i6pi.toon))
18
+ - GH-585: extension alias collision diagnostics for core command groups ([pm-v1yo](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-v1yo.toon))
19
+
3
20
  ## 2026.7.18 - 2026-07-18
4
21
 
5
22
  ### Fixed
@@ -4,7 +4,7 @@
4
4
  * Implements the pm claim 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]="b0765d0a-904e-5230-a9c3-a4859d07c7ab")}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]="07b1663e-40e3-52cf-99f6-458a651ab229")}catch(e){}}();
8
8
  import { pathExists } from "../../core/fs/fs-utils.js";
9
9
  import { resolveRuntimeStatusRegistry, statusIsTerminal, } from "../../core/schema/runtime-schema.js";
10
10
  import { EXIT_CODE } from "../../core/shared/constants.js";
@@ -15,6 +15,7 @@ import { getSettingsPath, resolvePmRoot } from "../../core/store/paths.js";
15
15
  import { readSettings } from "../../core/store/settings.js";
16
16
  import { resolveAuthor } from "../../core/shared/author.js";
17
17
  import { wrapOwnershipConflict } from "../../sdk/annotations.js";
18
+ import { describeItemOwnershipConflict } from "../../sdk/ownership-source.js";
18
19
  import { runNext } from "./next.js";
19
20
  /** Stable warning/error code for an exhausted atomic next-work walk. */
20
21
  export const NO_AVAILABLE_NEXT_ITEM_CODE = "no_available_next_item";
@@ -43,7 +44,7 @@ export async function runClaim(id, force, global, options = {}) {
43
44
  message: options.message,
44
45
  force,
45
46
  skipNoop: true,
46
- mutate(document) {
47
+ async mutate(document) {
47
48
  const currentAssignee = document.metadata.assignee;
48
49
  const currentAssigneeText = typeof currentAssignee === "string" ? currentAssignee : "";
49
50
  previousAssignee =
@@ -59,7 +60,8 @@ export async function runClaim(id, force, global, options = {}) {
59
60
  return { changedFields: [] };
60
61
  }
61
62
  if (heldByOther && !force) {
62
- throw new PmCliError(`Item ${document.metadata.id} is already claimed by ${previousAssignee}. Use --force to take over, or --if-available to skip without failing.`, EXIT_CODE.CONFLICT, {
63
+ const ownershipPhrase = await describeItemOwnershipConflict(pmRoot, document.metadata.id, currentAssigneeText);
64
+ throw new PmCliError(`Item ${document.metadata.id} is already ${ownershipPhrase}. Use --force to take over, or --if-available to skip without failing.`, EXIT_CODE.CONFLICT, {
63
65
  code: "already_claimed_by",
64
66
  why: "Claim is an atomic test-and-set so parallel agents never proceed believing they own the same item.",
65
67
  nextSteps: [
@@ -209,4 +211,4 @@ export async function runRelease(id, force, global, options = {}) {
209
211
  };
210
212
  }
211
213
  //# sourceMappingURL=claim.js.map
212
- //# debugId=b0765d0a-904e-5230-a9c3-a4859d07c7ab
214
+ //# debugId=07b1663e-40e3-52cf-99f6-458a651ab229
@@ -1 +1 @@
1
- {"version":3,"file":"claim.js","sources":["cli/commands/claim.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module cli/commands/claim\n *\n * Implements the pm claim command surface and its agent-facing runtime behavior.\n */\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport {\n resolveRuntimeStatusRegistry,\n statusIsTerminal,\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 { toItemRecord } from \"../../core/item/item-record.js\";\nimport { mutateItem } from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport { resolveAuthor } from \"../../core/shared/author.js\";\nimport { wrapOwnershipConflict } from \"../../sdk/annotations.js\";\nimport { runNext, type NextRecommendation, type NextOptions } from \"./next.js\";\n\n/** Stable warning/error code for an exhausted atomic next-work walk. */\nexport const NO_AVAILABLE_NEXT_ITEM_CODE = \"no_available_next_item\";\n\n/** Documents the claim result payload exchanged by command, SDK, and package integrations. */\nexport interface ClaimResult {\n /** Value that configures or reports item for this contract. */\n item: Record<string, unknown>;\n /** Value that configures or reports claimed by for this contract. */\n claimed_by: string;\n /** Value that configures or reports previous assignee for this contract. */\n previous_assignee: string | null;\n /** Value that configures or reports forced for this contract. */\n forced: boolean;\n /** Value that configures or reports skipped for this contract. */\n skipped?: boolean;\n /** Value that configures or reports warnings for this contract. */\n warnings?: string[];\n}\n\n/** Result of atomically selecting and claiming the next caller-available item. */\nexport interface ClaimNextAvailableResult extends ClaimResult {\n /** True when an actionable candidate was claimed. */\n available: true;\n /** Value that configures or reports recommendation for this contract. */\n recommendation: NextRecommendation;\n /** Value that configures or reports attempts for this contract. */\n attempts: number;\n}\n\n/** Non-error empty result returned when an if-available candidate walk is exhausted. */\nexport interface ClaimNextUnavailableResult {\n /** Indicates that no candidate remained claimable. */\n available: false;\n /** Empty item projection for a deliberately unavailable selection. */\n item: null;\n /** Caller identity that attempted the selection. */\n claimed_by: string;\n /** No previous owner exists for an empty selection. */\n previous_assignee: null;\n /** Whether forced selection was requested. */\n forced: boolean;\n /** Signals a deliberate non-error skip. */\n skipped: true;\n /** No recommendation survived the bounded walk. */\n recommendation: null;\n /** Number of ranked candidates attempted. */\n attempts: number;\n /** Stable machine-readable exhaustion warning. */\n warnings: [typeof NO_AVAILABLE_NEXT_ITEM_CODE];\n}\n\n/** Result of a successful or deliberately empty atomic next-work claim. */\nexport type ClaimNextResult =\n | ClaimNextAvailableResult\n | ClaimNextUnavailableResult;\n\n/** Returns whether a failed claim lost the atomic test-and-set race. */\nexport function isAlreadyClaimedError(error: unknown): boolean {\n return (\n error instanceof PmCliError && error.context?.code === \"already_claimed_by\"\n );\n}\n\ntype ClaimRunner = (\n id: string,\n force: boolean,\n global: GlobalOptions,\n options: ClaimMutationOptions,\n) => Promise<ClaimResult>;\n\n/** Documents the release result payload exchanged by command, SDK, and package integrations. */\nexport interface ReleaseResult {\n /** Value that configures or reports item for this contract. */\n item: Record<string, unknown>;\n /** Value that configures or reports released by for this contract. */\n released_by: string;\n /** Value that configures or reports previous assignee for this contract. */\n previous_assignee: string | null;\n /** Value that configures or reports forced for this contract. */\n forced: boolean;\n}\n\n/** Documents the claim mutation options payload exchanged by command, SDK, and package integrations. */\nexport interface ClaimMutationOptions {\n /** Value that configures or reports author for this contract. */\n author?: string;\n /** Human-readable explanation suitable for logs and agent-facing output. */\n message?: string;\n /** Value that configures or reports if available for this contract. */\n ifAvailable?: boolean;\n /** Maximum ranked candidates attempted by `claim --next`. */\n maxAttempts?: string | number;\n}\n\n/** Documents the release mutation options payload exchanged by command, SDK, and package integrations. */\nexport type ReleaseMutationOptions = ClaimMutationOptions;\n\n/** Implements run claim for the public runtime surface of this module. */\nexport async function runClaim(\n id: string,\n force: boolean,\n global: GlobalOptions,\n options: ClaimMutationOptions = {},\n): Promise<ClaimResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(\n `Tracker is not initialized at ${pmRoot}. Run pm init first.`,\n EXIT_CODE.NOT_FOUND,\n );\n }\n const settings = await readSettings(pmRoot);\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const author = resolveAuthor(options.author, settings.author_default);\n let previousAssignee: string | null = null;\n let skipped = false;\n const mutationWarnings: string[] = [];\n\n const result = await mutateItem({\n pmRoot,\n settings,\n id,\n op: \"claim\",\n author,\n message: options.message,\n force,\n skipNoop: true,\n mutate(document) {\n const currentAssignee = document.metadata.assignee;\n const currentAssigneeText =\n typeof currentAssignee === \"string\" ? currentAssignee : \"\";\n previousAssignee =\n currentAssigneeText.trim().length > 0 ? currentAssigneeText : null;\n if (\n statusIsTerminal(document.metadata.status, statusRegistry) &&\n !force\n ) {\n throw new PmCliError(\n `Cannot claim terminal item ${document.metadata.id} without --force`,\n EXIT_CODE.CONFLICT,\n );\n }\n const heldByOther =\n previousAssignee !== null && previousAssignee !== author;\n if (heldByOther && options.ifAvailable === true) {\n skipped = true;\n mutationWarnings.push(`claim_skipped_held_by:${previousAssignee}`);\n return { changedFields: [] };\n }\n if (heldByOther && !force) {\n throw new PmCliError(\n `Item ${document.metadata.id} is already claimed by ${previousAssignee}. Use --force to take over, or --if-available to skip without failing.`,\n EXIT_CODE.CONFLICT,\n {\n code: \"already_claimed_by\",\n why: \"Claim is an atomic test-and-set so parallel agents never proceed believing they own the same item.\",\n nextSteps: [\n \"Run pm next to pick a different unclaimed item.\",\n \"Re-run with --if-available to treat a held item as a no-op skip.\",\n \"Re-run with --force only when taking over the item is coordinated.\",\n ],\n },\n );\n }\n if (heldByOther) {\n mutationWarnings.push(`claim_takeover:${previousAssignee}->${author}`);\n }\n document.metadata.assignee = author;\n return { changedFields: [\"assignee\"], warnings: mutationWarnings };\n },\n });\n\n return {\n item: toItemRecord(result.item),\n claimed_by:\n skipped && previousAssignee !== null ? previousAssignee : author,\n previous_assignee: previousAssignee,\n forced: force,\n ...(skipped ? { skipped: true } : {}),\n ...(mutationWarnings.length > 0 ? { warnings: mutationWarnings } : {}),\n };\n}\n\n/** Selects ranked actionable work and claims the first candidate still available under the item lock. Conflicts caused by parallel claimers advance to the next candidate instead of returning a thundering-herd failure. */\nexport async function runClaimNext(\n force: boolean,\n global: GlobalOptions,\n options: ClaimMutationOptions = {},\n nextOptions: NextOptions = {},\n): Promise<ClaimNextResult> {\n const maxAttempts = parseClaimNextAttempts(options.maxAttempts);\n const settings = await readSettings(resolvePmRoot(process.cwd(), global.path));\n const claimOptions = {\n ...options,\n author: resolveAuthor(options.author, settings.author_default),\n };\n const next = await runNext(\n {\n ...nextOptions,\n callerAuthor: claimOptions.author,\n limit: String(maxAttempts),\n },\n global,\n );\n const recommendations = [next.recommended, ...next.ready]\n .filter((entry): entry is NextRecommendation => entry !== null)\n .map((entry) => ({\n ...entry,\n reasons: \"reasons\" in entry ? entry.reasons : [\"ranked ready candidate\"],\n }));\n return claimNextFromRecommendations(\n recommendations.slice(0, maxAttempts),\n force,\n global,\n claimOptions,\n );\n}\n\n/** Parses the bounded candidate walk used by `claim --next`. */\nexport function parseClaimNextAttempts(raw: string | number | undefined): number {\n if (raw === undefined) return 10;\n const parsed = Number(raw);\n if (!Number.isSafeInteger(parsed) || parsed < 1 || parsed > 100) {\n throw new PmCliError(\n \"--max-attempts must be an integer from 1 to 100\",\n EXIT_CODE.USAGE,\n );\n }\n return parsed;\n}\n\n/** Claims the first still-available row from a pre-ranked recommendation set. */\nexport async function claimNextFromRecommendations(\n recommendations: NextRecommendation[],\n force: boolean,\n global: GlobalOptions,\n options: ClaimMutationOptions = {},\n claimRunner: ClaimRunner = runClaim,\n): Promise<ClaimNextResult> {\n let attempts = 0;\n for (const recommendation of recommendations) {\n attempts += 1;\n try {\n const claimed = await claimRunner(\n recommendation.id,\n force,\n global,\n options,\n );\n const result = { ...claimed, recommendation, attempts, available: true as const };\n if (!claimed.skipped) return result;\n } catch (error: unknown) {\n if (!isAlreadyClaimedError(error)) throw error;\n }\n }\n if (options.ifAvailable === true) {\n return {\n available: false,\n item: null,\n claimed_by: options.author ?? process.env.PM_AUTHOR ?? \"unknown\",\n previous_assignee: null,\n forced: force,\n skipped: true,\n recommendation: null,\n attempts,\n warnings: [NO_AVAILABLE_NEXT_ITEM_CODE],\n };\n }\n const noCandidatesMatched = attempts === 0;\n throw new PmCliError(\n noCandidatesMatched\n ? \"No actionable items matched the selection filters\"\n : \"No actionable item remained available to claim\",\n noCandidatesMatched ? EXIT_CODE.NOT_FOUND : EXIT_CODE.CONFLICT,\n {\n code: NO_AVAILABLE_NEXT_ITEM_CODE,\n why: noCandidatesMatched\n ? \"No ready items matched the specified filters or selection criteria.\"\n : \"Every ranked candidate was claimed by another agent before this atomic selection completed.\",\n nextSteps: [\n noCandidatesMatched\n ? \"Verify the filters or run pm next to inspect all ready work.\"\n : \"Run pm claim --next again to refresh the ranked candidate set.\",\n ],\n },\n );\n}\n\n/** Implements run release for the public runtime surface of this module. */\nexport async function runRelease(\n id: string,\n force: boolean,\n global: GlobalOptions,\n options: ReleaseMutationOptions = {},\n): Promise<ReleaseResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(\n `Tracker is not initialized at ${pmRoot}. Run pm init first.`,\n EXIT_CODE.NOT_FOUND,\n );\n }\n const settings = await readSettings(pmRoot);\n const author = resolveAuthor(options.author, settings.author_default);\n const ownershipReleaseBypass =\n (options as ReleaseMutationOptions & {\n ownershipReleaseBypass?: boolean;\n }).ownershipReleaseBypass === true;\n let previousAssignee: string | null = null;\n\n let result: Awaited<ReturnType<typeof mutateItem>>;\n try {\n result = await mutateItem({\n pmRoot,\n settings,\n id,\n op: \"release\",\n author,\n message: options.message,\n force,\n bypassAssigneeConflict: ownershipReleaseBypass,\n mutate(document) {\n previousAssignee = document.metadata.assignee ?? null;\n if (!previousAssignee) {\n return { changedFields: [] };\n }\n delete document.metadata.assignee;\n return { changedFields: [\"assignee\"] };\n },\n });\n } catch (error: unknown) {\n wrapOwnershipConflict(error, {\n required:\n \"For approved non-owner handoffs, prefer the ownership-release bypass before considering --force.\",\n examples: ['pm release pm-a1b2 --author \"reviewer\" --force'],\n nextSteps: [\n \"Use the package-provided ownership-release bypass for handoffs that only clear assignee metadata.\",\n \"Use --force only when an explicit override is approved for broader ownership conflicts.\",\n ],\n });\n }\n\n return {\n item: toItemRecord(result.item),\n released_by: author,\n previous_assignee: previousAssignee,\n forced: force,\n };\n}\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EACL,4BAA4B,EAC5B,gBAAgB,GACjB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,YAAY,E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C,QAAQ,CAAC,QAAQ,IAAI,IAAI,CAAC;gBACtD,IAAI,CAAC,gBAAgB,EAAE,CAAC;oBACtB,OAAO,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC;gBAC/B,CAAC;gBACD,OAAO,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC;gBAClC,OAAO,EAAE,aAAa,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC;YACzC,CAAC;SACF,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,qBAAqB,CAAC,KAAK,EAAE;YAC3B,QAAQ,EACN,kGAAkG;YACpG,QAAQ,EAAE,CAAC,gDAAgD,CAAC;YAC5D,SAAS,EAAE;gBACT,mGAAmG;gBACnG,yFAAyF;aAC1F;SACF,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,IAAI,EAAE,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC;QAC/B,WAAW,EAAE,MAAM;QACnB,iBAAiB,EAAE,gBAAgB;QACnC,MAAM,EAAE,KAAK;KACd,CAAC;AACJ,CAAC","debugId":"b0765d0a-904e-5230-a9c3-a4859d07c7ab"}
1
+ {"version":3,"file":"claim.js","sources":["cli/commands/claim.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module cli/commands/claim\n *\n * Implements the pm claim command surface and its agent-facing runtime behavior.\n */\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport {\n resolveRuntimeStatusRegistry,\n statusIsTerminal,\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 { toItemRecord } from \"../../core/item/item-record.js\";\nimport { mutateItem } from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport { resolveAuthor } from \"../../core/shared/author.js\";\nimport { wrapOwnershipConflict } from \"../../sdk/annotations.js\";\nimport { describeItemOwnershipConflict } from \"../../sdk/ownership-source.js\";\nimport { runNext, type NextRecommendation, type NextOptions } from \"./next.js\";\n\n/** Stable warning/error code for an exhausted atomic next-work walk. */\nexport const NO_AVAILABLE_NEXT_ITEM_CODE = \"no_available_next_item\";\n\n/** Documents the claim result payload exchanged by command, SDK, and package integrations. */\nexport interface ClaimResult {\n /** Value that configures or reports item for this contract. */\n item: Record<string, unknown>;\n /** Value that configures or reports claimed by for this contract. */\n claimed_by: string;\n /** Value that configures or reports previous assignee for this contract. */\n previous_assignee: string | null;\n /** Value that configures or reports forced for this contract. */\n forced: boolean;\n /** Value that configures or reports skipped for this contract. */\n skipped?: boolean;\n /** Value that configures or reports warnings for this contract. */\n warnings?: string[];\n}\n\n/** Result of atomically selecting and claiming the next caller-available item. */\nexport interface ClaimNextAvailableResult extends ClaimResult {\n /** True when an actionable candidate was claimed. */\n available: true;\n /** Value that configures or reports recommendation for this contract. */\n recommendation: NextRecommendation;\n /** Value that configures or reports attempts for this contract. */\n attempts: number;\n}\n\n/** Non-error empty result returned when an if-available candidate walk is exhausted. */\nexport interface ClaimNextUnavailableResult {\n /** Indicates that no candidate remained claimable. */\n available: false;\n /** Empty item projection for a deliberately unavailable selection. */\n item: null;\n /** Caller identity that attempted the selection. */\n claimed_by: string;\n /** No previous owner exists for an empty selection. */\n previous_assignee: null;\n /** Whether forced selection was requested. */\n forced: boolean;\n /** Signals a deliberate non-error skip. */\n skipped: true;\n /** No recommendation survived the bounded walk. */\n recommendation: null;\n /** Number of ranked candidates attempted. */\n attempts: number;\n /** Stable machine-readable exhaustion warning. */\n warnings: [typeof NO_AVAILABLE_NEXT_ITEM_CODE];\n}\n\n/** Result of a successful or deliberately empty atomic next-work claim. */\nexport type ClaimNextResult =\n | ClaimNextAvailableResult\n | ClaimNextUnavailableResult;\n\n/** Returns whether a failed claim lost the atomic test-and-set race. */\nexport function isAlreadyClaimedError(error: unknown): boolean {\n return (\n error instanceof PmCliError && error.context?.code === \"already_claimed_by\"\n );\n}\n\ntype ClaimRunner = (\n id: string,\n force: boolean,\n global: GlobalOptions,\n options: ClaimMutationOptions,\n) => Promise<ClaimResult>;\n\n/** Documents the release result payload exchanged by command, SDK, and package integrations. */\nexport interface ReleaseResult {\n /** Value that configures or reports item for this contract. */\n item: Record<string, unknown>;\n /** Value that configures or reports released by for this contract. */\n released_by: string;\n /** Value that configures or reports previous assignee for this contract. */\n previous_assignee: string | null;\n /** Value that configures or reports forced for this contract. */\n forced: boolean;\n}\n\n/** Documents the claim mutation options payload exchanged by command, SDK, and package integrations. */\nexport interface ClaimMutationOptions {\n /** Value that configures or reports author for this contract. */\n author?: string;\n /** Human-readable explanation suitable for logs and agent-facing output. */\n message?: string;\n /** Value that configures or reports if available for this contract. */\n ifAvailable?: boolean;\n /** Maximum ranked candidates attempted by `claim --next`. */\n maxAttempts?: string | number;\n}\n\n/** Documents the release mutation options payload exchanged by command, SDK, and package integrations. */\nexport type ReleaseMutationOptions = ClaimMutationOptions;\n\n/** Implements run claim for the public runtime surface of this module. */\nexport async function runClaim(\n id: string,\n force: boolean,\n global: GlobalOptions,\n options: ClaimMutationOptions = {},\n): Promise<ClaimResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(\n `Tracker is not initialized at ${pmRoot}. Run pm init first.`,\n EXIT_CODE.NOT_FOUND,\n );\n }\n const settings = await readSettings(pmRoot);\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const author = resolveAuthor(options.author, settings.author_default);\n let previousAssignee: string | null = null;\n let skipped = false;\n const mutationWarnings: string[] = [];\n\n const result = await mutateItem({\n pmRoot,\n settings,\n id,\n op: \"claim\",\n author,\n message: options.message,\n force,\n skipNoop: true,\n async mutate(document) {\n const currentAssignee = document.metadata.assignee;\n const currentAssigneeText =\n typeof currentAssignee === \"string\" ? currentAssignee : \"\";\n previousAssignee =\n currentAssigneeText.trim().length > 0 ? currentAssigneeText : null;\n if (\n statusIsTerminal(document.metadata.status, statusRegistry) &&\n !force\n ) {\n throw new PmCliError(\n `Cannot claim terminal item ${document.metadata.id} without --force`,\n EXIT_CODE.CONFLICT,\n );\n }\n const heldByOther =\n previousAssignee !== null && previousAssignee !== author;\n if (heldByOther && options.ifAvailable === true) {\n skipped = true;\n mutationWarnings.push(`claim_skipped_held_by:${previousAssignee}`);\n return { changedFields: [] };\n }\n if (heldByOther && !force) {\n const ownershipPhrase = await describeItemOwnershipConflict(\n pmRoot,\n document.metadata.id,\n currentAssigneeText,\n );\n throw new PmCliError(\n `Item ${document.metadata.id} is already ${ownershipPhrase}. Use --force to take over, or --if-available to skip without failing.`,\n EXIT_CODE.CONFLICT,\n {\n code: \"already_claimed_by\",\n why: \"Claim is an atomic test-and-set so parallel agents never proceed believing they own the same item.\",\n nextSteps: [\n \"Run pm next to pick a different unclaimed item.\",\n \"Re-run with --if-available to treat a held item as a no-op skip.\",\n \"Re-run with --force only when taking over the item is coordinated.\",\n ],\n },\n );\n }\n if (heldByOther) {\n mutationWarnings.push(`claim_takeover:${previousAssignee}->${author}`);\n }\n document.metadata.assignee = author;\n return { changedFields: [\"assignee\"], warnings: mutationWarnings };\n },\n });\n\n return {\n item: toItemRecord(result.item),\n claimed_by:\n skipped && previousAssignee !== null ? previousAssignee : author,\n previous_assignee: previousAssignee,\n forced: force,\n ...(skipped ? { skipped: true } : {}),\n ...(mutationWarnings.length > 0 ? { warnings: mutationWarnings } : {}),\n };\n}\n\n/** Selects ranked actionable work and claims the first candidate still available under the item lock. Conflicts caused by parallel claimers advance to the next candidate instead of returning a thundering-herd failure. */\nexport async function runClaimNext(\n force: boolean,\n global: GlobalOptions,\n options: ClaimMutationOptions = {},\n nextOptions: NextOptions = {},\n): Promise<ClaimNextResult> {\n const maxAttempts = parseClaimNextAttempts(options.maxAttempts);\n const settings = await readSettings(resolvePmRoot(process.cwd(), global.path));\n const claimOptions = {\n ...options,\n author: resolveAuthor(options.author, settings.author_default),\n };\n const next = await runNext(\n {\n ...nextOptions,\n callerAuthor: claimOptions.author,\n limit: String(maxAttempts),\n },\n global,\n );\n const recommendations = [next.recommended, ...next.ready]\n .filter((entry): entry is NextRecommendation => entry !== null)\n .map((entry) => ({\n ...entry,\n reasons: \"reasons\" in entry ? entry.reasons : [\"ranked ready candidate\"],\n }));\n return claimNextFromRecommendations(\n recommendations.slice(0, maxAttempts),\n force,\n global,\n claimOptions,\n );\n}\n\n/** Parses the bounded candidate walk used by `claim --next`. */\nexport function parseClaimNextAttempts(raw: string | number | undefined): number {\n if (raw === undefined) return 10;\n const parsed = Number(raw);\n if (!Number.isSafeInteger(parsed) || parsed < 1 || parsed > 100) {\n throw new PmCliError(\n \"--max-attempts must be an integer from 1 to 100\",\n EXIT_CODE.USAGE,\n );\n }\n return parsed;\n}\n\n/** Claims the first still-available row from a pre-ranked recommendation set. */\nexport async function claimNextFromRecommendations(\n recommendations: NextRecommendation[],\n force: boolean,\n global: GlobalOptions,\n options: ClaimMutationOptions = {},\n claimRunner: ClaimRunner = runClaim,\n): Promise<ClaimNextResult> {\n let attempts = 0;\n for (const recommendation of recommendations) {\n attempts += 1;\n try {\n const claimed = await claimRunner(\n recommendation.id,\n force,\n global,\n options,\n );\n const result = { ...claimed, recommendation, attempts, available: true as const };\n if (!claimed.skipped) return result;\n } catch (error: unknown) {\n if (!isAlreadyClaimedError(error)) throw error;\n }\n }\n if (options.ifAvailable === true) {\n return {\n available: false,\n item: null,\n claimed_by: options.author ?? process.env.PM_AUTHOR ?? \"unknown\",\n previous_assignee: null,\n forced: force,\n skipped: true,\n recommendation: null,\n attempts,\n warnings: [NO_AVAILABLE_NEXT_ITEM_CODE],\n };\n }\n const noCandidatesMatched = attempts === 0;\n throw new PmCliError(\n noCandidatesMatched\n ? \"No actionable items matched the selection filters\"\n : \"No actionable item remained available to claim\",\n noCandidatesMatched ? EXIT_CODE.NOT_FOUND : EXIT_CODE.CONFLICT,\n {\n code: NO_AVAILABLE_NEXT_ITEM_CODE,\n why: noCandidatesMatched\n ? \"No ready items matched the specified filters or selection criteria.\"\n : \"Every ranked candidate was claimed by another agent before this atomic selection completed.\",\n nextSteps: [\n noCandidatesMatched\n ? \"Verify the filters or run pm next to inspect all ready work.\"\n : \"Run pm claim --next again to refresh the ranked candidate set.\",\n ],\n },\n );\n}\n\n/** Implements run release for the public runtime surface of this module. */\nexport async function runRelease(\n id: string,\n force: boolean,\n global: GlobalOptions,\n options: ReleaseMutationOptions = {},\n): Promise<ReleaseResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(\n `Tracker is not initialized at ${pmRoot}. Run pm init first.`,\n EXIT_CODE.NOT_FOUND,\n );\n }\n const settings = await readSettings(pmRoot);\n const author = resolveAuthor(options.author, settings.author_default);\n const ownershipReleaseBypass =\n (options as ReleaseMutationOptions & {\n ownershipReleaseBypass?: boolean;\n }).ownershipReleaseBypass === true;\n let previousAssignee: string | null = null;\n\n let result: Awaited<ReturnType<typeof mutateItem>>;\n try {\n result = await mutateItem({\n pmRoot,\n settings,\n id,\n op: \"release\",\n author,\n message: options.message,\n force,\n bypassAssigneeConflict: ownershipReleaseBypass,\n mutate(document) {\n previousAssignee = document.metadata.assignee ?? null;\n if (!previousAssignee) {\n return { changedFields: [] };\n }\n delete document.metadata.assignee;\n return { changedFields: [\"assignee\"] };\n },\n });\n } catch (error: unknown) {\n wrapOwnershipConflict(error, {\n required:\n \"For approved non-owner handoffs, prefer the ownership-release bypass before considering --force.\",\n examples: ['pm release pm-a1b2 --author \"reviewer\" --force'],\n nextSteps: [\n \"Use the package-provided ownership-release bypass for handoffs that only clear assignee metadata.\",\n \"Use --force only when an explicit override is approved for broader ownership conflicts.\",\n ],\n });\n }\n\n return {\n item: toItemRecord(result.item),\n released_by: author,\n previous_assignee: previousAssignee,\n forced: force,\n };\n}\n"],"names":[],"mappings":"AAAA;;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AC,MAAM,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC;IACtE,MAAM,sBAAsB,GACzB,OAEC,CAAC,sBAAsB,KAAK,IAAI,CAAC;IACrC,IAAI,gBAAgB,GAAkB,IAAI,CAAC;IAE3C,IAAI,MAA8C,CAAC;IACnD,IAAI,CAAC;QACH,MAAM,GAAG,MAAM,UAAU,CAAC;YACxB,MAAM;YACN,QAAQ;YACR,EAAE;YACF,EAAE,EAAE,SAAS;YACb,MAAM;YACN,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,KAAK;YACL,sBAAsB,EAAE,sBAAsB;YAC9C,MAAM,CAAC,QAAQ;gBACb,gBAAgB,GAAG,QAAQ,CAAC,QAAQ,CAAC,QAAQ,IAAI,IAAI,CAAC;gBACtD,IAAI,CAAC,gBAAgB,EAAE,CAAC;oBACtB,OAAO,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC;gBAC/B,CAAC;gBACD,OAAO,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC;gBAClC,OAAO,EAAE,aAAa,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC;YACzC,CAAC;SACF,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,qBAAqB,CAAC,KAAK,EAAE;YAC3B,QAAQ,EACN,kGAAkG;YACpG,QAAQ,EAAE,CAAC,gDAAgD,CAAC;YAC5D,SAAS,EAAE;gBACT,mGAAmG;gBACnG,yFAAyF;aAC1F;SACF,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,IAAI,EAAE,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC;QAC/B,WAAW,EAAE,MAAM;QACnB,iBAAiB,EAAE,gBAAgB;QACnC,MAAM,EAAE,KAAK;KACd,CAAC;AACJ,CAAC","debugId":"07b1663e-40e3-52cf-99f6-458a651ab229"}
@@ -4,7 +4,7 @@
4
4
  * Implements the pm comments 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]="8ce260ec-649b-50b7-ac63-c848f47c5e83")}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]="b3b32185-9c56-5f47-843d-1181bd71f230")}catch(e){}}();
8
8
  import { readFile } from "node:fs/promises";
9
9
  import { EXIT_CODE } from "../../core/shared/constants.js";
10
10
  import { PmCliError } from "../../core/shared/errors.js";
@@ -95,6 +95,9 @@ async function resolveCommentInput(options, stdinResolver) {
95
95
  export async function runComments(id, options, global) {
96
96
  const stdinResolver = createStdinTokenResolver();
97
97
  const commentInput = await resolveCommentInput(options, stdinResolver);
98
+ if (commentInput.mode === "list" && options.message !== undefined) {
99
+ throw new PmCliError("--message labels a comment mutation but does not provide comment text. Pass text positionally or with --add, --stdin, or --file.", EXIT_CODE.USAGE);
100
+ }
98
101
  const shouldParseText = commentInput.mode === "add" || commentInput.mode === "edit";
99
102
  const rawValue = commentInput.value ?? "";
100
103
  return runAnnotationCommand(id, options, global, {
@@ -123,4 +126,4 @@ export async function runComments(id, options, global) {
123
126
  });
124
127
  }
125
128
  //# sourceMappingURL=comments.js.map
126
- //# debugId=8ce260ec-649b-50b7-ac63-c848f47c5e83
129
+ //# debugId=b3b32185-9c56-5f47-843d-1181bd71f230
@@ -1 +1 @@
1
- {"version":3,"file":"comments.js","sources":["cli/commands/comments.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module cli/commands/comments\n *\n * Implements the pm comments command surface and its agent-facing runtime behavior.\n */\nimport { readFile } from \"node:fs/promises\";\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 { createStdinTokenResolver } from \"../../core/item/parse.js\";\nimport type { Comment } from \"../../types/index.js\";\nimport {\n isErrnoError,\n parseAnnotationTextInput,\n runAnnotationCommand,\n} from \"../../sdk/annotations.js\";\n\n/** Documents the comments command options payload exchanged by command, SDK, and package integrations. */\nexport interface CommentsCommandOptions {\n /** Value that configures or reports add for this contract. */\n add?: string;\n /** Value that configures or reports stdin for this contract. */\n stdin?: boolean;\n /** Value that configures or reports file for this contract. */\n file?: string;\n /** Value that configures or reports edit for this contract. */\n edit?: number;\n /** Value that configures or reports delete for this contract. */\n delete?: number;\n /** Value that configures or reports limit for this contract. */\n limit?: string;\n /** Value that configures or reports include meta for this contract. */\n includeMeta?: boolean;\n /** Value that configures or reports author for this contract. */\n author?: string;\n /** Human-readable explanation suitable for logs and agent-facing output. */\n message?: string;\n /** Value that configures or reports force for this contract. */\n force?: boolean;\n}\n\n/** Documents the comments result payload exchanged by command, SDK, and package integrations. */\nexport interface CommentsResult {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports comments for this contract. */\n comments: Comment[];\n /** Value that configures or reports count for this contract. */\n count: number;\n /** Number of total entries represented by this result. */\n total_count?: number;\n /** Number of returned entries represented by this result. */\n returned_count?: number;\n /** Whether more applies to this operation. */\n has_more?: boolean;\n /** Value that configures or reports limit for this contract. */\n limit?: number;\n}\n\ninterface ResolvedCommentInput {\n mode: \"list\" | \"add\" | \"stdin\" | \"file\" | \"edit\" | \"delete\";\n value?: string;\n emptyFlag?: string;\n index?: number;\n}\n\nasync function resolveCommentTextSource(\n options: CommentsCommandOptions,\n stdinResolver: ReturnType<typeof createStdinTokenResolver>,\n): Promise<{ value: string; emptyFlag: string } | undefined> {\n const hasAdd = options.add !== undefined;\n const hasStdin = options.stdin === true;\n const hasFile = typeof options.file === \"string\";\n const sourceCount = Number(hasAdd) + Number(hasStdin) + Number(hasFile);\n if (sourceCount === 0) {\n return undefined;\n }\n if (sourceCount > 1) {\n throw new PmCliError(\n \"Specify comment text using only one input source: --add, --stdin, or --file\",\n EXIT_CODE.USAGE,\n );\n }\n if (hasAdd) {\n const addInput = await stdinResolver.resolveValue(options.add, \"--add\");\n return { value: addInput ?? \"\", emptyFlag: \"--add\" };\n }\n if (hasStdin) {\n const stdinInput = await stdinResolver.resolveValue(\"-\", \"--stdin\");\n return { value: stdinInput ?? \"\", emptyFlag: \"--stdin\" };\n }\n const filePath = (options.file as string).trim();\n if (!filePath) {\n throw new PmCliError(\"--file path cannot be empty\", EXIT_CODE.USAGE);\n }\n try {\n const fileInput = await readFile(filePath, \"utf8\");\n return { value: fileInput, emptyFlag: \"--file\" };\n } catch (error: unknown) {\n if (isErrnoError(error) && error.code === \"ENOENT\") {\n throw new PmCliError(\n `--file path not found: ${filePath}`,\n EXIT_CODE.USAGE,\n );\n }\n const detail = error instanceof Error ? error.message : String(error);\n throw new PmCliError(\n `Failed to read --file path \"${filePath}\": ${detail}`,\n EXIT_CODE.USAGE,\n );\n }\n}\n\nasync function resolveCommentInput(\n options: CommentsCommandOptions,\n stdinResolver: ReturnType<typeof createStdinTokenResolver>,\n): Promise<ResolvedCommentInput> {\n const editIndex = options.edit;\n const deleteIndex = options.delete;\n const hasEdit = editIndex !== undefined;\n const hasDelete = deleteIndex !== undefined;\n if (hasEdit && hasDelete) {\n throw new PmCliError(\n \"Specify only one of --edit or --delete\",\n EXIT_CODE.USAGE,\n );\n }\n if (editIndex !== undefined && (!Number.isInteger(editIndex) || editIndex < 1)) {\n throw new PmCliError(\"--edit must be a positive integer\", EXIT_CODE.USAGE);\n }\n if (deleteIndex !== undefined && (!Number.isInteger(deleteIndex) || deleteIndex < 1)) {\n throw new PmCliError(\"--delete must be a positive integer\", EXIT_CODE.USAGE);\n }\n\n if (hasDelete) {\n const textSource = await resolveCommentTextSource(options, stdinResolver);\n if (textSource !== undefined) {\n throw new PmCliError(\n \"--delete does not take comment text\",\n EXIT_CODE.USAGE,\n );\n }\n return { mode: \"delete\", index: deleteIndex };\n }\n\n if (hasEdit) {\n const textSource = await resolveCommentTextSource(options, stdinResolver);\n if (textSource === undefined) {\n throw new PmCliError(\n \"--edit requires replacement text via positional [text], --add, --stdin, or --file\",\n EXIT_CODE.USAGE,\n );\n }\n return {\n mode: \"edit\",\n index: editIndex,\n value: textSource.value,\n emptyFlag: textSource.emptyFlag,\n };\n }\n\n const textSource = await resolveCommentTextSource(options, stdinResolver);\n if (textSource === undefined) {\n return { mode: \"list\" };\n }\n // Map the single resolved input source back to its add/stdin/file mode so the\n // caller still knows whether to run plain-text markdown parsing (add-only).\n const mode =\n textSource.emptyFlag === \"--add\"\n ? \"add\"\n : textSource.emptyFlag === \"--stdin\"\n ? \"stdin\"\n : \"file\";\n return { mode, value: textSource.value, emptyFlag: textSource.emptyFlag };\n}\n\n/** Implements run comments for the public runtime surface of this module. */\nexport async function runComments(\n id: string,\n options: CommentsCommandOptions,\n global: GlobalOptions,\n): Promise<CommentsResult> {\n const stdinResolver = createStdinTokenResolver();\n const commentInput = await resolveCommentInput(options, stdinResolver);\n\n const shouldParseText =\n commentInput.mode === \"add\" || commentInput.mode === \"edit\";\n const rawValue = commentInput.value ?? \"\";\n return runAnnotationCommand<\"comments\", Comment>(id, options, global, {\n input: {\n ...commentInput,\n rawValue: options.add ?? rawValue,\n value: shouldParseText\n ? parseAnnotationTextInput(rawValue, { stripPlainTextPrefix: true })\n : rawValue,\n },\n collectionKey: \"comments\",\n op: \"comment_add\",\n editOp: \"comment_edit\",\n deleteOp: \"comment_delete\",\n parseText: (raw) => raw,\n bypassOwnershipConflict: Boolean(\n commentInput.mode === \"add\" &&\n (options as CommentsCommandOptions & {\n ownershipAppendBypass?: boolean;\n }).ownershipAppendBypass,\n ),\n conflictGuidance: {\n required:\n \"For an approved append-only handoff on another owner's item, use the package-provided ownership bypass before considering --force.\",\n examples: ['pm comments pm-a1b2 --add \"review note\" --author \"reviewer\" --force'],\n nextSteps: [\n \"Use an installed package's narrow append-only ownership bypass when available.\",\n \"Use --force only when an ownership override is explicitly approved.\",\n ],\n },\n });\n}\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAmDlC,KAAK,UAAU,wBAAwB,CACrC,OAA+B,EAC/B,aAA0D;IAE1D,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,KAAK,SAAS,CAAC;IACzC,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,KAAK,IAAI,CAAC;IACxC,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,KAAK,QAAQ,CAAC;IACjD,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IACxE,IAAI,WAAW,KAAK,CAAC,EAAE,CAAC;QACtB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,WAAW,GAAG,CAAC,EAAE,CAAC;QACpB,MAAM,IAAI,UAAU,CAClB,6EAA6E,EAC7E,SAAS,CAAC,KAAK,CAChB,CAAC;IACJ,CAAC;IACD,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,QAAQ,GAAG,MAAM,aAAa,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QACxE,OAAO,EAAE,KAAK,EAAE,QAAQ,IAAI,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;IACvD,CAAC;IACD,IAAI,QAAQ,EAAE,CAAC;QACb,MA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UAAU;QACzB,EAAE,EAAE,aAAa;QACjB,MAAM,EAAE,cAAc;QACtB,QAAQ,EAAE,gBAAgB;QAC1B,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG;QACvB,uBAAuB,EAAE,OAAO,CAC9B,YAAY,CAAC,IAAI,KAAK,KAAK;YACxB,OAEC,CAAC,qBAAqB,CAC3B;QACD,gBAAgB,EAAE;YAChB,QAAQ,EACN,oIAAoI;YACtI,QAAQ,EAAE,CAAC,qEAAqE,CAAC;YACjF,SAAS,EAAE;gBACT,gFAAgF;gBAChF,qEAAqE;aACtE;SACF;KACF,CAAC,CAAC;AACL,CAAC","debugId":"8ce260ec-649b-50b7-ac63-c848f47c5e83"}
1
+ {"version":3,"file":"comments.js","sources":["cli/commands/comments.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module cli/commands/comments\n *\n * Implements the pm comments command surface and its agent-facing runtime behavior.\n */\nimport { readFile } from \"node:fs/promises\";\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 { createStdinTokenResolver } from \"../../core/item/parse.js\";\nimport type { Comment } from \"../../types/index.js\";\nimport {\n isErrnoError,\n parseAnnotationTextInput,\n runAnnotationCommand,\n} from \"../../sdk/annotations.js\";\n\n/** Documents the comments command options payload exchanged by command, SDK, and package integrations. */\nexport interface CommentsCommandOptions {\n /** Value that configures or reports add for this contract. */\n add?: string;\n /** Value that configures or reports stdin for this contract. */\n stdin?: boolean;\n /** Value that configures or reports file for this contract. */\n file?: string;\n /** Value that configures or reports edit for this contract. */\n edit?: number;\n /** Value that configures or reports delete for this contract. */\n delete?: number;\n /** Value that configures or reports limit for this contract. */\n limit?: string;\n /** Value that configures or reports include meta for this contract. */\n includeMeta?: boolean;\n /** Value that configures or reports author for this contract. */\n author?: string;\n /** Human-readable explanation suitable for logs and agent-facing output. */\n message?: string;\n /** Value that configures or reports force for this contract. */\n force?: boolean;\n}\n\n/** Documents the comments result payload exchanged by command, SDK, and package integrations. */\nexport interface CommentsResult {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports comments for this contract. */\n comments: Comment[];\n /** Value that configures or reports count for this contract. */\n count: number;\n /** Number of total entries represented by this result. */\n total_count?: number;\n /** Number of returned entries represented by this result. */\n returned_count?: number;\n /** Whether more applies to this operation. */\n has_more?: boolean;\n /** Value that configures or reports limit for this contract. */\n limit?: number;\n}\n\ninterface ResolvedCommentInput {\n mode: \"list\" | \"add\" | \"stdin\" | \"file\" | \"edit\" | \"delete\";\n value?: string;\n emptyFlag?: string;\n index?: number;\n}\n\nasync function resolveCommentTextSource(\n options: CommentsCommandOptions,\n stdinResolver: ReturnType<typeof createStdinTokenResolver>,\n): Promise<{ value: string; emptyFlag: string } | undefined> {\n const hasAdd = options.add !== undefined;\n const hasStdin = options.stdin === true;\n const hasFile = typeof options.file === \"string\";\n const sourceCount = Number(hasAdd) + Number(hasStdin) + Number(hasFile);\n if (sourceCount === 0) {\n return undefined;\n }\n if (sourceCount > 1) {\n throw new PmCliError(\n \"Specify comment text using only one input source: --add, --stdin, or --file\",\n EXIT_CODE.USAGE,\n );\n }\n if (hasAdd) {\n const addInput = await stdinResolver.resolveValue(options.add, \"--add\");\n return { value: addInput ?? \"\", emptyFlag: \"--add\" };\n }\n if (hasStdin) {\n const stdinInput = await stdinResolver.resolveValue(\"-\", \"--stdin\");\n return { value: stdinInput ?? \"\", emptyFlag: \"--stdin\" };\n }\n const filePath = (options.file as string).trim();\n if (!filePath) {\n throw new PmCliError(\"--file path cannot be empty\", EXIT_CODE.USAGE);\n }\n try {\n const fileInput = await readFile(filePath, \"utf8\");\n return { value: fileInput, emptyFlag: \"--file\" };\n } catch (error: unknown) {\n if (isErrnoError(error) && error.code === \"ENOENT\") {\n throw new PmCliError(\n `--file path not found: ${filePath}`,\n EXIT_CODE.USAGE,\n );\n }\n const detail = error instanceof Error ? error.message : String(error);\n throw new PmCliError(\n `Failed to read --file path \"${filePath}\": ${detail}`,\n EXIT_CODE.USAGE,\n );\n }\n}\n\nasync function resolveCommentInput(\n options: CommentsCommandOptions,\n stdinResolver: ReturnType<typeof createStdinTokenResolver>,\n): Promise<ResolvedCommentInput> {\n const editIndex = options.edit;\n const deleteIndex = options.delete;\n const hasEdit = editIndex !== undefined;\n const hasDelete = deleteIndex !== undefined;\n if (hasEdit && hasDelete) {\n throw new PmCliError(\n \"Specify only one of --edit or --delete\",\n EXIT_CODE.USAGE,\n );\n }\n if (editIndex !== undefined && (!Number.isInteger(editIndex) || editIndex < 1)) {\n throw new PmCliError(\"--edit must be a positive integer\", EXIT_CODE.USAGE);\n }\n if (deleteIndex !== undefined && (!Number.isInteger(deleteIndex) || deleteIndex < 1)) {\n throw new PmCliError(\"--delete must be a positive integer\", EXIT_CODE.USAGE);\n }\n\n if (hasDelete) {\n const textSource = await resolveCommentTextSource(options, stdinResolver);\n if (textSource !== undefined) {\n throw new PmCliError(\n \"--delete does not take comment text\",\n EXIT_CODE.USAGE,\n );\n }\n return { mode: \"delete\", index: deleteIndex };\n }\n\n if (hasEdit) {\n const textSource = await resolveCommentTextSource(options, stdinResolver);\n if (textSource === undefined) {\n throw new PmCliError(\n \"--edit requires replacement text via positional [text], --add, --stdin, or --file\",\n EXIT_CODE.USAGE,\n );\n }\n return {\n mode: \"edit\",\n index: editIndex,\n value: textSource.value,\n emptyFlag: textSource.emptyFlag,\n };\n }\n\n const textSource = await resolveCommentTextSource(options, stdinResolver);\n if (textSource === undefined) {\n return { mode: \"list\" };\n }\n // Map the single resolved input source back to its add/stdin/file mode so the\n // caller still knows whether to run plain-text markdown parsing (add-only).\n const mode =\n textSource.emptyFlag === \"--add\"\n ? \"add\"\n : textSource.emptyFlag === \"--stdin\"\n ? \"stdin\"\n : \"file\";\n return { mode, value: textSource.value, emptyFlag: textSource.emptyFlag };\n}\n\n/** Implements run comments for the public runtime surface of this module. */\nexport async function runComments(\n id: string,\n options: CommentsCommandOptions,\n global: GlobalOptions,\n): Promise<CommentsResult> {\n const stdinResolver = createStdinTokenResolver();\n const commentInput = await resolveCommentInput(options, stdinResolver);\n if (commentInput.mode === \"list\" && options.message !== undefined) {\n throw new PmCliError(\n \"--message labels a comment mutation but does not provide comment text. Pass text positionally or with --add, --stdin, or --file.\",\n EXIT_CODE.USAGE,\n );\n }\n\n const shouldParseText =\n commentInput.mode === \"add\" || commentInput.mode === \"edit\";\n const rawValue = commentInput.value ?? \"\";\n return runAnnotationCommand<\"comments\", Comment>(id, options, global, {\n input: {\n ...commentInput,\n rawValue: options.add ?? rawValue,\n value: shouldParseText\n ? parseAnnotationTextInput(rawValue, { stripPlainTextPrefix: true })\n : rawValue,\n },\n collectionKey: \"comments\",\n op: \"comment_add\",\n editOp: \"comment_edit\",\n deleteOp: \"comment_delete\",\n parseText: (raw) => raw,\n bypassOwnershipConflict: Boolean(\n commentInput.mode === \"add\" &&\n (options as CommentsCommandOptions & {\n ownershipAppendBypass?: boolean;\n }).ownershipAppendBypass,\n ),\n conflictGuidance: {\n required:\n \"For an approved append-only handoff on another owner's item, use the package-provided ownership bypass before considering --force.\",\n examples: ['pm comments pm-a1b2 --add \"review note\" --author \"reviewer\" --force'],\n nextSteps: [\n \"Use an installed package's narrow append-only ownership bypass when available.\",\n \"Use --force only when an ownership override is explicitly approved.\",\n ],\n },\n });\n}\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAmDlC,KAAK,UAAU,wBAAwB,CACrC,OAA+B,EAC/B,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I;YACtI,QAAQ,EAAE,CAAC,qEAAqE,CAAC;YACjF,SAAS,EAAE;gBACT,gFAAgF;gBAChF,qEAAqE;aACtE;SACF;KACF,CAAC,CAAC;AACL,CAAC","debugId":"b3b32185-9c56-5f47-843d-1181bd71f230"}
@@ -89,6 +89,13 @@ export interface ContextFocusItem {
89
89
  /** Value that configures or reports completion pct for this contract. */
90
90
  completion_pct?: number;
91
91
  }
92
+ /** Compact agenda reference used when the corresponding item is already present in a focus section. */
93
+ export type ContextAgendaEvent = CalendarRow | (Pick<CalendarRow, "at" | "date" | "kind" | "item_id"> & {
94
+ reference_only: true;
95
+ reminder_text?: string | null;
96
+ event_title?: string | null;
97
+ event_recurring?: boolean | null;
98
+ });
92
99
  /** Documents the hierarchy child payload exchanged by command, SDK, and package integrations. */
93
100
  export interface HierarchyChild {
94
101
  /** Stable identifier used to reference this record across commands and storage. */
@@ -281,7 +288,7 @@ export interface ContextResult {
281
288
  /** Value that configures or reports agenda for this contract. */
282
289
  agenda: {
283
290
  summary: ContextAgendaSummary;
284
- events: CalendarRow[];
291
+ events: ContextAgendaEvent[];
285
292
  };
286
293
  /** Value that configures or reports hierarchy for this contract. */
287
294
  hierarchy?: HierarchyNode[];
@@ -435,6 +442,7 @@ export declare const _testOnly: {
435
442
  completionPct: typeof completionPct;
436
443
  dateTokenForTimestamp: typeof dateTokenForTimestamp;
437
444
  filterTerminalCalendarEvents: typeof filterTerminalCalendarEvents;
445
+ formatAgendaLine: typeof formatAgendaLine;
438
446
  isBlockedStatus: typeof isBlockedStatus;
439
447
  isClosedStatus: typeof isClosedStatus;
440
448
  isInProgressStatus: typeof isInProgressStatus;
@@ -462,6 +470,7 @@ declare function buildStaleness(allNonTerminal: ItemMetadata[], staleThresholdDa
462
470
  declare function buildRecentlyCreated(allNonTerminal: ItemMetadata[], statusRegistry: RuntimeStatusRegistry, childrenByParent: Map<string, ItemMetadata[]>, limit: number): RecentContextItem[];
463
471
  declare function buildUnparented(allNonTerminal: ItemMetadata[], statusRegistry: RuntimeStatusRegistry, childrenByParent: Map<string, ItemMetadata[]>, limit: number): ContextFocusItem[];
464
472
  declare function buildTestHealth(activeItems: ItemMetadata[]): TestHealthSummary;
473
+ declare function formatAgendaLine(event: ContextAgendaEvent): string;
465
474
  /** Implements render context markdown for the public runtime surface of this module. */
466
475
  export declare function renderContextMarkdown(result: ContextResult): string;
467
476
  /** Implements run context for the public runtime surface of this module. */
@@ -4,7 +4,7 @@
4
4
  * Implements the pm context 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]="2df694f8-45bb-5a5c-aea9-30da2ed1633d")}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]="73237ae4-dd9f-5a67-9053-b2ffed05b1cf")}catch(e){}}();
8
8
  import { SETTINGS_DEFAULTS, EXIT_CODE } from "../../core/shared/constants.js";
9
9
  import { PmCliError } from "../../core/shared/errors.js";
10
10
  import { compareTimestampStrings, nowIso } from "../../core/shared/time.js";
@@ -634,6 +634,7 @@ export const _testOnly = {
634
634
  completionPct,
635
635
  dateTokenForTimestamp,
636
636
  filterTerminalCalendarEvents,
637
+ formatAgendaLine,
637
638
  isBlockedStatus,
638
639
  isClosedStatus,
639
640
  isInProgressStatus,
@@ -869,6 +870,14 @@ function formatProjectedFocusLine(item, fields) {
869
870
  .join(" ");
870
871
  }
871
872
  function formatAgendaLine(event) {
873
+ if ("reference_only" in event) {
874
+ const suffix = event.kind === "reminder"
875
+ ? ` — ${event.reminder_text ?? "reminder"}`
876
+ : event.kind === "event"
877
+ ? ` — ${event.event_title ?? "event"}${event.event_recurring ? " (recurring)" : ""}`
878
+ : "";
879
+ return `${formatClock(event.at)} [${event.kind}] ${event.item_id} (see focus item)${suffix}`;
880
+ }
872
881
  const base = `${formatClock(event.at)} [${event.kind}] ${event.item_id} p${event.item_priority} ${event.item_status} ${event.item_title}`;
873
882
  if (event.kind === "reminder") {
874
883
  return `${base} — ${event.reminder_text}`;
@@ -1256,7 +1265,7 @@ function shouldPageContextFocus(options, corpusItemCount) {
1256
1265
  options.after !== undefined ||
1257
1266
  corpusItemCount >= CONTEXT_SCALE_THRESHOLD);
1258
1267
  }
1259
- async function buildContextAgenda(options, global, runtime, subtreeIds) {
1268
+ async function buildContextAgenda(options, global, runtime, subtreeIds, listedFocusIds) {
1260
1269
  const calendarOptions = {
1261
1270
  ...runtime.baseListOptions,
1262
1271
  view: "agenda",
@@ -1267,8 +1276,33 @@ async function buildContextAgenda(options, global, runtime, subtreeIds) {
1267
1276
  const scopedAgenda = subtreeIds === undefined
1268
1277
  ? agenda.events
1269
1278
  : agenda.events.filter((event) => subtreeIds.has(event.item_id.trim().toLowerCase()));
1270
- const agendaEvents = filterTerminalCalendarEvents(scopedAgenda, runtime.statusRegistry).slice(0, runtime.limit);
1271
- return { agenda, agendaEvents, agendaSummary: summarizeAgenda(agendaEvents) };
1279
+ const fullAgendaEvents = filterTerminalCalendarEvents(scopedAgenda, runtime.statusRegistry).slice(0, runtime.limit);
1280
+ const agendaEvents = fullAgendaEvents.map((event) => {
1281
+ if (!listedFocusIds.has(event.item_id)) {
1282
+ return event;
1283
+ }
1284
+ return {
1285
+ at: event.at,
1286
+ date: event.date,
1287
+ kind: event.kind,
1288
+ item_id: event.item_id,
1289
+ reference_only: true,
1290
+ ...(event.kind === "reminder"
1291
+ ? { reminder_text: event.reminder_text }
1292
+ : {}),
1293
+ ...(event.kind === "event"
1294
+ ? {
1295
+ event_title: event.event_title,
1296
+ event_recurring: event.event_recurring,
1297
+ }
1298
+ : {}),
1299
+ };
1300
+ });
1301
+ return {
1302
+ agenda,
1303
+ agendaEvents,
1304
+ agendaSummary: summarizeAgenda(fullAgendaEvents),
1305
+ };
1272
1306
  }
1273
1307
  function countContextStatus(items, status, statusRegistry) {
1274
1308
  const targetStatus = String(status);
@@ -1408,7 +1442,11 @@ export async function runContext(options, global) {
1408
1442
  // the full corpus so terminal blocker targets count as satisfied at every depth.
1409
1443
  const blockedIds = collectDependencyBlockedIds(corpus.fullCorpus, runtime.statusRegistry);
1410
1444
  const focusGroups = await resolveContextFocusGroups(corpus.listedItemMetadata, corpus.allItems, blockedIds, runtime.statusRegistry, runtime.sectionsIncluded, runtime.limit, nowIso(), author, options.after, buildContextCursorFingerprint(options), shouldPageContextFocus(options, corpus.fullCorpus.length), pmRoot);
1411
- const agendaContext = await buildContextAgenda(options, global, runtime, corpus.subtreeIds);
1445
+ const agendaContext = await buildContextAgenda(options, global, runtime, corpus.subtreeIds, new Set([
1446
+ ...focusGroups.highLevel,
1447
+ ...focusGroups.lowLevel,
1448
+ ...focusGroups.blockedFallback,
1449
+ ].map((item) => item.id)));
1412
1450
  const warnings = mergeSortedWarnings(corpus.listed.warnings, agendaContext.agenda.warnings, focusGroups.ranking.warnings);
1413
1451
  const inProgressCount = countContextStatus(focusGroups.activeItems, normalizeStatusInput("in_progress", runtime.statusRegistry), runtime.statusRegistry);
1414
1452
  const openCount = countContextStatus(focusGroups.activeItems, normalizeStatusInput("open", runtime.statusRegistry), runtime.statusRegistry);
@@ -1483,4 +1521,4 @@ export async function runContext(options, global) {
1483
1521
  return result;
1484
1522
  }
1485
1523
  //# sourceMappingURL=context.js.map
1486
- //# debugId=2df694f8-45bb-5a5c-aea9-30da2ed1633d
1524
+ //# debugId=73237ae4-dd9f-5a67-9053-b2ffed05b1cf