@unbrained/pm-cli 2026.7.2 → 2026.7.4

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 (546) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/CHANGELOG.md +29 -0
  3. package/CONTRIBUTING.md +38 -9
  4. package/README.md +1 -5
  5. package/dist/cli/commander-usage.js +54 -41
  6. package/dist/cli/commander-usage.js.map +1 -1
  7. package/dist/cli/commands/activity.js +79 -57
  8. package/dist/cli/commands/activity.js.map +1 -1
  9. package/dist/cli/commands/calendar.js +3 -3
  10. package/dist/cli/commands/calendar.js.map +1 -1
  11. package/dist/cli/commands/close-many.js +106 -65
  12. package/dist/cli/commands/close-many.js.map +1 -1
  13. package/dist/cli/commands/completion.js +231 -345
  14. package/dist/cli/commands/completion.js.map +1 -1
  15. package/dist/cli/commands/create.d.ts +2 -59
  16. package/dist/cli/commands/create.js +38 -39
  17. package/dist/cli/commands/create.js.map +1 -1
  18. package/dist/cli/commands/extension/doctor.js +56 -67
  19. package/dist/cli/commands/extension/doctor.js.map +1 -1
  20. package/dist/cli/commands/extension/scaffold.js +54 -133
  21. package/dist/cli/commands/extension/scaffold.js.map +1 -1
  22. package/dist/cli/commands/extension/shared.js +21 -15
  23. package/dist/cli/commands/extension/shared.js.map +1 -1
  24. package/dist/cli/commands/files.js +3 -3
  25. package/dist/cli/commands/files.js.map +1 -1
  26. package/dist/cli/commands/health.js +101 -112
  27. package/dist/cli/commands/health.js.map +1 -1
  28. package/dist/cli/commands/history-compact.js +9 -18
  29. package/dist/cli/commands/history-compact.js.map +1 -1
  30. package/dist/cli/commands/history-repair.js +9 -19
  31. package/dist/cli/commands/history-repair.js.map +1 -1
  32. package/dist/cli/commands/init-agent-guidance.js +160 -111
  33. package/dist/cli/commands/init-agent-guidance.js.map +1 -1
  34. package/dist/cli/commands/init.js +3 -3
  35. package/dist/cli/commands/init.js.map +1 -1
  36. package/dist/cli/commands/item-filter-options.d.ts +2 -0
  37. package/dist/cli/commands/item-filter-options.js +2 -2
  38. package/dist/cli/commands/item-filter-options.js.map +1 -1
  39. package/dist/cli/commands/mutation-command-options.d.ts +78 -0
  40. package/dist/cli/commands/mutation-command-options.js +10 -0
  41. package/dist/cli/commands/mutation-command-options.js.map +1 -0
  42. package/dist/cli/commands/next.js +13 -10
  43. package/dist/cli/commands/next.js.map +1 -1
  44. package/dist/cli/commands/profile.js +23 -15
  45. package/dist/cli/commands/profile.js.map +1 -1
  46. package/dist/cli/commands/reindex.js +3 -3
  47. package/dist/cli/commands/reindex.js.map +1 -1
  48. package/dist/cli/commands/shared-unset-fields.d.ts +19 -0
  49. package/dist/cli/commands/shared-unset-fields.js +31 -2
  50. package/dist/cli/commands/shared-unset-fields.js.map +1 -1
  51. package/dist/cli/commands/update.d.ts +2 -59
  52. package/dist/cli/commands/update.js +26 -97
  53. package/dist/cli/commands/update.js.map +1 -1
  54. package/dist/cli/commands/validate.d.ts +2 -0
  55. package/dist/cli/commands/validate.js +16 -4
  56. package/dist/cli/commands/validate.js.map +1 -1
  57. package/dist/cli/error-guidance.js +9 -6
  58. package/dist/cli/error-guidance.js.map +1 -1
  59. package/dist/cli/extension-command-help.js +27 -19
  60. package/dist/cli/extension-command-help.js.map +1 -1
  61. package/dist/cli/help-json-payload.js +57 -49
  62. package/dist/cli/help-json-payload.js.map +1 -1
  63. package/dist/cli/main.js +48 -32
  64. package/dist/cli/main.js.map +1 -1
  65. package/dist/cli/register-list-query.js +215 -213
  66. package/dist/cli/register-list-query.js.map +1 -1
  67. package/dist/cli/register-mutation.js +368 -368
  68. package/dist/cli/register-mutation.js.map +1 -1
  69. package/dist/cli/register-operations.js +303 -299
  70. package/dist/cli/register-operations.js.map +1 -1
  71. package/dist/cli/registration-helpers.d.ts +4 -0
  72. package/dist/cli/registration-helpers.js +51 -56
  73. package/dist/cli/registration-helpers.js.map +1 -1
  74. package/dist/cli-bundle/chunks/activity-IDS5GSYG.js +16 -0
  75. package/dist/cli-bundle/chunks/{activity-CUC4JY3U.js → activity-OENQCYZD.js} +9 -9
  76. package/dist/cli-bundle/chunks/{aggregate-SW5PNGCS.js → aggregate-EC4LWS3U.js} +8 -8
  77. package/dist/cli-bundle/chunks/{aggregate-DKUTRY6R.js → aggregate-RCB3QJJE.js} +8 -8
  78. package/dist/cli-bundle/chunks/{append-H32VOR2Y.js → append-ADBOI3A6.js} +8 -8
  79. package/dist/cli-bundle/chunks/{append-UBM632FK.js → append-XLEKVVWB.js} +8 -8
  80. package/dist/cli-bundle/chunks/{chunk-Q6NXOHS6.js → chunk-2LRMWMZ6.js} +7 -7
  81. package/dist/cli-bundle/chunks/{chunk-2227673O.js → chunk-2ONH3WG6.js} +32 -13
  82. package/dist/cli-bundle/chunks/{chunk-2227673O.js.map → chunk-2ONH3WG6.js.map} +1 -1
  83. package/dist/cli-bundle/chunks/{chunk-MNBPX5JS.js → chunk-2VK677OA.js} +72 -49
  84. package/dist/cli-bundle/chunks/chunk-2VK677OA.js.map +7 -0
  85. package/dist/cli-bundle/chunks/{chunk-KLXF7NCC.js → chunk-3C5T3ZEO.js} +2 -2
  86. package/dist/cli-bundle/chunks/{chunk-JMK5GCK2.js → chunk-3MLQZI3H.js} +2 -2
  87. package/dist/cli-bundle/chunks/{chunk-BTX5MIQF.js → chunk-4EVY7CQN.js} +2 -2
  88. package/dist/cli-bundle/chunks/{chunk-Q6K2OACU.js → chunk-4IW7STMB.js} +7 -7
  89. package/dist/cli-bundle/chunks/{chunk-6YCYF2AI.js → chunk-4KPQQ42D.js} +166 -110
  90. package/dist/cli-bundle/chunks/chunk-4KPQQ42D.js.map +1 -0
  91. package/dist/cli-bundle/chunks/{chunk-BVZZN2LH.js → chunk-4OXNQHKQ.js} +23 -17
  92. package/dist/cli-bundle/chunks/{chunk-BVZZN2LH.js.map → chunk-4OXNQHKQ.js.map} +2 -2
  93. package/dist/cli-bundle/chunks/{chunk-UWKEJMZU.js → chunk-4PJYRA3V.js} +31 -12
  94. package/dist/cli-bundle/chunks/{chunk-UWKEJMZU.js.map → chunk-4PJYRA3V.js.map} +3 -3
  95. package/dist/cli-bundle/chunks/{chunk-EMPGXBUF.js → chunk-4SHME4VR.js} +2 -2
  96. package/dist/cli-bundle/chunks/{chunk-6ITZLD4T.js → chunk-5FYY76HR.js} +28 -99
  97. package/dist/cli-bundle/chunks/chunk-5FYY76HR.js.map +7 -0
  98. package/dist/cli-bundle/chunks/{chunk-OTUJZKGI.js → chunk-6QY2NA2M.js} +24 -18
  99. package/dist/cli-bundle/chunks/{chunk-OTUJZKGI.js.map → chunk-6QY2NA2M.js.map} +1 -1
  100. package/dist/cli-bundle/chunks/{chunk-2KWL5NPW.js → chunk-6YB7HG2J.js} +2 -2
  101. package/dist/cli-bundle/chunks/{chunk-36UGKF4O.js → chunk-724VLYDJ.js} +2 -2
  102. package/dist/cli-bundle/chunks/{chunk-XCHUVHKU.js → chunk-75VMARGO.js} +11 -11
  103. package/dist/cli-bundle/chunks/chunk-75VMARGO.js.map +1 -0
  104. package/dist/cli-bundle/chunks/{chunk-XWGEMNBR.js → chunk-7745CXNI.js} +119 -195
  105. package/dist/cli-bundle/chunks/chunk-7745CXNI.js.map +7 -0
  106. package/dist/cli-bundle/chunks/{chunk-YPKFV2JR.js → chunk-7G5SUU6F.js} +76 -54
  107. package/dist/cli-bundle/chunks/chunk-7G5SUU6F.js.map +1 -0
  108. package/dist/cli-bundle/chunks/{chunk-Y4NRKBFW.js → chunk-7ITQSEBL.js} +3 -3
  109. package/dist/cli-bundle/chunks/{chunk-W47SML5B.js → chunk-A222YWOQ.js} +7 -7
  110. package/dist/cli-bundle/chunks/{chunk-3LCUASYG.js → chunk-A2W3XKAD.js} +2 -2
  111. package/dist/cli-bundle/chunks/{chunk-KN3URLKS.js → chunk-AOP2EMK3.js} +3 -3
  112. package/dist/cli-bundle/chunks/{chunk-RM37OPYK.js → chunk-AZMPKLIA.js} +72 -49
  113. package/dist/cli-bundle/chunks/chunk-AZMPKLIA.js.map +1 -0
  114. package/dist/cli-bundle/chunks/{chunk-7NSPKJUS.js → chunk-BDDYM4LH.js} +262 -252
  115. package/dist/cli-bundle/chunks/chunk-BDDYM4LH.js.map +7 -0
  116. package/dist/cli-bundle/chunks/{chunk-JXAUVO6X.js → chunk-CN4OAA2G.js} +55 -20
  117. package/dist/cli-bundle/chunks/chunk-CN4OAA2G.js.map +7 -0
  118. package/dist/cli-bundle/chunks/{chunk-IEEJQCZ4.js → chunk-CQFZRLXQ.js} +3 -3
  119. package/dist/cli-bundle/chunks/{chunk-4NUOWFBT.js → chunk-CQISNF3Z.js} +7 -7
  120. package/dist/cli-bundle/chunks/{chunk-S62UANU7.js → chunk-D2LDM35X.js} +3 -3
  121. package/dist/cli-bundle/chunks/{chunk-GRRG3MCT.js → chunk-DEIDJQZK.js} +57 -136
  122. package/dist/cli-bundle/chunks/chunk-DEIDJQZK.js.map +7 -0
  123. package/dist/cli-bundle/chunks/{chunk-IG5JYZGU.js → chunk-DJ5S2LDY.js} +7 -7
  124. package/dist/cli-bundle/chunks/{chunk-A6VOGKBA.js → chunk-EB4BBEZD.js} +6 -6
  125. package/dist/cli-bundle/chunks/{chunk-QH3FSKRJ.js → chunk-EH23N5FX.js} +2 -2
  126. package/dist/cli-bundle/chunks/{chunk-HQTPRV4D.js → chunk-FDNJMYZB.js} +6 -6
  127. package/dist/cli-bundle/chunks/{chunk-K2VYLVX4.js → chunk-FMWQRMHS.js} +33 -6
  128. package/dist/cli-bundle/chunks/chunk-FMWQRMHS.js.map +1 -0
  129. package/dist/cli-bundle/chunks/{chunk-N2JSWVWG.js → chunk-HL742IBM.js} +4 -4
  130. package/dist/cli-bundle/chunks/{chunk-3AZUFQK6.js → chunk-J4KNRDI3.js} +59 -70
  131. package/dist/cli-bundle/chunks/{chunk-3AZUFQK6.js.map → chunk-J4KNRDI3.js.map} +1 -1
  132. package/dist/cli-bundle/chunks/{chunk-66Z3X7ZG.js → chunk-JYLFF7GJ.js} +166 -110
  133. package/dist/cli-bundle/chunks/chunk-JYLFF7GJ.js.map +7 -0
  134. package/dist/cli-bundle/chunks/{chunk-GFMSLORL.js → chunk-JZJJEJBR.js} +75 -53
  135. package/dist/cli-bundle/chunks/chunk-JZJJEJBR.js.map +7 -0
  136. package/dist/cli-bundle/chunks/{chunk-7TH5NMVB.js → chunk-KKHIQOTN.js} +25 -19
  137. package/dist/cli-bundle/chunks/chunk-KKHIQOTN.js.map +7 -0
  138. package/dist/cli-bundle/chunks/{chunk-5GVTFFTC.js → chunk-LLQLLAKU.js} +118 -194
  139. package/dist/cli-bundle/chunks/chunk-LLQLLAKU.js.map +1 -0
  140. package/dist/cli-bundle/chunks/{chunk-KIYCOJ63.js → chunk-M34MVAOP.js} +58 -137
  141. package/dist/cli-bundle/chunks/chunk-M34MVAOP.js.map +1 -0
  142. package/dist/cli-bundle/chunks/{chunk-CZPVDLD2.js → chunk-M6PR5BC6.js} +7 -7
  143. package/dist/cli-bundle/chunks/{chunk-XEWQKDYZ.js → chunk-MTB4PRA3.js} +10 -10
  144. package/dist/cli-bundle/chunks/chunk-MTB4PRA3.js.map +7 -0
  145. package/dist/cli-bundle/chunks/{chunk-MRD4T5LF.js → chunk-MZ4NH46V.js} +2 -2
  146. package/dist/cli-bundle/chunks/{chunk-AIAIXG7I.js → chunk-MZG6I2Q2.js} +39 -5
  147. package/dist/cli-bundle/chunks/chunk-MZG6I2Q2.js.map +7 -0
  148. package/dist/cli-bundle/chunks/{chunk-ZNHEYCDD.js → chunk-N2LOJUBB.js} +2 -2
  149. package/dist/cli-bundle/chunks/{chunk-WJAMWAHZ.js → chunk-NGDK3KEZ.js} +5 -5
  150. package/dist/cli-bundle/chunks/{chunk-SYNKD3ZG.js → chunk-NHDR3UCW.js} +46 -60
  151. package/dist/cli-bundle/chunks/chunk-NHDR3UCW.js.map +7 -0
  152. package/dist/cli-bundle/chunks/{chunk-2CHRYUXL.js → chunk-NHKXOMZ5.js} +2 -2
  153. package/dist/cli-bundle/chunks/{chunk-7MYWF4ZX.js → chunk-OTSP6UEX.js} +7 -7
  154. package/dist/cli-bundle/chunks/{chunk-UGLU6Q2I.js → chunk-PUVPC5DL.js} +4 -4
  155. package/dist/cli-bundle/chunks/{chunk-LTRAF2D7.js → chunk-PV5JS7MP.js} +3 -3
  156. package/dist/cli-bundle/chunks/{chunk-KCO2EAN5.js → chunk-Q2266G4S.js} +3 -3
  157. package/dist/cli-bundle/chunks/{chunk-SYVUU7EK.js → chunk-Q3XVLRCJ.js} +9 -9
  158. package/dist/cli-bundle/chunks/{chunk-AJEBCRIY.js → chunk-QFXFKYNQ.js} +47 -61
  159. package/dist/cli-bundle/chunks/chunk-QFXFKYNQ.js.map +1 -0
  160. package/dist/cli-bundle/chunks/{chunk-6ZMBJRDJ.js → chunk-R7EMP4JG.js} +9 -9
  161. package/dist/cli-bundle/chunks/{chunk-SPM2XLWI.js → chunk-SBNT6SLO.js} +22 -7
  162. package/dist/cli-bundle/chunks/chunk-SBNT6SLO.js.map +7 -0
  163. package/dist/cli-bundle/chunks/{chunk-I66WE2HE.js → chunk-SL2ANJSV.js} +260 -250
  164. package/dist/cli-bundle/chunks/chunk-SL2ANJSV.js.map +1 -0
  165. package/dist/cli-bundle/chunks/{chunk-U2BEEM2X.js → chunk-T5RTYLZJ.js} +3 -3
  166. package/dist/cli-bundle/chunks/{chunk-UTSH5GWX.js → chunk-TGYDJEJH.js} +7 -7
  167. package/dist/cli-bundle/chunks/{chunk-H4GRLYJS.js → chunk-TO4KCIOT.js} +3 -3
  168. package/dist/cli-bundle/chunks/{chunk-EUKTMRN3.js → chunk-TUV7SIWZ.js} +2 -2
  169. package/dist/cli-bundle/chunks/{chunk-N3QCJS4M.js → chunk-UGDONITK.js} +58 -69
  170. package/dist/cli-bundle/chunks/{chunk-N3QCJS4M.js.map → chunk-UGDONITK.js.map} +2 -2
  171. package/dist/cli-bundle/chunks/{chunk-NRZS637N.js → chunk-UYLA5ROU.js} +56 -21
  172. package/dist/cli-bundle/chunks/chunk-UYLA5ROU.js.map +1 -0
  173. package/dist/cli-bundle/chunks/{chunk-55XRYWEG.js → chunk-V655JQ5J.js} +8 -8
  174. package/dist/cli-bundle/chunks/{chunk-3Q2HBMTI.js → chunk-W5X3AHJN.js} +2 -2
  175. package/dist/cli-bundle/chunks/{chunk-XTHQWXVC.js → chunk-WBWRQS32.js} +5 -5
  176. package/dist/cli-bundle/chunks/{chunk-UT73HUPC.js → chunk-WOOB7PV7.js} +3 -3
  177. package/dist/cli-bundle/chunks/{chunk-5PGBHRY3.js → chunk-WSDIALO4.js} +2 -2
  178. package/dist/cli-bundle/chunks/{chunk-LRKMWUUV.js → chunk-WTXDLBSZ.js} +2 -2
  179. package/dist/cli-bundle/chunks/{chunk-FFOQHGNH.js → chunk-XBIYI23P.js} +8 -8
  180. package/dist/cli-bundle/chunks/{chunk-7W4H4K26.js → chunk-XFO2NJY6.js} +29 -100
  181. package/dist/cli-bundle/chunks/chunk-XFO2NJY6.js.map +1 -0
  182. package/dist/cli-bundle/chunks/{chunk-TPOFWBMY.js → chunk-XQCWTSLO.js} +26 -20
  183. package/dist/cli-bundle/chunks/chunk-XQCWTSLO.js.map +1 -0
  184. package/dist/cli-bundle/chunks/{chunk-2ASNV4DH.js → chunk-Y2VSCQ77.js} +4 -4
  185. package/dist/cli-bundle/chunks/{chunk-ZNT7KEWE.js → chunk-YZR7UMZ6.js} +2 -2
  186. package/dist/cli-bundle/chunks/{chunk-YLZZ6T54.js → chunk-YZWXMDNH.js} +23 -8
  187. package/dist/cli-bundle/chunks/chunk-YZWXMDNH.js.map +1 -0
  188. package/dist/cli-bundle/chunks/{chunk-CYBDUHNO.js → chunk-ZIEGTQCY.js} +3 -3
  189. package/dist/cli-bundle/chunks/{chunk-TTHCEV5Q.js → chunk-ZZWMJVW2.js} +4 -4
  190. package/dist/cli-bundle/chunks/{claim-Z7MEQCBT.js → claim-D6L33A5Y.js} +8 -8
  191. package/dist/cli-bundle/chunks/{claim-SENTPZBN.js → claim-YAFUTPVK.js} +8 -8
  192. package/dist/cli-bundle/chunks/close-KLDLHAOP.js +14 -0
  193. package/dist/cli-bundle/chunks/{close-424MX4CU.js → close-TGYXG7TV.js} +7 -7
  194. package/dist/cli-bundle/chunks/{close-many-SWY34BII.js → close-many-4QSWKCRU.js} +119 -76
  195. package/dist/cli-bundle/chunks/close-many-4QSWKCRU.js.map +7 -0
  196. package/dist/cli-bundle/chunks/{close-many-2IV4J2TR.js → close-many-SNA6LNZH.js} +120 -77
  197. package/dist/cli-bundle/chunks/close-many-SNA6LNZH.js.map +1 -0
  198. package/dist/cli-bundle/chunks/{comments-4FGNTSNV.js → comments-QC6ARR5X.js} +9 -9
  199. package/dist/cli-bundle/chunks/{comments-7YS5MY5X.js → comments-ZHVYGUVC.js} +9 -9
  200. package/dist/cli-bundle/chunks/{config-G74GISC4.js → config-O6W2EU2G.js} +7 -7
  201. package/dist/cli-bundle/chunks/{config-BZJKK7FZ.js → config-XQRFJXJP.js} +7 -7
  202. package/dist/cli-bundle/chunks/{context-LHVKJSPJ.js → context-IHE3IXN5.js} +12 -12
  203. package/dist/cli-bundle/chunks/{context-ZQY54JNS.js → context-WSYWBEUL.js} +12 -12
  204. package/dist/cli-bundle/chunks/{contracts-FIZLMP7O.js → contracts-CVBINC7C.js} +3 -3
  205. package/dist/cli-bundle/chunks/{contracts-CP2EZJC7.js → contracts-NLCDIZAT.js} +3 -3
  206. package/dist/cli-bundle/chunks/{copy-TLW7JTQT.js → copy-7MUQC44A.js} +5 -5
  207. package/dist/cli-bundle/chunks/{copy-GYNQQPW2.js → copy-ANWXDJVC.js} +5 -5
  208. package/dist/cli-bundle/chunks/create-AJ6HUR5W.js +28 -0
  209. package/dist/cli-bundle/chunks/{create-VSKYSOCD.js → create-JIA2IFCO.js} +12 -12
  210. package/dist/cli-bundle/chunks/{delete-ANTOTI2I.js → delete-5OLYWQIC.js} +5 -5
  211. package/dist/cli-bundle/chunks/{delete-4W5JYCEG.js → delete-INHKCIRN.js} +5 -5
  212. package/dist/cli-bundle/chunks/{deps-HPPE6MJN.js → deps-CCSWGZW7.js} +5 -5
  213. package/dist/cli-bundle/chunks/{deps-ZQZN54EZ.js → deps-IYEID3QX.js} +5 -5
  214. package/dist/cli-bundle/chunks/{docs-XJNYBJGE.js → docs-3XZK22WF.js} +7 -7
  215. package/dist/cli-bundle/chunks/{docs-RPOVFMP3.js → docs-PKO7OEIM.js} +7 -7
  216. package/dist/cli-bundle/chunks/{eval-RFBI5FGS.js → eval-5XYP6NMY.js} +10 -10
  217. package/dist/cli-bundle/chunks/{eval-DM6JBZTS.js → eval-O4WGQYDI.js} +10 -10
  218. package/dist/cli-bundle/chunks/{extension-TTSEFQTS.js → extension-PVGRRZZG.js} +11 -11
  219. package/dist/cli-bundle/chunks/{extension-B3YY4WY5.js → extension-T7JNTAAA.js} +11 -11
  220. package/dist/cli-bundle/chunks/{files-5D65CHGE.js → files-7IU56S6R.js} +10 -10
  221. package/dist/cli-bundle/chunks/files-7IU56S6R.js.map +1 -0
  222. package/dist/cli-bundle/chunks/{files-GPIG77EN.js → files-W7HH5EOD.js} +9 -9
  223. package/dist/cli-bundle/chunks/{files-GPIG77EN.js.map → files-W7HH5EOD.js.map} +1 -1
  224. package/dist/cli-bundle/chunks/{focus-ZHN7WIGX.js → focus-6FA5KYRY.js} +6 -6
  225. package/dist/cli-bundle/chunks/{focus-C3PEJV2C.js → focus-CQ63JFDG.js} +6 -6
  226. package/dist/cli-bundle/chunks/{gc-D4JQ6OWN.js → gc-3BG67KTO.js} +3 -3
  227. package/dist/cli-bundle/chunks/{gc-VZIXDL32.js → gc-PEZYGNVB.js} +3 -3
  228. package/dist/cli-bundle/chunks/{get-GIBRUUOP.js → get-J6CSJ4SX.js} +10 -10
  229. package/dist/cli-bundle/chunks/{get-IOVAN6RU.js → get-KJTKGNEQ.js} +10 -10
  230. package/dist/cli-bundle/chunks/{health-L2U3AFKV.js → health-32UQICEL.js} +115 -123
  231. package/dist/cli-bundle/chunks/health-32UQICEL.js.map +1 -0
  232. package/dist/cli-bundle/chunks/{health-MM7AWXYF.js → health-ZUZG5ULV.js} +114 -122
  233. package/dist/cli-bundle/chunks/health-ZUZG5ULV.js.map +7 -0
  234. package/dist/cli-bundle/chunks/history-IOH6FKG7.js +18 -0
  235. package/dist/cli-bundle/chunks/{history-IL7XCEX2.js → history-W6QVR6FA.js} +8 -8
  236. package/dist/cli-bundle/chunks/{history-compact-HALOTOU7.js → history-compact-F355EGL4.js} +20 -27
  237. package/dist/cli-bundle/chunks/history-compact-F355EGL4.js.map +1 -0
  238. package/dist/cli-bundle/chunks/{history-compact-MV25P7DM.js → history-compact-JQ6ZGYSJ.js} +19 -26
  239. package/dist/cli-bundle/chunks/history-compact-JQ6ZGYSJ.js.map +7 -0
  240. package/dist/cli-bundle/chunks/{history-redact-VYCWQFK7.js → history-redact-TUWOUYX5.js} +9 -9
  241. package/dist/cli-bundle/chunks/history-redact-VVDOARNO.js +19 -0
  242. package/dist/cli-bundle/chunks/{history-repair-44MODPQF.js → history-repair-MPCAIKYE.js} +20 -28
  243. package/dist/cli-bundle/chunks/history-repair-MPCAIKYE.js.map +1 -0
  244. package/dist/cli-bundle/chunks/{history-repair-CPNAOCNF.js → history-repair-ZKS3LKPV.js} +19 -27
  245. package/dist/cli-bundle/chunks/history-repair-ZKS3LKPV.js.map +7 -0
  246. package/dist/cli-bundle/chunks/init-CZLEEE6Q.js +22 -0
  247. package/dist/cli-bundle/chunks/{init-F27NHENZ.js → init-MAA6UMNQ.js} +12 -12
  248. package/dist/cli-bundle/chunks/{learnings-XSFSUUWK.js → learnings-EYC3OKS2.js} +9 -9
  249. package/dist/cli-bundle/chunks/{learnings-HJVDQIGY.js → learnings-HKJJUVTA.js} +9 -9
  250. package/dist/cli-bundle/chunks/{list-VMPWTURB.js → list-HFD5737R.js} +8 -8
  251. package/dist/cli-bundle/chunks/{list-HPMEKCAA.js → list-KN3TL5Y5.js} +8 -8
  252. package/dist/cli-bundle/chunks/{next-ETXF2ZCN.js → next-DQUMFAHG.js} +25 -22
  253. package/dist/cli-bundle/chunks/{next-ETXF2ZCN.js.map → next-DQUMFAHG.js.map} +2 -2
  254. package/dist/cli-bundle/chunks/{next-QM6YJIIS.js → next-JUEYC5HE.js} +26 -23
  255. package/dist/cli-bundle/chunks/next-JUEYC5HE.js.map +1 -0
  256. package/dist/cli-bundle/chunks/{notes-WDDBPC4D.js → notes-XATYT43P.js} +9 -9
  257. package/dist/cli-bundle/chunks/{notes-GDZIKGR6.js → notes-ZG6RLZXB.js} +9 -9
  258. package/dist/cli-bundle/chunks/{plan-BGDR73Z6.js → plan-5NWQL2DH.js} +12 -12
  259. package/dist/cli-bundle/chunks/{plan-C5IMM335.js → plan-DVVLX7LK.js} +12 -12
  260. package/dist/cli-bundle/chunks/{profile-CCOKZ2IQ.js → profile-54DZ4CLB.js} +27 -19
  261. package/dist/cli-bundle/chunks/profile-54DZ4CLB.js.map +1 -0
  262. package/dist/cli-bundle/chunks/{profile-HUCENIEQ.js → profile-PLIQVEOY.js} +26 -18
  263. package/dist/cli-bundle/chunks/profile-PLIQVEOY.js.map +7 -0
  264. package/dist/cli-bundle/chunks/{register-list-query-ROSNIL52.js → register-list-query-PNRAHNIQ.js} +181 -172
  265. package/dist/cli-bundle/chunks/register-list-query-PNRAHNIQ.js.map +1 -0
  266. package/dist/cli-bundle/chunks/{register-list-query-XN4ZRHSV.js → register-list-query-WRS6ACUW.js} +180 -171
  267. package/dist/cli-bundle/chunks/register-list-query-WRS6ACUW.js.map +7 -0
  268. package/dist/cli-bundle/chunks/{register-mutation-KRLAHEL2.js → register-mutation-ET6E4VLE.js} +367 -361
  269. package/dist/cli-bundle/chunks/register-mutation-ET6E4VLE.js.map +7 -0
  270. package/dist/cli-bundle/chunks/{register-mutation-CFSB2MS3.js → register-mutation-K2MNRWGI.js} +368 -362
  271. package/dist/cli-bundle/chunks/register-mutation-K2MNRWGI.js.map +1 -0
  272. package/dist/cli-bundle/chunks/{register-operations-MBN4KGUM.js → register-operations-6DQRUTIX.js} +310 -305
  273. package/dist/cli-bundle/chunks/register-operations-6DQRUTIX.js.map +1 -0
  274. package/dist/cli-bundle/chunks/{register-operations-4PASGJDB.js → register-operations-73UDWMVB.js} +309 -304
  275. package/dist/cli-bundle/chunks/register-operations-73UDWMVB.js.map +7 -0
  276. package/dist/cli-bundle/chunks/{register-setup-ZCGKHDKL.js → register-setup-FXZJ2CEJ.js} +15 -15
  277. package/dist/cli-bundle/chunks/{register-setup-VIAWYFP5.js → register-setup-LYYCMQFV.js} +15 -15
  278. package/dist/cli-bundle/chunks/restore-L27TMMCF.js +17 -0
  279. package/dist/cli-bundle/chunks/{restore-4CBWUMCX.js → restore-R6YJHQK3.js} +9 -9
  280. package/dist/cli-bundle/chunks/{scheduling-shortcuts-6VFKNKCM.js → scheduling-shortcuts-LE4S7OI7.js} +12 -12
  281. package/dist/cli-bundle/chunks/{scheduling-shortcuts-ERHCVTEM.js → scheduling-shortcuts-OGODPUBL.js} +12 -12
  282. package/dist/cli-bundle/chunks/{schema-UE5KKAUX.js → schema-ICCD3HOP.js} +7 -7
  283. package/dist/cli-bundle/chunks/{schema-TDGK6N3I.js → schema-RHH23PQX.js} +7 -7
  284. package/dist/cli-bundle/chunks/{search-FP7MEU4S.js → search-HDDKOPFE.js} +10 -10
  285. package/dist/cli-bundle/chunks/{search-K4CFLQ5S.js → search-Z2VGP2Q5.js} +10 -10
  286. package/dist/cli-bundle/chunks/{stats-NJJCALEZ.js → stats-DHMRXHOB.js} +6 -6
  287. package/dist/cli-bundle/chunks/{stats-XT6QRKQY.js → stats-ETFP37MB.js} +6 -6
  288. package/dist/cli-bundle/chunks/{telemetry-HVXFZA2U.js → telemetry-NUZNKDCP.js} +4 -4
  289. package/dist/cli-bundle/chunks/{telemetry-5SQ5UDXC.js → telemetry-ZRBM22QD.js} +4 -4
  290. package/dist/cli-bundle/chunks/{test-UFSJ5YIO.js → test-H36PM746.js} +15 -15
  291. package/dist/cli-bundle/chunks/{test-YCDAUBWF.js → test-XNKTIP4Y.js} +15 -15
  292. package/dist/cli-bundle/chunks/{test-all-2BWKY3GQ.js → test-all-APCBSXQI.js} +17 -17
  293. package/dist/cli-bundle/chunks/{test-all-PM7UYN42.js → test-all-KIK3OYBY.js} +17 -17
  294. package/dist/cli-bundle/chunks/{test-runs-H4TGWGRN.js → test-runs-5SLLV3XU.js} +4 -4
  295. package/dist/cli-bundle/chunks/{test-runs-FK5E75AA.js → test-runs-L3WKLO67.js} +4 -4
  296. package/dist/cli-bundle/chunks/update-RQKI3AMW.js +24 -0
  297. package/dist/cli-bundle/chunks/{update-Y5WQVT5O.js → update-ZM7NJWHY.js} +15 -15
  298. package/dist/cli-bundle/chunks/{update-many-JTKKSA7Y.js → update-many-GFCQG6ZQ.js} +28 -28
  299. package/dist/cli-bundle/chunks/{update-many-6YAYYRLE.js → update-many-XGTJ7QIU.js} +28 -28
  300. package/dist/cli-bundle/chunks/{upgrade-DTAHZ236.js → upgrade-KJ3JGELR.js} +11 -11
  301. package/dist/cli-bundle/chunks/{upgrade-JUDU7YL4.js → upgrade-RBRQ7PQU.js} +11 -11
  302. package/dist/cli-bundle/chunks/{validate-732RWS5W.js → validate-EW6TGC7R.js} +31 -21
  303. package/dist/cli-bundle/chunks/validate-EW6TGC7R.js.map +7 -0
  304. package/dist/cli-bundle/chunks/{validate-W7H5TEDC.js → validate-T6PR5WAL.js} +32 -22
  305. package/dist/cli-bundle/chunks/validate-T6PR5WAL.js.map +1 -0
  306. package/dist/cli-bundle/main.js +180 -122
  307. package/dist/cli-bundle/main.js.map +3 -3
  308. package/dist/core/extensions/extension-types.d.ts +1 -2
  309. package/dist/core/extensions/extension-types.js +2 -2
  310. package/dist/core/extensions/extension-types.js.map +1 -1
  311. package/dist/core/history/history-rewrite.d.ts +10 -0
  312. package/dist/core/history/history-rewrite.js +27 -3
  313. package/dist/core/history/history-rewrite.js.map +1 -1
  314. package/dist/core/item/type-registry.d.ts +1 -0
  315. package/dist/core/item/type-registry.js +180 -194
  316. package/dist/core/item/type-registry.js.map +1 -1
  317. package/dist/core/schema/runtime-schema.js +65 -54
  318. package/dist/core/schema/runtime-schema.js.map +1 -1
  319. package/dist/core/schema/status-defs-file.js +26 -3
  320. package/dist/core/schema/status-defs-file.js.map +1 -1
  321. package/dist/core/search/corpus.js +25 -19
  322. package/dist/core/search/corpus.js.map +1 -1
  323. package/dist/core/shared/memo.d.ts +12 -0
  324. package/dist/core/shared/memo.js +25 -0
  325. package/dist/core/shared/memo.js.map +1 -0
  326. package/dist/core/shared/serialization.js +24 -14
  327. package/dist/core/shared/serialization.js.map +1 -1
  328. package/dist/core/shared/time.js +26 -4
  329. package/dist/core/shared/time.js.map +1 -1
  330. package/dist/core/store/front-matter-cache.d.ts +5 -0
  331. package/dist/core/store/front-matter-cache.js +79 -20
  332. package/dist/core/store/front-matter-cache.js.map +1 -1
  333. package/dist/sdk/cli-contracts/flag-contracts.js +73 -99
  334. package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
  335. package/dist/sdk/cli-contracts/tool-option-contracts.js +4 -2
  336. package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
  337. package/dist/sdk/cli-contracts/tool-schema.js +55 -94
  338. package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
  339. package/dist/sdk/compose.js +51 -42
  340. package/dist/sdk/compose.js.map +1 -1
  341. package/dist/sdk/package-import-adapters.d.ts +90 -2
  342. package/dist/sdk/package-import-adapters.js +274 -2
  343. package/dist/sdk/package-import-adapters.js.map +1 -1
  344. package/dist/sdk/runtime.d.ts +1 -1
  345. package/dist/sdk/runtime.js +3 -3
  346. package/dist/sdk/runtime.js.map +1 -1
  347. package/docs/AGENT_GUIDE.md +2 -2
  348. package/docs/ARCHITECTURE.md +2 -2
  349. package/docs/COMMANDS.md +8 -4
  350. package/docs/CONFIGURATION.md +1 -1
  351. package/docs/EXTENSIONS.md +12 -12
  352. package/docs/ONBOARDING.md +4 -2
  353. package/docs/README.md +2 -0
  354. package/docs/examples/starter-extension/README.md +11 -10
  355. package/marketplace.json +3 -3
  356. package/package.json +4 -3
  357. package/packages/pm-beads/extensions/beads/runtime-loader.ts +27 -40
  358. package/packages/pm-beads/extensions/beads/runtime.ts +106 -223
  359. package/packages/pm-calendar/extensions/calendar/runtime.ts +21 -18
  360. package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +9 -11
  361. package/packages/pm-todos/extensions/todos/runtime-loader.ts +48 -76
  362. package/packages/pm-todos/extensions/todos/runtime.ts +61 -257
  363. package/plugins/pm-claude/.claude-plugin/plugin.json +2 -2
  364. package/plugins/pm-claude/README.md +6 -3
  365. package/plugins/pm-claude/commands/pm-init.md +1 -1
  366. package/plugins/pm-claude/scripts/pm-mcp-server.mjs +73 -31
  367. package/plugins/pm-codex/scripts/pm-mcp-server.mjs +80 -34
  368. package/scripts/install.ps1 +7 -7
  369. package/dist/cli-bundle/chunks/activity-WEIEMM73.js +0 -16
  370. package/dist/cli-bundle/chunks/chunk-5GVTFFTC.js.map +0 -1
  371. package/dist/cli-bundle/chunks/chunk-66Z3X7ZG.js.map +0 -7
  372. package/dist/cli-bundle/chunks/chunk-6ITZLD4T.js.map +0 -7
  373. package/dist/cli-bundle/chunks/chunk-6YCYF2AI.js.map +0 -1
  374. package/dist/cli-bundle/chunks/chunk-7NSPKJUS.js.map +0 -7
  375. package/dist/cli-bundle/chunks/chunk-7TH5NMVB.js.map +0 -7
  376. package/dist/cli-bundle/chunks/chunk-7W4H4K26.js.map +0 -1
  377. package/dist/cli-bundle/chunks/chunk-AIAIXG7I.js.map +0 -7
  378. package/dist/cli-bundle/chunks/chunk-AJEBCRIY.js.map +0 -1
  379. package/dist/cli-bundle/chunks/chunk-GFMSLORL.js.map +0 -7
  380. package/dist/cli-bundle/chunks/chunk-GRRG3MCT.js.map +0 -7
  381. package/dist/cli-bundle/chunks/chunk-I66WE2HE.js.map +0 -1
  382. package/dist/cli-bundle/chunks/chunk-JXAUVO6X.js.map +0 -7
  383. package/dist/cli-bundle/chunks/chunk-K2VYLVX4.js.map +0 -1
  384. package/dist/cli-bundle/chunks/chunk-KIYCOJ63.js.map +0 -1
  385. package/dist/cli-bundle/chunks/chunk-MNBPX5JS.js.map +0 -7
  386. package/dist/cli-bundle/chunks/chunk-NRZS637N.js.map +0 -1
  387. package/dist/cli-bundle/chunks/chunk-RM37OPYK.js.map +0 -1
  388. package/dist/cli-bundle/chunks/chunk-SPM2XLWI.js.map +0 -7
  389. package/dist/cli-bundle/chunks/chunk-SYNKD3ZG.js.map +0 -7
  390. package/dist/cli-bundle/chunks/chunk-TPOFWBMY.js.map +0 -1
  391. package/dist/cli-bundle/chunks/chunk-XCHUVHKU.js.map +0 -1
  392. package/dist/cli-bundle/chunks/chunk-XEWQKDYZ.js.map +0 -7
  393. package/dist/cli-bundle/chunks/chunk-XWGEMNBR.js.map +0 -7
  394. package/dist/cli-bundle/chunks/chunk-YLZZ6T54.js.map +0 -1
  395. package/dist/cli-bundle/chunks/chunk-YPKFV2JR.js.map +0 -1
  396. package/dist/cli-bundle/chunks/close-YCWQQPDS.js +0 -14
  397. package/dist/cli-bundle/chunks/close-many-2IV4J2TR.js.map +0 -1
  398. package/dist/cli-bundle/chunks/close-many-SWY34BII.js.map +0 -7
  399. package/dist/cli-bundle/chunks/create-XTMAPS7I.js +0 -28
  400. package/dist/cli-bundle/chunks/files-5D65CHGE.js.map +0 -1
  401. package/dist/cli-bundle/chunks/health-L2U3AFKV.js.map +0 -1
  402. package/dist/cli-bundle/chunks/health-MM7AWXYF.js.map +0 -7
  403. package/dist/cli-bundle/chunks/history-DD7L7BNL.js +0 -18
  404. package/dist/cli-bundle/chunks/history-compact-HALOTOU7.js.map +0 -1
  405. package/dist/cli-bundle/chunks/history-compact-MV25P7DM.js.map +0 -7
  406. package/dist/cli-bundle/chunks/history-redact-IX4YEWMY.js +0 -19
  407. package/dist/cli-bundle/chunks/history-repair-44MODPQF.js.map +0 -1
  408. package/dist/cli-bundle/chunks/history-repair-CPNAOCNF.js.map +0 -7
  409. package/dist/cli-bundle/chunks/init-HHVQQP6C.js +0 -22
  410. package/dist/cli-bundle/chunks/next-QM6YJIIS.js.map +0 -1
  411. package/dist/cli-bundle/chunks/profile-CCOKZ2IQ.js.map +0 -1
  412. package/dist/cli-bundle/chunks/profile-HUCENIEQ.js.map +0 -7
  413. package/dist/cli-bundle/chunks/register-list-query-ROSNIL52.js.map +0 -1
  414. package/dist/cli-bundle/chunks/register-list-query-XN4ZRHSV.js.map +0 -7
  415. package/dist/cli-bundle/chunks/register-mutation-CFSB2MS3.js.map +0 -1
  416. package/dist/cli-bundle/chunks/register-mutation-KRLAHEL2.js.map +0 -7
  417. package/dist/cli-bundle/chunks/register-operations-4PASGJDB.js.map +0 -7
  418. package/dist/cli-bundle/chunks/register-operations-MBN4KGUM.js.map +0 -1
  419. package/dist/cli-bundle/chunks/restore-5UEAGG3W.js +0 -17
  420. package/dist/cli-bundle/chunks/update-MTCFES6X.js +0 -24
  421. package/dist/cli-bundle/chunks/validate-732RWS5W.js.map +0 -7
  422. package/dist/cli-bundle/chunks/validate-W7H5TEDC.js.map +0 -1
  423. /package/dist/cli-bundle/chunks/{activity-WEIEMM73.js.map → activity-IDS5GSYG.js.map} +0 -0
  424. /package/dist/cli-bundle/chunks/{activity-CUC4JY3U.js.map → activity-OENQCYZD.js.map} +0 -0
  425. /package/dist/cli-bundle/chunks/{aggregate-SW5PNGCS.js.map → aggregate-EC4LWS3U.js.map} +0 -0
  426. /package/dist/cli-bundle/chunks/{aggregate-DKUTRY6R.js.map → aggregate-RCB3QJJE.js.map} +0 -0
  427. /package/dist/cli-bundle/chunks/{append-H32VOR2Y.js.map → append-ADBOI3A6.js.map} +0 -0
  428. /package/dist/cli-bundle/chunks/{append-UBM632FK.js.map → append-XLEKVVWB.js.map} +0 -0
  429. /package/dist/cli-bundle/chunks/{chunk-Q6NXOHS6.js.map → chunk-2LRMWMZ6.js.map} +0 -0
  430. /package/dist/cli-bundle/chunks/{chunk-KLXF7NCC.js.map → chunk-3C5T3ZEO.js.map} +0 -0
  431. /package/dist/cli-bundle/chunks/{chunk-JMK5GCK2.js.map → chunk-3MLQZI3H.js.map} +0 -0
  432. /package/dist/cli-bundle/chunks/{chunk-BTX5MIQF.js.map → chunk-4EVY7CQN.js.map} +0 -0
  433. /package/dist/cli-bundle/chunks/{chunk-Q6K2OACU.js.map → chunk-4IW7STMB.js.map} +0 -0
  434. /package/dist/cli-bundle/chunks/{chunk-EMPGXBUF.js.map → chunk-4SHME4VR.js.map} +0 -0
  435. /package/dist/cli-bundle/chunks/{chunk-2KWL5NPW.js.map → chunk-6YB7HG2J.js.map} +0 -0
  436. /package/dist/cli-bundle/chunks/{chunk-36UGKF4O.js.map → chunk-724VLYDJ.js.map} +0 -0
  437. /package/dist/cli-bundle/chunks/{chunk-Y4NRKBFW.js.map → chunk-7ITQSEBL.js.map} +0 -0
  438. /package/dist/cli-bundle/chunks/{chunk-W47SML5B.js.map → chunk-A222YWOQ.js.map} +0 -0
  439. /package/dist/cli-bundle/chunks/{chunk-3LCUASYG.js.map → chunk-A2W3XKAD.js.map} +0 -0
  440. /package/dist/cli-bundle/chunks/{chunk-KN3URLKS.js.map → chunk-AOP2EMK3.js.map} +0 -0
  441. /package/dist/cli-bundle/chunks/{chunk-IEEJQCZ4.js.map → chunk-CQFZRLXQ.js.map} +0 -0
  442. /package/dist/cli-bundle/chunks/{chunk-4NUOWFBT.js.map → chunk-CQISNF3Z.js.map} +0 -0
  443. /package/dist/cli-bundle/chunks/{chunk-S62UANU7.js.map → chunk-D2LDM35X.js.map} +0 -0
  444. /package/dist/cli-bundle/chunks/{chunk-IG5JYZGU.js.map → chunk-DJ5S2LDY.js.map} +0 -0
  445. /package/dist/cli-bundle/chunks/{chunk-A6VOGKBA.js.map → chunk-EB4BBEZD.js.map} +0 -0
  446. /package/dist/cli-bundle/chunks/{chunk-QH3FSKRJ.js.map → chunk-EH23N5FX.js.map} +0 -0
  447. /package/dist/cli-bundle/chunks/{chunk-HQTPRV4D.js.map → chunk-FDNJMYZB.js.map} +0 -0
  448. /package/dist/cli-bundle/chunks/{chunk-N2JSWVWG.js.map → chunk-HL742IBM.js.map} +0 -0
  449. /package/dist/cli-bundle/chunks/{chunk-CZPVDLD2.js.map → chunk-M6PR5BC6.js.map} +0 -0
  450. /package/dist/cli-bundle/chunks/{chunk-MRD4T5LF.js.map → chunk-MZ4NH46V.js.map} +0 -0
  451. /package/dist/cli-bundle/chunks/{chunk-ZNHEYCDD.js.map → chunk-N2LOJUBB.js.map} +0 -0
  452. /package/dist/cli-bundle/chunks/{chunk-WJAMWAHZ.js.map → chunk-NGDK3KEZ.js.map} +0 -0
  453. /package/dist/cli-bundle/chunks/{chunk-2CHRYUXL.js.map → chunk-NHKXOMZ5.js.map} +0 -0
  454. /package/dist/cli-bundle/chunks/{chunk-7MYWF4ZX.js.map → chunk-OTSP6UEX.js.map} +0 -0
  455. /package/dist/cli-bundle/chunks/{chunk-UGLU6Q2I.js.map → chunk-PUVPC5DL.js.map} +0 -0
  456. /package/dist/cli-bundle/chunks/{chunk-LTRAF2D7.js.map → chunk-PV5JS7MP.js.map} +0 -0
  457. /package/dist/cli-bundle/chunks/{chunk-KCO2EAN5.js.map → chunk-Q2266G4S.js.map} +0 -0
  458. /package/dist/cli-bundle/chunks/{chunk-SYVUU7EK.js.map → chunk-Q3XVLRCJ.js.map} +0 -0
  459. /package/dist/cli-bundle/chunks/{chunk-6ZMBJRDJ.js.map → chunk-R7EMP4JG.js.map} +0 -0
  460. /package/dist/cli-bundle/chunks/{chunk-U2BEEM2X.js.map → chunk-T5RTYLZJ.js.map} +0 -0
  461. /package/dist/cli-bundle/chunks/{chunk-UTSH5GWX.js.map → chunk-TGYDJEJH.js.map} +0 -0
  462. /package/dist/cli-bundle/chunks/{chunk-H4GRLYJS.js.map → chunk-TO4KCIOT.js.map} +0 -0
  463. /package/dist/cli-bundle/chunks/{chunk-EUKTMRN3.js.map → chunk-TUV7SIWZ.js.map} +0 -0
  464. /package/dist/cli-bundle/chunks/{chunk-55XRYWEG.js.map → chunk-V655JQ5J.js.map} +0 -0
  465. /package/dist/cli-bundle/chunks/{chunk-3Q2HBMTI.js.map → chunk-W5X3AHJN.js.map} +0 -0
  466. /package/dist/cli-bundle/chunks/{chunk-XTHQWXVC.js.map → chunk-WBWRQS32.js.map} +0 -0
  467. /package/dist/cli-bundle/chunks/{chunk-UT73HUPC.js.map → chunk-WOOB7PV7.js.map} +0 -0
  468. /package/dist/cli-bundle/chunks/{chunk-5PGBHRY3.js.map → chunk-WSDIALO4.js.map} +0 -0
  469. /package/dist/cli-bundle/chunks/{chunk-LRKMWUUV.js.map → chunk-WTXDLBSZ.js.map} +0 -0
  470. /package/dist/cli-bundle/chunks/{chunk-FFOQHGNH.js.map → chunk-XBIYI23P.js.map} +0 -0
  471. /package/dist/cli-bundle/chunks/{chunk-2ASNV4DH.js.map → chunk-Y2VSCQ77.js.map} +0 -0
  472. /package/dist/cli-bundle/chunks/{chunk-ZNT7KEWE.js.map → chunk-YZR7UMZ6.js.map} +0 -0
  473. /package/dist/cli-bundle/chunks/{chunk-CYBDUHNO.js.map → chunk-ZIEGTQCY.js.map} +0 -0
  474. /package/dist/cli-bundle/chunks/{chunk-TTHCEV5Q.js.map → chunk-ZZWMJVW2.js.map} +0 -0
  475. /package/dist/cli-bundle/chunks/{claim-Z7MEQCBT.js.map → claim-D6L33A5Y.js.map} +0 -0
  476. /package/dist/cli-bundle/chunks/{claim-SENTPZBN.js.map → claim-YAFUTPVK.js.map} +0 -0
  477. /package/dist/cli-bundle/chunks/{close-YCWQQPDS.js.map → close-KLDLHAOP.js.map} +0 -0
  478. /package/dist/cli-bundle/chunks/{close-424MX4CU.js.map → close-TGYXG7TV.js.map} +0 -0
  479. /package/dist/cli-bundle/chunks/{comments-4FGNTSNV.js.map → comments-QC6ARR5X.js.map} +0 -0
  480. /package/dist/cli-bundle/chunks/{comments-7YS5MY5X.js.map → comments-ZHVYGUVC.js.map} +0 -0
  481. /package/dist/cli-bundle/chunks/{config-G74GISC4.js.map → config-O6W2EU2G.js.map} +0 -0
  482. /package/dist/cli-bundle/chunks/{config-BZJKK7FZ.js.map → config-XQRFJXJP.js.map} +0 -0
  483. /package/dist/cli-bundle/chunks/{context-LHVKJSPJ.js.map → context-IHE3IXN5.js.map} +0 -0
  484. /package/dist/cli-bundle/chunks/{context-ZQY54JNS.js.map → context-WSYWBEUL.js.map} +0 -0
  485. /package/dist/cli-bundle/chunks/{contracts-FIZLMP7O.js.map → contracts-CVBINC7C.js.map} +0 -0
  486. /package/dist/cli-bundle/chunks/{contracts-CP2EZJC7.js.map → contracts-NLCDIZAT.js.map} +0 -0
  487. /package/dist/cli-bundle/chunks/{copy-TLW7JTQT.js.map → copy-7MUQC44A.js.map} +0 -0
  488. /package/dist/cli-bundle/chunks/{copy-GYNQQPW2.js.map → copy-ANWXDJVC.js.map} +0 -0
  489. /package/dist/cli-bundle/chunks/{create-XTMAPS7I.js.map → create-AJ6HUR5W.js.map} +0 -0
  490. /package/dist/cli-bundle/chunks/{create-VSKYSOCD.js.map → create-JIA2IFCO.js.map} +0 -0
  491. /package/dist/cli-bundle/chunks/{delete-ANTOTI2I.js.map → delete-5OLYWQIC.js.map} +0 -0
  492. /package/dist/cli-bundle/chunks/{delete-4W5JYCEG.js.map → delete-INHKCIRN.js.map} +0 -0
  493. /package/dist/cli-bundle/chunks/{deps-HPPE6MJN.js.map → deps-CCSWGZW7.js.map} +0 -0
  494. /package/dist/cli-bundle/chunks/{deps-ZQZN54EZ.js.map → deps-IYEID3QX.js.map} +0 -0
  495. /package/dist/cli-bundle/chunks/{docs-XJNYBJGE.js.map → docs-3XZK22WF.js.map} +0 -0
  496. /package/dist/cli-bundle/chunks/{docs-RPOVFMP3.js.map → docs-PKO7OEIM.js.map} +0 -0
  497. /package/dist/cli-bundle/chunks/{eval-RFBI5FGS.js.map → eval-5XYP6NMY.js.map} +0 -0
  498. /package/dist/cli-bundle/chunks/{eval-DM6JBZTS.js.map → eval-O4WGQYDI.js.map} +0 -0
  499. /package/dist/cli-bundle/chunks/{extension-TTSEFQTS.js.map → extension-PVGRRZZG.js.map} +0 -0
  500. /package/dist/cli-bundle/chunks/{extension-B3YY4WY5.js.map → extension-T7JNTAAA.js.map} +0 -0
  501. /package/dist/cli-bundle/chunks/{focus-ZHN7WIGX.js.map → focus-6FA5KYRY.js.map} +0 -0
  502. /package/dist/cli-bundle/chunks/{focus-C3PEJV2C.js.map → focus-CQ63JFDG.js.map} +0 -0
  503. /package/dist/cli-bundle/chunks/{gc-D4JQ6OWN.js.map → gc-3BG67KTO.js.map} +0 -0
  504. /package/dist/cli-bundle/chunks/{gc-VZIXDL32.js.map → gc-PEZYGNVB.js.map} +0 -0
  505. /package/dist/cli-bundle/chunks/{get-GIBRUUOP.js.map → get-J6CSJ4SX.js.map} +0 -0
  506. /package/dist/cli-bundle/chunks/{get-IOVAN6RU.js.map → get-KJTKGNEQ.js.map} +0 -0
  507. /package/dist/cli-bundle/chunks/{history-DD7L7BNL.js.map → history-IOH6FKG7.js.map} +0 -0
  508. /package/dist/cli-bundle/chunks/{history-IL7XCEX2.js.map → history-W6QVR6FA.js.map} +0 -0
  509. /package/dist/cli-bundle/chunks/{history-redact-VYCWQFK7.js.map → history-redact-TUWOUYX5.js.map} +0 -0
  510. /package/dist/cli-bundle/chunks/{history-redact-IX4YEWMY.js.map → history-redact-VVDOARNO.js.map} +0 -0
  511. /package/dist/cli-bundle/chunks/{init-HHVQQP6C.js.map → init-CZLEEE6Q.js.map} +0 -0
  512. /package/dist/cli-bundle/chunks/{init-F27NHENZ.js.map → init-MAA6UMNQ.js.map} +0 -0
  513. /package/dist/cli-bundle/chunks/{learnings-XSFSUUWK.js.map → learnings-EYC3OKS2.js.map} +0 -0
  514. /package/dist/cli-bundle/chunks/{learnings-HJVDQIGY.js.map → learnings-HKJJUVTA.js.map} +0 -0
  515. /package/dist/cli-bundle/chunks/{list-VMPWTURB.js.map → list-HFD5737R.js.map} +0 -0
  516. /package/dist/cli-bundle/chunks/{list-HPMEKCAA.js.map → list-KN3TL5Y5.js.map} +0 -0
  517. /package/dist/cli-bundle/chunks/{notes-WDDBPC4D.js.map → notes-XATYT43P.js.map} +0 -0
  518. /package/dist/cli-bundle/chunks/{notes-GDZIKGR6.js.map → notes-ZG6RLZXB.js.map} +0 -0
  519. /package/dist/cli-bundle/chunks/{plan-BGDR73Z6.js.map → plan-5NWQL2DH.js.map} +0 -0
  520. /package/dist/cli-bundle/chunks/{plan-C5IMM335.js.map → plan-DVVLX7LK.js.map} +0 -0
  521. /package/dist/cli-bundle/chunks/{register-setup-ZCGKHDKL.js.map → register-setup-FXZJ2CEJ.js.map} +0 -0
  522. /package/dist/cli-bundle/chunks/{register-setup-VIAWYFP5.js.map → register-setup-LYYCMQFV.js.map} +0 -0
  523. /package/dist/cli-bundle/chunks/{restore-5UEAGG3W.js.map → restore-L27TMMCF.js.map} +0 -0
  524. /package/dist/cli-bundle/chunks/{restore-4CBWUMCX.js.map → restore-R6YJHQK3.js.map} +0 -0
  525. /package/dist/cli-bundle/chunks/{scheduling-shortcuts-6VFKNKCM.js.map → scheduling-shortcuts-LE4S7OI7.js.map} +0 -0
  526. /package/dist/cli-bundle/chunks/{scheduling-shortcuts-ERHCVTEM.js.map → scheduling-shortcuts-OGODPUBL.js.map} +0 -0
  527. /package/dist/cli-bundle/chunks/{schema-UE5KKAUX.js.map → schema-ICCD3HOP.js.map} +0 -0
  528. /package/dist/cli-bundle/chunks/{schema-TDGK6N3I.js.map → schema-RHH23PQX.js.map} +0 -0
  529. /package/dist/cli-bundle/chunks/{search-FP7MEU4S.js.map → search-HDDKOPFE.js.map} +0 -0
  530. /package/dist/cli-bundle/chunks/{search-K4CFLQ5S.js.map → search-Z2VGP2Q5.js.map} +0 -0
  531. /package/dist/cli-bundle/chunks/{stats-NJJCALEZ.js.map → stats-DHMRXHOB.js.map} +0 -0
  532. /package/dist/cli-bundle/chunks/{stats-XT6QRKQY.js.map → stats-ETFP37MB.js.map} +0 -0
  533. /package/dist/cli-bundle/chunks/{telemetry-HVXFZA2U.js.map → telemetry-NUZNKDCP.js.map} +0 -0
  534. /package/dist/cli-bundle/chunks/{telemetry-5SQ5UDXC.js.map → telemetry-ZRBM22QD.js.map} +0 -0
  535. /package/dist/cli-bundle/chunks/{test-UFSJ5YIO.js.map → test-H36PM746.js.map} +0 -0
  536. /package/dist/cli-bundle/chunks/{test-YCDAUBWF.js.map → test-XNKTIP4Y.js.map} +0 -0
  537. /package/dist/cli-bundle/chunks/{test-all-2BWKY3GQ.js.map → test-all-APCBSXQI.js.map} +0 -0
  538. /package/dist/cli-bundle/chunks/{test-all-PM7UYN42.js.map → test-all-KIK3OYBY.js.map} +0 -0
  539. /package/dist/cli-bundle/chunks/{test-runs-H4TGWGRN.js.map → test-runs-5SLLV3XU.js.map} +0 -0
  540. /package/dist/cli-bundle/chunks/{test-runs-FK5E75AA.js.map → test-runs-L3WKLO67.js.map} +0 -0
  541. /package/dist/cli-bundle/chunks/{update-MTCFES6X.js.map → update-RQKI3AMW.js.map} +0 -0
  542. /package/dist/cli-bundle/chunks/{update-Y5WQVT5O.js.map → update-ZM7NJWHY.js.map} +0 -0
  543. /package/dist/cli-bundle/chunks/{update-many-JTKKSA7Y.js.map → update-many-GFCQG6ZQ.js.map} +0 -0
  544. /package/dist/cli-bundle/chunks/{update-many-6YAYYRLE.js.map → update-many-XGTJ7QIU.js.map} +0 -0
  545. /package/dist/cli-bundle/chunks/{upgrade-DTAHZ236.js.map → upgrade-KJ3JGELR.js.map} +0 -0
  546. /package/dist/cli-bundle/chunks/{upgrade-JUDU7YL4.js.map → upgrade-RBRQ7PQU.js.map} +0 -0
@@ -4,7 +4,7 @@
4
4
  * Implements the pm init agent guidance 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]="12254594-5707-5aa5-ac5c-28013cf9be91")}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]="7987916d-4294-5753-925d-ceb787be0783")}catch(e){}}();
8
8
  import fs from "node:fs/promises";
9
9
  import path from "node:path";
10
10
  import readline from "node:readline/promises";
@@ -31,6 +31,7 @@ const AGENT_GUIDANCE_TEMPLATE_VERSION = 1;
31
31
  const AGENT_GUIDANCE_START_MARKER_PREFIX = "<!-- pm-cli:agent-guidance:start:";
32
32
  const AGENT_GUIDANCE_START_MARKER = `<!-- pm-cli:agent-guidance:start:v${AGENT_GUIDANCE_TEMPLATE_VERSION} -->`;
33
33
  const AGENT_GUIDANCE_END_MARKER = "<!-- pm-cli:agent-guidance:end -->";
34
+ const AGENT_GUIDANCE_ADD_LATER_HINT = "Add workflow guidance later: pm init --agent-guidance add";
34
35
  export const _testOnly = {
35
36
  toPortableRelativePath,
36
37
  ensureTrailingNewline,
@@ -237,135 +238,183 @@ async function writeGuidanceFile(filePath) {
237
238
  }),
238
239
  };
239
240
  }
240
- /**
241
- * Implements run init agent guidance for the public runtime surface of this module.
242
- */
243
- export async function runInitAgentGuidance(options) {
244
- const warnings = [];
245
- const nextSteps = [];
246
- const projectRoot = resolveProjectRoot(options.pm_root, options.cwd);
247
- let scans = await scanGuidanceFiles(projectRoot);
248
- const targetPath = resolveTargetGuidancePath(scans, projectRoot);
249
- const targetRelativePath = toPortableRelativePath(projectRoot, targetPath);
250
- const addLaterHint = "Add workflow guidance later: pm init --agent-guidance add";
251
- let prompted = false;
252
- let applied = false;
253
- let skipped = false;
254
- let state = normalizeAgentGuidanceState(options.settings);
255
- const checkedFiles = scans.map((entry) => toPortableRelativePath(projectRoot, entry.file_path));
256
- const presentBefore = scans.some((entry) => entry.has_guidance);
257
- const markState = (partial) => {
258
- state = {
259
- ...state,
260
- ...partial,
261
- template_version: AGENT_GUIDANCE_TEMPLATE_VERSION,
262
- last_checked_files: checkedFiles,
263
- };
241
+ function buildInitAgentGuidanceSummary(params) {
242
+ return {
243
+ mode: params.mode,
244
+ present: params.scans.some((entry) => entry.has_guidance),
245
+ prompted: params.prompted,
246
+ applied: params.applied,
247
+ skipped: params.skipped,
248
+ declined: params.state.declined,
249
+ prompt_completed: params.state.prompt_completed,
250
+ template_version: params.state.template_version,
251
+ target_file: params.targetRelativePath,
252
+ checked_files: params.scans.map((entry) => toPortableRelativePath(params.projectRoot, entry.file_path)),
253
+ files_with_guidance: params.scans
254
+ .filter((entry) => entry.has_guidance)
255
+ .map((entry) => toPortableRelativePath(params.projectRoot, entry.file_path)),
256
+ missing_files: params.scans
257
+ .filter((entry) => !entry.exists)
258
+ .map((entry) => toPortableRelativePath(params.projectRoot, entry.file_path)),
264
259
  };
265
- if (options.mode === "status") {
266
- if (!presentBefore) {
267
- warnings.push("agent_guidance:missing");
268
- pushUnique(nextSteps, addLaterHint);
269
- }
260
+ }
261
+ async function refreshGuidanceScansAfterApply(applied, scans, projectRoot) {
262
+ return applied ? await scanGuidanceFiles(projectRoot) : scans;
263
+ }
264
+ function markAgentGuidanceRunState(flow, checkedFiles, partial) {
265
+ flow.state = {
266
+ ...flow.state,
267
+ ...partial,
268
+ template_version: AGENT_GUIDANCE_TEMPLATE_VERSION,
269
+ last_checked_files: checkedFiles,
270
+ };
271
+ }
272
+ async function addAgentGuidanceBlockIfMissing(flow, context) {
273
+ if (context.presentBefore) {
274
+ return;
275
+ }
276
+ const writeResult = await writeGuidanceFile(context.targetPath);
277
+ flow.warnings.push(...writeResult.warnings);
278
+ if (writeResult.changed) {
279
+ flow.applied = true;
280
+ flow.warnings.push(`agent_guidance:added:${context.targetRelativePath}`);
281
+ }
282
+ }
283
+ function handleAgentGuidanceStatusMode(flow, presentBefore) {
284
+ if (!presentBefore) {
285
+ flow.warnings.push("agent_guidance:missing");
286
+ pushUnique(flow.nextSteps, AGENT_GUIDANCE_ADD_LATER_HINT);
270
287
  }
271
- else if (options.mode === "skip") {
272
- skipped = true;
273
- markState({
288
+ }
289
+ function handleAgentGuidanceSkipMode(flow, checkedFiles) {
290
+ flow.skipped = true;
291
+ markAgentGuidanceRunState(flow, checkedFiles, {
292
+ prompt_completed: true,
293
+ declined: true,
294
+ declined_at: flow.state.declined_at || new Date().toISOString(),
295
+ });
296
+ flow.warnings.push("agent_guidance:explicit_skip");
297
+ pushUnique(flow.nextSteps, AGENT_GUIDANCE_ADD_LATER_HINT);
298
+ }
299
+ async function handleAgentGuidanceAddMode(flow, context) {
300
+ await addAgentGuidanceBlockIfMissing(flow, context);
301
+ markAgentGuidanceRunState(flow, context.checkedFiles, {
302
+ prompt_completed: true,
303
+ declined: false,
304
+ declined_at: "",
305
+ });
306
+ }
307
+ function handlePresentAgentGuidance(flow, checkedFiles) {
308
+ if (flow.state.declined) {
309
+ markAgentGuidanceRunState(flow, checkedFiles, {
274
310
  prompt_completed: true,
275
- declined: true,
276
- declined_at: state.declined_at.length > 0 ? state.declined_at : new Date().toISOString(),
311
+ declined: false,
312
+ declined_at: "",
277
313
  });
278
- warnings.push("agent_guidance:explicit_skip");
279
- pushUnique(nextSteps, addLaterHint);
280
314
  }
281
- else if (options.mode === "add") {
282
- if (!presentBefore) {
283
- const writeResult = await writeGuidanceFile(targetPath);
284
- warnings.push(...writeResult.warnings);
285
- if (writeResult.changed) {
286
- applied = true;
287
- warnings.push(`agent_guidance:added:${targetRelativePath}`);
288
- }
289
- }
290
- markState({
315
+ }
316
+ function handleDeclinedAgentGuidance(flow) {
317
+ flow.skipped = true;
318
+ flow.warnings.push("agent_guidance:skipped_declined");
319
+ pushUnique(flow.nextSteps, AGENT_GUIDANCE_ADD_LATER_HINT);
320
+ }
321
+ async function handleInteractiveAgentGuidancePrompt(flow, context) {
322
+ flow.prompted = true;
323
+ const approved = await promptForGuidanceWrite(context.targetRelativePath);
324
+ if (approved) {
325
+ await addAgentGuidanceBlockIfMissing(flow, context);
326
+ markAgentGuidanceRunState(flow, context.checkedFiles, {
291
327
  prompt_completed: true,
292
328
  declined: false,
293
329
  declined_at: "",
294
330
  });
331
+ return;
295
332
  }
296
- else if (presentBefore) {
297
- if (state.declined) {
298
- markState({
299
- prompt_completed: true,
300
- declined: false,
301
- declined_at: "",
302
- });
303
- }
333
+ flow.skipped = true;
334
+ markAgentGuidanceRunState(flow, context.checkedFiles, {
335
+ prompt_completed: true,
336
+ declined: true,
337
+ declined_at: new Date().toISOString(),
338
+ });
339
+ flow.warnings.push("agent_guidance:declined");
340
+ pushUnique(flow.nextSteps, AGENT_GUIDANCE_ADD_LATER_HINT);
341
+ }
342
+ function handleNonInteractiveMissingAgentGuidance(flow) {
343
+ flow.warnings.push("agent_guidance:missing_non_interactive");
344
+ pushUnique(flow.nextSteps, AGENT_GUIDANCE_ADD_LATER_HINT);
345
+ }
346
+ async function applyAgentGuidanceMode(initialState, context) {
347
+ const flow = {
348
+ warnings: [],
349
+ nextSteps: [],
350
+ prompted: false,
351
+ applied: false,
352
+ skipped: false,
353
+ state: initialState,
354
+ };
355
+ if (context.mode === "status") {
356
+ handleAgentGuidanceStatusMode(flow, context.presentBefore);
357
+ return flow;
304
358
  }
305
- else if (state.prompt_completed && state.declined) {
306
- skipped = true;
307
- warnings.push("agent_guidance:skipped_declined");
308
- pushUnique(nextSteps, addLaterHint);
359
+ if (context.mode === "skip") {
360
+ handleAgentGuidanceSkipMode(flow, context.checkedFiles);
361
+ return flow;
309
362
  }
310
- else if (options.interactive) {
311
- prompted = true;
312
- const approved = await promptForGuidanceWrite(targetRelativePath);
313
- if (approved) {
314
- const writeResult = await writeGuidanceFile(targetPath);
315
- warnings.push(...writeResult.warnings);
316
- if (writeResult.changed) {
317
- applied = true;
318
- warnings.push(`agent_guidance:added:${targetRelativePath}`);
319
- }
320
- markState({
321
- prompt_completed: true,
322
- declined: false,
323
- declined_at: "",
324
- });
325
- }
326
- else {
327
- skipped = true;
328
- markState({
329
- prompt_completed: true,
330
- declined: true,
331
- declined_at: new Date().toISOString(),
332
- });
333
- warnings.push("agent_guidance:declined");
334
- pushUnique(nextSteps, addLaterHint);
335
- }
363
+ if (context.mode === "add") {
364
+ await handleAgentGuidanceAddMode(flow, context);
365
+ return flow;
336
366
  }
337
- else {
338
- warnings.push("agent_guidance:missing_non_interactive");
339
- pushUnique(nextSteps, addLaterHint);
367
+ if (context.presentBefore) {
368
+ handlePresentAgentGuidance(flow, context.checkedFiles);
369
+ return flow;
340
370
  }
341
- const stateUpdate = applyAgentGuidanceState(options.settings, state);
342
- if (applied) {
343
- scans = await scanGuidanceFiles(projectRoot);
371
+ if (flow.state.prompt_completed && flow.state.declined) {
372
+ handleDeclinedAgentGuidance(flow);
373
+ return flow;
344
374
  }
345
- const summary = {
375
+ if (context.interactive) {
376
+ await handleInteractiveAgentGuidancePrompt(flow, context);
377
+ return flow;
378
+ }
379
+ handleNonInteractiveMissingAgentGuidance(flow);
380
+ return flow;
381
+ }
382
+ /**
383
+ * Implements run init agent guidance for the public runtime surface of this module.
384
+ */
385
+ export async function runInitAgentGuidance(options) {
386
+ const projectRoot = resolveProjectRoot(options.pm_root, options.cwd);
387
+ let scans = await scanGuidanceFiles(projectRoot);
388
+ const targetPath = resolveTargetGuidancePath(scans, projectRoot);
389
+ const targetRelativePath = toPortableRelativePath(projectRoot, targetPath);
390
+ const checkedFiles = scans.map((entry) => toPortableRelativePath(projectRoot, entry.file_path));
391
+ const presentBefore = scans.some((entry) => entry.has_guidance);
392
+ const flow = await applyAgentGuidanceMode(normalizeAgentGuidanceState(options.settings), {
346
393
  mode: options.mode,
347
- present: scans.some((entry) => entry.has_guidance),
348
- prompted,
349
- applied,
350
- skipped,
351
- declined: state.declined,
352
- prompt_completed: state.prompt_completed,
353
- template_version: state.template_version,
354
- target_file: targetRelativePath,
355
- checked_files: scans.map((entry) => toPortableRelativePath(projectRoot, entry.file_path)),
356
- files_with_guidance: scans
357
- .filter((entry) => entry.has_guidance)
358
- .map((entry) => toPortableRelativePath(projectRoot, entry.file_path)),
359
- missing_files: scans
360
- .filter((entry) => !entry.exists)
361
- .map((entry) => toPortableRelativePath(projectRoot, entry.file_path)),
362
- };
394
+ interactive: options.interactive,
395
+ targetPath,
396
+ targetRelativePath,
397
+ checkedFiles,
398
+ presentBefore,
399
+ });
400
+ const stateUpdate = applyAgentGuidanceState(options.settings, flow.state);
401
+ scans = await refreshGuidanceScansAfterApply(flow.applied, scans, projectRoot);
402
+ const summary = buildInitAgentGuidanceSummary({
403
+ mode: options.mode,
404
+ scans,
405
+ projectRoot,
406
+ targetRelativePath,
407
+ prompted: flow.prompted,
408
+ applied: flow.applied,
409
+ skipped: flow.skipped,
410
+ state: flow.state,
411
+ });
363
412
  return {
364
413
  summary,
365
- warnings,
366
- next_steps: nextSteps,
414
+ warnings: flow.warnings,
415
+ next_steps: flow.nextSteps,
367
416
  settings_changed: stateUpdate.changed,
368
417
  };
369
418
  }
370
419
  //# sourceMappingURL=init-agent-guidance.js.map
371
- //# debugId=12254594-5707-5aa5-ac5c-28013cf9be91
420
+ //# debugId=7987916d-4294-5753-925d-ceb787be0783
@@ -1 +1 @@
1
- {"version":3,"file":"init-agent-guidance.js","sources":["cli/commands/init-agent-guidance.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module cli/commands/init-agent-guidance\n *\n * Implements the pm init agent guidance command surface and its agent-facing runtime behavior.\n */\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport readline from \"node:readline/promises\";\nimport { stdin as input, stdout as output } from \"node:process\";\nimport { runActiveOnWriteHooks } from \"../../core/extensions/index.js\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport type { PmSettings } from \"../../types/index.js\";\n\n/**\n * Restricts init agent guidance mode values accepted by command, SDK, and storage contracts.\n */\nexport type InitAgentGuidanceMode = \"ask\" | \"add\" | \"skip\" | \"status\";\n\nexport const INIT_AGENT_GUIDANCE_MODE_VALUES: InitAgentGuidanceMode[] = [\"ask\", \"add\", \"skip\", \"status\"];\n\nconst AGENT_GUIDANCE_TARGET_FILENAMES = [\"AGENTS.md\", \"CLAUDE.md\"] as const;\nconst AGENT_GUIDANCE_REQUIRED_TOKENS = [\n \"pm init\",\n \"pm context\",\n \"pm search\",\n \"pm create\",\n \"pm claim\",\n \"pm files\",\n \"pm docs\",\n \"pm test --run\",\n \"pm close\",\n \"pm release\",\n \"pm_author\",\n] as const;\nconst AGENT_GUIDANCE_REQUIRED_TOKEN_THRESHOLD = 8;\nconst AGENT_GUIDANCE_TEMPLATE_VERSION = 1;\nconst AGENT_GUIDANCE_START_MARKER_PREFIX = \"<!-- pm-cli:agent-guidance:start:\";\nconst AGENT_GUIDANCE_START_MARKER = `<!-- pm-cli:agent-guidance:start:v${AGENT_GUIDANCE_TEMPLATE_VERSION} -->`;\nconst AGENT_GUIDANCE_END_MARKER = \"<!-- pm-cli:agent-guidance:end -->\";\n\nexport const _testOnly = {\n toPortableRelativePath,\n ensureTrailingNewline,\n detectLineEnding,\n findGuidanceBlockRange,\n buildAgentGuidanceBlock,\n upsertAgentGuidanceBlock,\n resolveProjectRoot,\n resolveTargetGuidancePath,\n parsePromptChoice,\n pushUnique,\n promptForGuidanceWrite,\n normalizeAgentGuidanceState,\n applyAgentGuidanceState,\n writeGuidanceFile,\n setAgentGuidanceReadlineFactoryForTests,\n};\n\ntype AgentGuidanceReadlineInterface = ReturnType<typeof readline.createInterface>;\nlet createAgentGuidanceReadlineInterface = (): AgentGuidanceReadlineInterface => readline.createInterface({ input, output });\n\nfunction setAgentGuidanceReadlineFactoryForTests(factory: (() => AgentGuidanceReadlineInterface) | undefined): void {\n createAgentGuidanceReadlineInterface = factory ?? (() => readline.createInterface({ input, output }));\n}\n\ninterface AgentGuidanceFileScan {\n file_path: string;\n exists: boolean;\n has_guidance: boolean;\n has_marker: boolean;\n}\n\ninterface AgentGuidanceBlockRange {\n start_index: number;\n end_index: number;\n}\n\n/**\n * Documents the init agent guidance summary payload exchanged by command, SDK, and package integrations.\n */\nexport interface InitAgentGuidanceSummary {\n mode: InitAgentGuidanceMode;\n present: boolean;\n prompted: boolean;\n applied: boolean;\n skipped: boolean;\n declined: boolean;\n prompt_completed: boolean;\n template_version: number;\n target_file: string;\n checked_files: string[];\n files_with_guidance: string[];\n missing_files: string[];\n}\n\n/**\n * Documents the run init agent guidance options payload exchanged by command, SDK, and package integrations.\n */\nexport interface RunInitAgentGuidanceOptions {\n pm_root: string;\n cwd: string;\n mode: InitAgentGuidanceMode;\n interactive: boolean;\n settings: PmSettings;\n}\n\n/**\n * Documents the run init agent guidance result payload exchanged by command, SDK, and package integrations.\n */\nexport interface RunInitAgentGuidanceResult {\n summary: InitAgentGuidanceSummary;\n warnings: string[];\n next_steps: string[];\n settings_changed: boolean;\n}\n\nfunction toPortableRelativePath(projectRoot: string, targetPath: string): string {\n const relative = path.relative(projectRoot, targetPath);\n if (relative.length === 0) {\n return path.basename(targetPath);\n }\n return relative.split(path.sep).join(\"/\");\n}\n\nfunction ensureTrailingNewline(value: string): string {\n return value.endsWith(\"\\n\") ? value : `${value}\\n`;\n}\n\nfunction detectLineEnding(value: string): \"\\n\" | \"\\r\\n\" {\n return value.includes(\"\\r\\n\") ? \"\\r\\n\" : \"\\n\";\n}\n\nfunction findGuidanceBlockRange(content: string): AgentGuidanceBlockRange | null {\n const startIndex = content.indexOf(AGENT_GUIDANCE_START_MARKER_PREFIX);\n if (startIndex === -1) {\n return null;\n }\n const endMarkerIndex = content.indexOf(AGENT_GUIDANCE_END_MARKER, startIndex);\n if (endMarkerIndex === -1) {\n return null;\n }\n return {\n start_index: startIndex,\n end_index: endMarkerIndex + AGENT_GUIDANCE_END_MARKER.length,\n };\n}\n\nfunction hasGuidanceMarker(content: string): boolean {\n return findGuidanceBlockRange(content) !== null;\n}\n\nfunction buildAgentGuidanceBlock(lineEnding: \"\\n\" | \"\\r\\n\"): string {\n const lines = [\n AGENT_GUIDANCE_START_MARKER,\n \"## pm Workflow (Agent Quickstart)\",\n \"\",\n \"- Orient before mutate: `pm context --limit 10`, `pm search \\\"<keywords>\\\" --limit 10`, `pm list-open --limit 20`.\",\n \"- Claim and execute: `pm claim <id>` then `pm update <id> --status in_progress`.\",\n \"- Link evidence while coding: `pm files <id> --add ...`, `pm docs <id> --add ...`, `pm test <id> --add command=\\\"node scripts/run-tests.mjs test -- ...\\\"`.\",\n \"- Verify and close: `pm test <id> --run --progress`, `pm close <id> \\\"<evidence>\\\" --validate-close warn`, `pm release <id>`.\",\n \"- Set `PM_AUTHOR=<stable-agent-id>` before mutation commands.\",\n \"\",\n AGENT_GUIDANCE_END_MARKER,\n \"\",\n ];\n return lines.join(lineEnding);\n}\n\nfunction upsertAgentGuidanceBlock(existingContent: string): { next_content: string; changed: boolean } {\n const lineEnding = detectLineEnding(existingContent);\n const nextBlock = buildAgentGuidanceBlock(lineEnding);\n const existingRange = findGuidanceBlockRange(existingContent);\n if (existingRange) {\n const trailingContent = existingContent.slice(existingRange.end_index);\n const normalizedTrailingContent = trailingContent.startsWith(\"\\r\\n\")\n ? trailingContent.slice(2)\n : trailingContent.startsWith(\"\\n\")\n ? trailingContent.slice(1)\n : trailingContent;\n const nextContent = ensureTrailingNewline(\n `${existingContent.slice(0, existingRange.start_index)}${nextBlock}${normalizedTrailingContent}`,\n );\n return {\n next_content: nextContent,\n changed: nextContent !== existingContent,\n };\n }\n const separator = existingContent.length === 0 ? \"\" : existingContent.endsWith(\"\\n\") ? \"\\n\" : \"\\n\\n\";\n const nextContent = ensureTrailingNewline(`${existingContent}${separator}${nextBlock}`);\n return {\n next_content: nextContent,\n changed: nextContent !== existingContent,\n };\n}\n\nfunction resolveProjectRoot(pmRoot: string, cwd: string): string {\n const parent = path.dirname(pmRoot);\n if (path.basename(pmRoot) === \"pm\" && path.basename(parent) === \".agents\") {\n return path.dirname(parent);\n }\n return path.resolve(cwd, pmRoot);\n}\n\nfunction resolveTargetGuidancePath(scans: AgentGuidanceFileScan[], projectRoot: string): string {\n const existingAgents = scans.find((entry) => path.basename(entry.file_path) === \"AGENTS.md\" && entry.exists);\n if (existingAgents) {\n return existingAgents.file_path;\n }\n const existingAny = scans.find((entry) => entry.exists);\n if (existingAny) {\n return existingAny.file_path;\n }\n return path.join(projectRoot, \"AGENTS.md\");\n}\n\nfunction parsePromptChoice(answer: string, currentDefault: boolean): boolean {\n const normalized = answer.trim().toLowerCase();\n if (normalized.length === 0) {\n return currentDefault;\n }\n if (normalized === \"y\" || normalized === \"yes\") {\n return true;\n }\n if (normalized === \"n\" || normalized === \"no\") {\n return false;\n }\n return currentDefault;\n}\n\nasync function promptForGuidanceWrite(targetRelativePath: string): Promise<boolean> {\n const rl = createAgentGuidanceReadlineInterface();\n try {\n output.write(\"\\nAgent guidance check\\n\");\n output.write(\"No AGENTS.md/CLAUDE.md file currently contains compact pm workflow guidance.\\n\");\n const answer = await rl.question(`Add a compact pm workflow section to ${targetRelativePath}? [Y/n] `);\n output.write(\"\\n\");\n return parsePromptChoice(answer, true);\n } finally {\n rl.close();\n }\n}\n\nfunction normalizeAgentGuidanceState(settings: PmSettings): PmSettings[\"agent_guidance\"] {\n const current = settings.agent_guidance;\n return {\n prompt_completed: current?.prompt_completed === true,\n declined: current?.declined === true,\n declined_at: typeof current?.declined_at === \"string\" ? current.declined_at : \"\",\n template_version:\n typeof current?.template_version === \"number\" && Number.isInteger(current.template_version) && current.template_version > 0\n ? current.template_version\n : AGENT_GUIDANCE_TEMPLATE_VERSION,\n last_checked_files: Array.isArray(current?.last_checked_files)\n ? [...new Set(current.last_checked_files.map((value) => value.trim()).filter((value) => value.length > 0))].sort(\n (left, right) => left.localeCompare(right),\n )\n : [],\n };\n}\n\nasync function scanGuidanceFiles(projectRoot: string): Promise<AgentGuidanceFileScan[]> {\n const scans: AgentGuidanceFileScan[] = [];\n for (const filename of AGENT_GUIDANCE_TARGET_FILENAMES) {\n const filePath = path.join(projectRoot, filename);\n const exists = await pathExists(filePath);\n if (!exists) {\n scans.push({\n file_path: filePath,\n exists,\n has_guidance: false,\n has_marker: false,\n });\n continue;\n }\n const content = await fs.readFile(filePath, \"utf8\");\n const contentLower = content.toLowerCase();\n const tokenHits = AGENT_GUIDANCE_REQUIRED_TOKENS.filter((token) => contentLower.includes(token));\n const hasMarker = hasGuidanceMarker(content);\n scans.push({\n file_path: filePath,\n exists,\n has_guidance: hasMarker || tokenHits.length >= AGENT_GUIDANCE_REQUIRED_TOKEN_THRESHOLD,\n has_marker: hasMarker,\n });\n }\n return scans;\n}\n\nfunction pushUnique(target: string[], value: string): void {\n if (!target.includes(value)) {\n target.push(value);\n }\n}\n\nfunction applyAgentGuidanceState(\n settings: PmSettings,\n currentState: PmSettings[\"agent_guidance\"],\n): { changed: boolean; state: PmSettings[\"agent_guidance\"] } {\n const existing = normalizeAgentGuidanceState(settings);\n const changed = JSON.stringify(existing) !== JSON.stringify(currentState);\n if (changed) {\n settings.agent_guidance = currentState;\n }\n return { changed, state: currentState };\n}\n\nasync function writeGuidanceFile(filePath: string): Promise<{ changed: boolean; warnings: string[] }> {\n const exists = await pathExists(filePath);\n const currentContent = exists ? await fs.readFile(filePath, \"utf8\") : \"\";\n const nextContent = upsertAgentGuidanceBlock(currentContent);\n if (!nextContent.changed) {\n return { changed: false, warnings: [] };\n }\n await fs.writeFile(filePath, nextContent.next_content, \"utf8\");\n return {\n changed: true,\n warnings: await runActiveOnWriteHooks({\n path: filePath,\n scope: \"project\",\n op: \"init:agent_guidance_file\",\n }),\n };\n}\n\n/**\n * Implements run init agent guidance for the public runtime surface of this module.\n */\nexport async function runInitAgentGuidance(options: RunInitAgentGuidanceOptions): Promise<RunInitAgentGuidanceResult> {\n const warnings: string[] = [];\n const nextSteps: string[] = [];\n const projectRoot = resolveProjectRoot(options.pm_root, options.cwd);\n let scans = await scanGuidanceFiles(projectRoot);\n const targetPath = resolveTargetGuidancePath(scans, projectRoot);\n const targetRelativePath = toPortableRelativePath(projectRoot, targetPath);\n const addLaterHint = \"Add workflow guidance later: pm init --agent-guidance add\";\n let prompted = false;\n let applied = false;\n let skipped = false;\n let state = normalizeAgentGuidanceState(options.settings);\n const checkedFiles = scans.map((entry) => toPortableRelativePath(projectRoot, entry.file_path));\n const presentBefore = scans.some((entry) => entry.has_guidance);\n\n const markState = (partial: Partial<PmSettings[\"agent_guidance\"]>): void => {\n state = {\n ...state,\n ...partial,\n template_version: AGENT_GUIDANCE_TEMPLATE_VERSION,\n last_checked_files: checkedFiles,\n };\n };\n\n if (options.mode === \"status\") {\n if (!presentBefore) {\n warnings.push(\"agent_guidance:missing\");\n pushUnique(nextSteps, addLaterHint);\n }\n } else if (options.mode === \"skip\") {\n skipped = true;\n markState({\n prompt_completed: true,\n declined: true,\n declined_at: state.declined_at.length > 0 ? state.declined_at : new Date().toISOString(),\n });\n warnings.push(\"agent_guidance:explicit_skip\");\n pushUnique(nextSteps, addLaterHint);\n } else if (options.mode === \"add\") {\n if (!presentBefore) {\n const writeResult = await writeGuidanceFile(targetPath);\n warnings.push(...writeResult.warnings);\n if (writeResult.changed) {\n applied = true;\n warnings.push(`agent_guidance:added:${targetRelativePath}`);\n }\n }\n markState({\n prompt_completed: true,\n declined: false,\n declined_at: \"\",\n });\n } else if (presentBefore) {\n if (state.declined) {\n markState({\n prompt_completed: true,\n declined: false,\n declined_at: \"\",\n });\n }\n } else if (state.prompt_completed && state.declined) {\n skipped = true;\n warnings.push(\"agent_guidance:skipped_declined\");\n pushUnique(nextSteps, addLaterHint);\n } else if (options.interactive) {\n prompted = true;\n const approved = await promptForGuidanceWrite(targetRelativePath);\n if (approved) {\n const writeResult = await writeGuidanceFile(targetPath);\n warnings.push(...writeResult.warnings);\n if (writeResult.changed) {\n applied = true;\n warnings.push(`agent_guidance:added:${targetRelativePath}`);\n }\n markState({\n prompt_completed: true,\n declined: false,\n declined_at: \"\",\n });\n } else {\n skipped = true;\n markState({\n prompt_completed: true,\n declined: true,\n declined_at: new Date().toISOString(),\n });\n warnings.push(\"agent_guidance:declined\");\n pushUnique(nextSteps, addLaterHint);\n }\n } else {\n warnings.push(\"agent_guidance:missing_non_interactive\");\n pushUnique(nextSteps, addLaterHint);\n }\n\n const stateUpdate = applyAgentGuidanceState(options.settings, state);\n if (applied) {\n scans = await scanGuidanceFiles(projectRoot);\n }\n\n const summary: InitAgentGuidanceSummary = {\n mode: options.mode,\n present: scans.some((entry) => entry.has_guidance),\n prompted,\n applied,\n skipped,\n declined: state.declined,\n prompt_completed: state.prompt_completed,\n template_version: state.template_version,\n target_file: targetRelativePath,\n checked_files: scans.map((entry) => toPortableRelativePath(projectRoot, entry.file_path)),\n files_with_guidance: scans\n .filter((entry) => entry.has_guidance)\n .map((entry) => toPortableRelativePath(projectRoot, entry.file_path)),\n missing_files: scans\n .filter((entry) => !entry.exists)\n .map((entry) => toPortableRelativePath(projectRoot, entry.file_path)),\n };\n\n return {\n summary,\n warnings,\n next_steps: nextSteps,\n settings_changed: stateUpdate.changed,\n };\n}\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,KAAK,IAAI,KAAK,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAQvD,MAAM,CAAC,MAAM,+BAA+B,GAA4B,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;AAEzG,MAAM,+BAA+B,GAAG,CAAC,WAAW,EAAE,WAAW,CAAU,CAAC;AAC5E,MAAM,8BAA8B,GAAG;IACrC,SAAS;IACT,YAAY;IACZ,WAAW;IACX,WAAW;IACX,UAAU;IACV,UAAU;IACV,SAAS;IACT,eAAe;IAC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1
+ {"version":3,"file":"init-agent-guidance.js","sources":["cli/commands/init-agent-guidance.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module cli/commands/init-agent-guidance\n *\n * Implements the pm init agent guidance command surface and its agent-facing runtime behavior.\n */\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport readline from \"node:readline/promises\";\nimport { stdin as input, stdout as output } from \"node:process\";\nimport { runActiveOnWriteHooks } from \"../../core/extensions/index.js\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport type { PmSettings } from \"../../types/index.js\";\n\n/**\n * Restricts init agent guidance mode values accepted by command, SDK, and storage contracts.\n */\nexport type InitAgentGuidanceMode = \"ask\" | \"add\" | \"skip\" | \"status\";\n\nexport const INIT_AGENT_GUIDANCE_MODE_VALUES: InitAgentGuidanceMode[] = [\"ask\", \"add\", \"skip\", \"status\"];\n\nconst AGENT_GUIDANCE_TARGET_FILENAMES = [\"AGENTS.md\", \"CLAUDE.md\"] as const;\nconst AGENT_GUIDANCE_REQUIRED_TOKENS = [\n \"pm init\",\n \"pm context\",\n \"pm search\",\n \"pm create\",\n \"pm claim\",\n \"pm files\",\n \"pm docs\",\n \"pm test --run\",\n \"pm close\",\n \"pm release\",\n \"pm_author\",\n] as const;\nconst AGENT_GUIDANCE_REQUIRED_TOKEN_THRESHOLD = 8;\nconst AGENT_GUIDANCE_TEMPLATE_VERSION = 1;\nconst AGENT_GUIDANCE_START_MARKER_PREFIX = \"<!-- pm-cli:agent-guidance:start:\";\nconst AGENT_GUIDANCE_START_MARKER = `<!-- pm-cli:agent-guidance:start:v${AGENT_GUIDANCE_TEMPLATE_VERSION} -->`;\nconst AGENT_GUIDANCE_END_MARKER = \"<!-- pm-cli:agent-guidance:end -->\";\nconst AGENT_GUIDANCE_ADD_LATER_HINT = \"Add workflow guidance later: pm init --agent-guidance add\";\n\nexport const _testOnly = {\n toPortableRelativePath,\n ensureTrailingNewline,\n detectLineEnding,\n findGuidanceBlockRange,\n buildAgentGuidanceBlock,\n upsertAgentGuidanceBlock,\n resolveProjectRoot,\n resolveTargetGuidancePath,\n parsePromptChoice,\n pushUnique,\n promptForGuidanceWrite,\n normalizeAgentGuidanceState,\n applyAgentGuidanceState,\n writeGuidanceFile,\n setAgentGuidanceReadlineFactoryForTests,\n};\n\ntype AgentGuidanceReadlineInterface = ReturnType<typeof readline.createInterface>;\nlet createAgentGuidanceReadlineInterface = (): AgentGuidanceReadlineInterface => readline.createInterface({ input, output });\n\nfunction setAgentGuidanceReadlineFactoryForTests(factory: (() => AgentGuidanceReadlineInterface) | undefined): void {\n createAgentGuidanceReadlineInterface = factory ?? (() => readline.createInterface({ input, output }));\n}\n\ninterface AgentGuidanceFileScan {\n file_path: string;\n exists: boolean;\n has_guidance: boolean;\n has_marker: boolean;\n}\n\ninterface AgentGuidanceBlockRange {\n start_index: number;\n end_index: number;\n}\n\n/**\n * Documents the init agent guidance summary payload exchanged by command, SDK, and package integrations.\n */\nexport interface InitAgentGuidanceSummary {\n mode: InitAgentGuidanceMode;\n present: boolean;\n prompted: boolean;\n applied: boolean;\n skipped: boolean;\n declined: boolean;\n prompt_completed: boolean;\n template_version: number;\n target_file: string;\n checked_files: string[];\n files_with_guidance: string[];\n missing_files: string[];\n}\n\n/**\n * Documents the run init agent guidance options payload exchanged by command, SDK, and package integrations.\n */\nexport interface RunInitAgentGuidanceOptions {\n pm_root: string;\n cwd: string;\n mode: InitAgentGuidanceMode;\n interactive: boolean;\n settings: PmSettings;\n}\n\n/**\n * Documents the run init agent guidance result payload exchanged by command, SDK, and package integrations.\n */\nexport interface RunInitAgentGuidanceResult {\n summary: InitAgentGuidanceSummary;\n warnings: string[];\n next_steps: string[];\n settings_changed: boolean;\n}\n\nfunction toPortableRelativePath(projectRoot: string, targetPath: string): string {\n const relative = path.relative(projectRoot, targetPath);\n if (relative.length === 0) {\n return path.basename(targetPath);\n }\n return relative.split(path.sep).join(\"/\");\n}\n\nfunction ensureTrailingNewline(value: string): string {\n return value.endsWith(\"\\n\") ? value : `${value}\\n`;\n}\n\nfunction detectLineEnding(value: string): \"\\n\" | \"\\r\\n\" {\n return value.includes(\"\\r\\n\") ? \"\\r\\n\" : \"\\n\";\n}\n\nfunction findGuidanceBlockRange(content: string): AgentGuidanceBlockRange | null {\n const startIndex = content.indexOf(AGENT_GUIDANCE_START_MARKER_PREFIX);\n if (startIndex === -1) {\n return null;\n }\n const endMarkerIndex = content.indexOf(AGENT_GUIDANCE_END_MARKER, startIndex);\n if (endMarkerIndex === -1) {\n return null;\n }\n return {\n start_index: startIndex,\n end_index: endMarkerIndex + AGENT_GUIDANCE_END_MARKER.length,\n };\n}\n\nfunction hasGuidanceMarker(content: string): boolean {\n return findGuidanceBlockRange(content) !== null;\n}\n\nfunction buildAgentGuidanceBlock(lineEnding: \"\\n\" | \"\\r\\n\"): string {\n const lines = [\n AGENT_GUIDANCE_START_MARKER,\n \"## pm Workflow (Agent Quickstart)\",\n \"\",\n \"- Orient before mutate: `pm context --limit 10`, `pm search \\\"<keywords>\\\" --limit 10`, `pm list-open --limit 20`.\",\n \"- Claim and execute: `pm claim <id>` then `pm update <id> --status in_progress`.\",\n \"- Link evidence while coding: `pm files <id> --add ...`, `pm docs <id> --add ...`, `pm test <id> --add command=\\\"node scripts/run-tests.mjs test -- ...\\\"`.\",\n \"- Verify and close: `pm test <id> --run --progress`, `pm close <id> \\\"<evidence>\\\" --validate-close warn`, `pm release <id>`.\",\n \"- Set `PM_AUTHOR=<stable-agent-id>` before mutation commands.\",\n \"\",\n AGENT_GUIDANCE_END_MARKER,\n \"\",\n ];\n return lines.join(lineEnding);\n}\n\nfunction upsertAgentGuidanceBlock(existingContent: string): { next_content: string; changed: boolean } {\n const lineEnding = detectLineEnding(existingContent);\n const nextBlock = buildAgentGuidanceBlock(lineEnding);\n const existingRange = findGuidanceBlockRange(existingContent);\n if (existingRange) {\n const trailingContent = existingContent.slice(existingRange.end_index);\n const normalizedTrailingContent = trailingContent.startsWith(\"\\r\\n\")\n ? trailingContent.slice(2)\n : trailingContent.startsWith(\"\\n\")\n ? trailingContent.slice(1)\n : trailingContent;\n const nextContent = ensureTrailingNewline(\n `${existingContent.slice(0, existingRange.start_index)}${nextBlock}${normalizedTrailingContent}`,\n );\n return {\n next_content: nextContent,\n changed: nextContent !== existingContent,\n };\n }\n const separator = existingContent.length === 0 ? \"\" : existingContent.endsWith(\"\\n\") ? \"\\n\" : \"\\n\\n\";\n const nextContent = ensureTrailingNewline(`${existingContent}${separator}${nextBlock}`);\n return {\n next_content: nextContent,\n changed: nextContent !== existingContent,\n };\n}\n\nfunction resolveProjectRoot(pmRoot: string, cwd: string): string {\n const parent = path.dirname(pmRoot);\n if (path.basename(pmRoot) === \"pm\" && path.basename(parent) === \".agents\") {\n return path.dirname(parent);\n }\n return path.resolve(cwd, pmRoot);\n}\n\nfunction resolveTargetGuidancePath(scans: AgentGuidanceFileScan[], projectRoot: string): string {\n const existingAgents = scans.find((entry) => path.basename(entry.file_path) === \"AGENTS.md\" && entry.exists);\n if (existingAgents) {\n return existingAgents.file_path;\n }\n const existingAny = scans.find((entry) => entry.exists);\n if (existingAny) {\n return existingAny.file_path;\n }\n return path.join(projectRoot, \"AGENTS.md\");\n}\n\nfunction parsePromptChoice(answer: string, currentDefault: boolean): boolean {\n const normalized = answer.trim().toLowerCase();\n if (normalized.length === 0) {\n return currentDefault;\n }\n if (normalized === \"y\" || normalized === \"yes\") {\n return true;\n }\n if (normalized === \"n\" || normalized === \"no\") {\n return false;\n }\n return currentDefault;\n}\n\nasync function promptForGuidanceWrite(targetRelativePath: string): Promise<boolean> {\n const rl = createAgentGuidanceReadlineInterface();\n try {\n output.write(\"\\nAgent guidance check\\n\");\n output.write(\"No AGENTS.md/CLAUDE.md file currently contains compact pm workflow guidance.\\n\");\n const answer = await rl.question(`Add a compact pm workflow section to ${targetRelativePath}? [Y/n] `);\n output.write(\"\\n\");\n return parsePromptChoice(answer, true);\n } finally {\n rl.close();\n }\n}\n\nfunction normalizeAgentGuidanceState(settings: PmSettings): PmSettings[\"agent_guidance\"] {\n const current = settings.agent_guidance;\n return {\n prompt_completed: current?.prompt_completed === true,\n declined: current?.declined === true,\n declined_at: typeof current?.declined_at === \"string\" ? current.declined_at : \"\",\n template_version:\n typeof current?.template_version === \"number\" && Number.isInteger(current.template_version) && current.template_version > 0\n ? current.template_version\n : AGENT_GUIDANCE_TEMPLATE_VERSION,\n last_checked_files: Array.isArray(current?.last_checked_files)\n ? [...new Set(current.last_checked_files.map((value) => value.trim()).filter((value) => value.length > 0))].sort(\n (left, right) => left.localeCompare(right),\n )\n : [],\n };\n}\n\nasync function scanGuidanceFiles(projectRoot: string): Promise<AgentGuidanceFileScan[]> {\n const scans: AgentGuidanceFileScan[] = [];\n for (const filename of AGENT_GUIDANCE_TARGET_FILENAMES) {\n const filePath = path.join(projectRoot, filename);\n const exists = await pathExists(filePath);\n if (!exists) {\n scans.push({\n file_path: filePath,\n exists,\n has_guidance: false,\n has_marker: false,\n });\n continue;\n }\n const content = await fs.readFile(filePath, \"utf8\");\n const contentLower = content.toLowerCase();\n const tokenHits = AGENT_GUIDANCE_REQUIRED_TOKENS.filter((token) => contentLower.includes(token));\n const hasMarker = hasGuidanceMarker(content);\n scans.push({\n file_path: filePath,\n exists,\n has_guidance: hasMarker || tokenHits.length >= AGENT_GUIDANCE_REQUIRED_TOKEN_THRESHOLD,\n has_marker: hasMarker,\n });\n }\n return scans;\n}\n\nfunction pushUnique(target: string[], value: string): void {\n if (!target.includes(value)) {\n target.push(value);\n }\n}\n\nfunction applyAgentGuidanceState(\n settings: PmSettings,\n currentState: PmSettings[\"agent_guidance\"],\n): { changed: boolean; state: PmSettings[\"agent_guidance\"] } {\n const existing = normalizeAgentGuidanceState(settings);\n const changed = JSON.stringify(existing) !== JSON.stringify(currentState);\n if (changed) {\n settings.agent_guidance = currentState;\n }\n return { changed, state: currentState };\n}\n\nasync function writeGuidanceFile(filePath: string): Promise<{ changed: boolean; warnings: string[] }> {\n const exists = await pathExists(filePath);\n const currentContent = exists ? await fs.readFile(filePath, \"utf8\") : \"\";\n const nextContent = upsertAgentGuidanceBlock(currentContent);\n if (!nextContent.changed) {\n return { changed: false, warnings: [] };\n }\n await fs.writeFile(filePath, nextContent.next_content, \"utf8\");\n return {\n changed: true,\n warnings: await runActiveOnWriteHooks({\n path: filePath,\n scope: \"project\",\n op: \"init:agent_guidance_file\",\n }),\n };\n}\n\nfunction buildInitAgentGuidanceSummary(params: {\n mode: InitAgentGuidanceMode;\n scans: AgentGuidanceFileScan[];\n projectRoot: string;\n targetRelativePath: string;\n prompted: boolean;\n applied: boolean;\n skipped: boolean;\n state: PmSettings[\"agent_guidance\"];\n}): InitAgentGuidanceSummary {\n return {\n mode: params.mode,\n present: params.scans.some((entry) => entry.has_guidance),\n prompted: params.prompted,\n applied: params.applied,\n skipped: params.skipped,\n declined: params.state.declined,\n prompt_completed: params.state.prompt_completed,\n template_version: params.state.template_version,\n target_file: params.targetRelativePath,\n checked_files: params.scans.map((entry) => toPortableRelativePath(params.projectRoot, entry.file_path)),\n files_with_guidance: params.scans\n .filter((entry) => entry.has_guidance)\n .map((entry) => toPortableRelativePath(params.projectRoot, entry.file_path)),\n missing_files: params.scans\n .filter((entry) => !entry.exists)\n .map((entry) => toPortableRelativePath(params.projectRoot, entry.file_path)),\n };\n}\n\nasync function refreshGuidanceScansAfterApply(\n applied: boolean,\n scans: AgentGuidanceFileScan[],\n projectRoot: string,\n): Promise<AgentGuidanceFileScan[]> {\n return applied ? await scanGuidanceFiles(projectRoot) : scans;\n}\n\ninterface InitAgentGuidanceFlowState {\n warnings: string[];\n nextSteps: string[];\n prompted: boolean;\n applied: boolean;\n skipped: boolean;\n state: PmSettings[\"agent_guidance\"];\n}\n\ninterface InitAgentGuidanceModeContext {\n mode: InitAgentGuidanceMode;\n interactive: boolean;\n targetPath: string;\n targetRelativePath: string;\n checkedFiles: string[];\n presentBefore: boolean;\n}\n\nfunction markAgentGuidanceRunState(\n flow: InitAgentGuidanceFlowState,\n checkedFiles: string[],\n partial: Partial<PmSettings[\"agent_guidance\"]>,\n): void {\n flow.state = {\n ...flow.state,\n ...partial,\n template_version: AGENT_GUIDANCE_TEMPLATE_VERSION,\n last_checked_files: checkedFiles,\n };\n}\n\nasync function addAgentGuidanceBlockIfMissing(\n flow: InitAgentGuidanceFlowState,\n context: Pick<InitAgentGuidanceModeContext, \"presentBefore\" | \"targetPath\" | \"targetRelativePath\">,\n): Promise<void> {\n if (context.presentBefore) {\n return;\n }\n const writeResult = await writeGuidanceFile(context.targetPath);\n flow.warnings.push(...writeResult.warnings);\n if (writeResult.changed) {\n flow.applied = true;\n flow.warnings.push(`agent_guidance:added:${context.targetRelativePath}`);\n }\n}\n\nfunction handleAgentGuidanceStatusMode(flow: InitAgentGuidanceFlowState, presentBefore: boolean): void {\n if (!presentBefore) {\n flow.warnings.push(\"agent_guidance:missing\");\n pushUnique(flow.nextSteps, AGENT_GUIDANCE_ADD_LATER_HINT);\n }\n}\n\nfunction handleAgentGuidanceSkipMode(flow: InitAgentGuidanceFlowState, checkedFiles: string[]): void {\n flow.skipped = true;\n markAgentGuidanceRunState(flow, checkedFiles, {\n prompt_completed: true,\n declined: true,\n declined_at: flow.state.declined_at || new Date().toISOString(),\n });\n flow.warnings.push(\"agent_guidance:explicit_skip\");\n pushUnique(flow.nextSteps, AGENT_GUIDANCE_ADD_LATER_HINT);\n}\n\nasync function handleAgentGuidanceAddMode(\n flow: InitAgentGuidanceFlowState,\n context: InitAgentGuidanceModeContext,\n): Promise<void> {\n await addAgentGuidanceBlockIfMissing(flow, context);\n markAgentGuidanceRunState(flow, context.checkedFiles, {\n prompt_completed: true,\n declined: false,\n declined_at: \"\",\n });\n}\n\nfunction handlePresentAgentGuidance(flow: InitAgentGuidanceFlowState, checkedFiles: string[]): void {\n if (flow.state.declined) {\n markAgentGuidanceRunState(flow, checkedFiles, {\n prompt_completed: true,\n declined: false,\n declined_at: \"\",\n });\n }\n}\n\nfunction handleDeclinedAgentGuidance(flow: InitAgentGuidanceFlowState): void {\n flow.skipped = true;\n flow.warnings.push(\"agent_guidance:skipped_declined\");\n pushUnique(flow.nextSteps, AGENT_GUIDANCE_ADD_LATER_HINT);\n}\n\nasync function handleInteractiveAgentGuidancePrompt(\n flow: InitAgentGuidanceFlowState,\n context: InitAgentGuidanceModeContext,\n): Promise<void> {\n flow.prompted = true;\n const approved = await promptForGuidanceWrite(context.targetRelativePath);\n if (approved) {\n await addAgentGuidanceBlockIfMissing(flow, context);\n markAgentGuidanceRunState(flow, context.checkedFiles, {\n prompt_completed: true,\n declined: false,\n declined_at: \"\",\n });\n return;\n }\n flow.skipped = true;\n markAgentGuidanceRunState(flow, context.checkedFiles, {\n prompt_completed: true,\n declined: true,\n declined_at: new Date().toISOString(),\n });\n flow.warnings.push(\"agent_guidance:declined\");\n pushUnique(flow.nextSteps, AGENT_GUIDANCE_ADD_LATER_HINT);\n}\n\nfunction handleNonInteractiveMissingAgentGuidance(flow: InitAgentGuidanceFlowState): void {\n flow.warnings.push(\"agent_guidance:missing_non_interactive\");\n pushUnique(flow.nextSteps, AGENT_GUIDANCE_ADD_LATER_HINT);\n}\n\nasync function applyAgentGuidanceMode(\n initialState: PmSettings[\"agent_guidance\"],\n context: InitAgentGuidanceModeContext,\n): Promise<InitAgentGuidanceFlowState> {\n const flow: InitAgentGuidanceFlowState = {\n warnings: [],\n nextSteps: [],\n prompted: false,\n applied: false,\n skipped: false,\n state: initialState,\n };\n\n if (context.mode === \"status\") {\n handleAgentGuidanceStatusMode(flow, context.presentBefore);\n return flow;\n }\n if (context.mode === \"skip\") {\n handleAgentGuidanceSkipMode(flow, context.checkedFiles);\n return flow;\n }\n if (context.mode === \"add\") {\n await handleAgentGuidanceAddMode(flow, context);\n return flow;\n }\n if (context.presentBefore) {\n handlePresentAgentGuidance(flow, context.checkedFiles);\n return flow;\n }\n if (flow.state.prompt_completed && flow.state.declined) {\n handleDeclinedAgentGuidance(flow);\n return flow;\n }\n if (context.interactive) {\n await handleInteractiveAgentGuidancePrompt(flow, context);\n return flow;\n }\n handleNonInteractiveMissingAgentGuidance(flow);\n return flow;\n}\n\n/**\n * Implements run init agent guidance for the public runtime surface of this module.\n */\nexport async function runInitAgentGuidance(options: RunInitAgentGuidanceOptions): Promise<RunInitAgentGuidanceResult> {\n const projectRoot = resolveProjectRoot(options.pm_root, options.cwd);\n let scans = await scanGuidanceFiles(projectRoot);\n const targetPath = resolveTargetGuidancePath(scans, projectRoot);\n const targetRelativePath = toPortableRelativePath(projectRoot, targetPath);\n const checkedFiles = scans.map((entry) => toPortableRelativePath(projectRoot, entry.file_path));\n const presentBefore = scans.some((entry) => entry.has_guidance);\n const flow = await applyAgentGuidanceMode(normalizeAgentGuidanceState(options.settings), {\n mode: options.mode,\n interactive: options.interactive,\n targetPath,\n targetRelativePath,\n checkedFiles,\n presentBefore,\n });\n\n const stateUpdate = applyAgentGuidanceState(options.settings, flow.state);\n scans = await refreshGuidanceScansAfterApply(flow.applied, scans, projectRoot);\n\n const summary = buildInitAgentGuidanceSummary({\n mode: options.mode,\n scans,\n projectRoot,\n targetRelativePath,\n prompted: flow.prompted,\n applied: flow.applied,\n skipped: flow.skipped,\n state: flow.state,\n });\n\n return {\n summary,\n warnings: flow.warnings,\n next_steps: flow.nextSteps,\n settings_changed: stateUpdate.changed,\n };\n}\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,KAAK,IAAI,KAAK,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAQvD,MAAM,CAAC,MAAM,+BAA+B,GAA4B,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,QA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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]="a0acfeba-010e-51e0-bc49-90e4854fe975")}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]="df631c25-0bdb-52e7-aec4-a83f25fdfa91")}catch(e){}}();
8
8
  import fs from "node:fs/promises";
9
9
  import path from "node:path";
10
10
  import readline from "node:readline/promises";
@@ -556,7 +556,7 @@ export async function runInit(prefixArg, global, options = {}) {
556
556
  const settingsPath = path.join(pmRoot, "settings.json");
557
557
  const settingsExists = await pathExists(settingsPath);
558
558
  const normalizedOptions = normalizeInitCommandOptions(options);
559
- let settingsResolution = await resolveInitSettings({
559
+ const settingsResolution = await resolveInitSettings({
560
560
  pmRoot,
561
561
  settingsPath,
562
562
  settingsExists,
@@ -608,4 +608,4 @@ export async function runInit(prefixArg, global, options = {}) {
608
608
  };
609
609
  }
610
610
  //# sourceMappingURL=init.js.map
611
- //# debugId=a0acfeba-010e-51e0-bc49-90e4854fe975
611
+ //# debugId=df631c25-0bdb-52e7-aec4-a83f25fdfa91