@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
@@ -13,7 +13,7 @@
13
13
  * helper bodies while keeping each package's explicit field mapping in the package.
14
14
  */
15
15
 
16
- !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]="181a7b79-ce2a-5874-96db-7beb948a9859")}catch(e){}}();
16
+ !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]="75dc8e31-81cb-5c87-93a6-b4fa03327a18")}catch(e){}}();
17
17
  import { appendHistoryEntry, createHistoryEntry } from "../core/history/history.js";
18
18
  import { acquireLock } from "../core/lock/lock.js";
19
19
  import { parseTags } from "../core/item/parse.js";
@@ -94,6 +94,143 @@ export function toImportStatus(value) {
94
94
  }
95
95
  return "open";
96
96
  }
97
+ /**
98
+ * Coerces a finite integer from a number or non-empty numeric string.
99
+ */
100
+ export function toImportInteger(value) {
101
+ if (typeof value === "number" && Number.isInteger(value)) {
102
+ return value;
103
+ }
104
+ if (typeof value !== "string" || value.trim().length === 0) {
105
+ return undefined;
106
+ }
107
+ const parsed = Number(value);
108
+ return Number.isInteger(parsed) ? parsed : undefined;
109
+ }
110
+ /**
111
+ * Coerces common boolean representations used by external package formats.
112
+ */
113
+ export function toImportBoolean(value) {
114
+ if (typeof value === "boolean") {
115
+ return value;
116
+ }
117
+ if (typeof value === "number") {
118
+ return value === 1 ? true : value === 0 ? false : undefined;
119
+ }
120
+ if (typeof value !== "string") {
121
+ return undefined;
122
+ }
123
+ const normalized = value.trim().toLowerCase();
124
+ if (normalized === "true" || normalized === "1") {
125
+ return true;
126
+ }
127
+ return normalized === "false" || normalized === "0" ? false : undefined;
128
+ }
129
+ /**
130
+ * Coerces an array of non-empty strings.
131
+ */
132
+ export function toImportStringList(value) {
133
+ if (!Array.isArray(value)) {
134
+ return undefined;
135
+ }
136
+ const entries = value
137
+ .map((entry) => toNonEmptyImportString(entry))
138
+ .filter((entry) => entry !== undefined);
139
+ return entries.length > 0 ? entries : undefined;
140
+ }
141
+ /**
142
+ * Coerces a record of non-empty string values.
143
+ */
144
+ export function toImportStringMap(value) {
145
+ return toImportValueMap(value, toNonEmptyImportString);
146
+ }
147
+ /**
148
+ * Coerces a record of finite numeric values.
149
+ */
150
+ export function toImportNumberMap(value) {
151
+ return toImportValueMap(value, toImportFiniteNumber);
152
+ }
153
+ /**
154
+ * Maps a loose source confidence value onto pm's confidence field.
155
+ */
156
+ export function toImportConfidence(value, allowedTextValues) {
157
+ if (typeof value === "number" && Number.isInteger(value) && value >= 0 && value <= 100) {
158
+ return value;
159
+ }
160
+ const normalized = toNonEmptyImportString(value)?.toLowerCase();
161
+ if (!normalized) {
162
+ return undefined;
163
+ }
164
+ const candidate = normalized === "med" ? "medium" : normalized;
165
+ if (allowedTextValues.some((entry) => entry === candidate)) {
166
+ return candidate;
167
+ }
168
+ const parsed = Number(candidate);
169
+ return Number.isInteger(parsed) && parsed >= 0 && parsed <= 100 ? parsed : undefined;
170
+ }
171
+ /**
172
+ * Maps a string onto an allowed enum value, including the common "med" alias.
173
+ */
174
+ export function toImportNormalizedEnum(value, allowed) {
175
+ const normalized = toNonEmptyImportString(value)?.toLowerCase();
176
+ if (!normalized) {
177
+ return undefined;
178
+ }
179
+ const candidate = normalized === "med" ? "medium" : normalized;
180
+ return allowed.includes(candidate) ? candidate : undefined;
181
+ }
182
+ /**
183
+ * Resolves pm linked-artifact scope values, defaulting to project scope.
184
+ */
185
+ export function toImportLinkScope(value) {
186
+ return toNonEmptyImportString(value)?.toLowerCase() === "global" ? "global" : "project";
187
+ }
188
+ /**
189
+ * Converts source comments, notes, or learnings into pm log notes.
190
+ */
191
+ export function toImportLogEntries(value, options) {
192
+ const values = normalizeImportCollection(value, options.allowScalar === true);
193
+ if (!values) {
194
+ return undefined;
195
+ }
196
+ const entries = values
197
+ .map((entry) => toImportLogEntry(entry, options))
198
+ .filter((entry) => entry !== undefined);
199
+ return entries.length > 0 ? entries : undefined;
200
+ }
201
+ /**
202
+ * Converts source file artifacts into pm linked files.
203
+ */
204
+ export function toImportLinkedFiles(value, options = {}) {
205
+ return toImportLinkedArtifacts(value, options, (pathValue, record) => ({
206
+ path: pathValue,
207
+ scope: toImportLinkScope(record?.scope),
208
+ note: toNonEmptyImportString(record?.note),
209
+ }));
210
+ }
211
+ /**
212
+ * Converts source doc artifacts into pm linked docs.
213
+ */
214
+ export function toImportLinkedDocs(value, options = {}) {
215
+ return toImportLinkedArtifacts(value, options, (pathValue, record) => ({
216
+ path: pathValue,
217
+ scope: toImportLinkScope(record?.scope),
218
+ note: toNonEmptyImportString(record?.note),
219
+ }));
220
+ }
221
+ /**
222
+ * Converts source test artifacts into pm linked tests.
223
+ */
224
+ export function toImportLinkedTests(value, options = {}) {
225
+ const values = normalizeImportCollection(value, options.allowScalar === true);
226
+ if (!values) {
227
+ return undefined;
228
+ }
229
+ const entries = values
230
+ .map((entry) => toImportLinkedTest(entry, options))
231
+ .filter((entry) => entry !== undefined);
232
+ return entries.length > 0 ? entries : undefined;
233
+ }
97
234
  /**
98
235
  * Resolves the effective import author: explicit flag, PM_AUTHOR, then settings,
99
236
  * falling back to "unknown".
@@ -110,6 +247,141 @@ export function selectImportAuthor(explicitAuthor, settingsAuthor) {
110
247
  const settings = settingsAuthor.trim();
111
248
  return settings.length > 0 ? settings : "unknown";
112
249
  }
250
+ function isImportRecord(value) {
251
+ return typeof value === "object" && value !== null && !Array.isArray(value);
252
+ }
253
+ function normalizeImportCollection(value, allowScalar) {
254
+ if (Array.isArray(value)) {
255
+ return value;
256
+ }
257
+ return allowScalar ? [value] : undefined;
258
+ }
259
+ function firstNonEmptyImportString(record, keys) {
260
+ for (const key of keys) {
261
+ const value = toNonEmptyImportString(record[key]);
262
+ if (value) {
263
+ return value;
264
+ }
265
+ }
266
+ return undefined;
267
+ }
268
+ function toImportValueMap(value, coerce) {
269
+ if (!isImportRecord(value)) {
270
+ return undefined;
271
+ }
272
+ const entries = Object.entries(value)
273
+ .map(([key, entryValue]) => [key.trim(), coerce(entryValue)])
274
+ .filter((entry) => entry[0].length > 0 && entry[1] !== undefined);
275
+ return entries.length > 0 ? Object.fromEntries(entries) : undefined;
276
+ }
277
+ function toImportLogEntry(entry, options) {
278
+ if (typeof entry === "string") {
279
+ return toImportLogEntryFromText(entry, options);
280
+ }
281
+ if (!isImportRecord(entry)) {
282
+ return undefined;
283
+ }
284
+ const text = firstNonEmptyImportString(entry, options.textKeys ?? ["text"]);
285
+ if (!text) {
286
+ return undefined;
287
+ }
288
+ const createdAtKey = options.createdAtKey ?? "created_at";
289
+ const authorKey = options.authorKey ?? "author";
290
+ const createdAt = (options.toIsoString ? options.toIsoString(entry[createdAtKey]) : toNonEmptyImportString(entry[createdAtKey])) ??
291
+ options.fallbackCreatedAt;
292
+ return {
293
+ created_at: createdAt,
294
+ author: toNonEmptyImportString(entry[authorKey]) ?? options.fallbackAuthor,
295
+ text,
296
+ };
297
+ }
298
+ function toImportLogEntryFromText(entry, options) {
299
+ const text = toNonEmptyImportString(entry);
300
+ return text
301
+ ? {
302
+ created_at: options.fallbackCreatedAt,
303
+ author: options.fallbackAuthor,
304
+ text,
305
+ }
306
+ : undefined;
307
+ }
308
+ function toImportLinkedArtifacts(value, options, build) {
309
+ const values = normalizeImportCollection(value, options.allowScalar === true);
310
+ if (!values) {
311
+ return undefined;
312
+ }
313
+ const pathKeys = options.pathKeys ?? ["path"];
314
+ const entries = values
315
+ .map((entry) => toImportLinkedArtifact(entry, pathKeys, build))
316
+ .filter((entry) => entry !== undefined);
317
+ return entries.length > 0 ? entries : undefined;
318
+ }
319
+ function toImportLinkedArtifact(entry, pathKeys, build) {
320
+ if (typeof entry === "string") {
321
+ const pathValue = toNonEmptyImportString(entry);
322
+ return pathValue ? build(pathValue) : undefined;
323
+ }
324
+ if (!isImportRecord(entry)) {
325
+ return undefined;
326
+ }
327
+ const pathValue = firstNonEmptyImportString(entry, pathKeys);
328
+ return pathValue ? build(pathValue, entry) : undefined;
329
+ }
330
+ function toImportLinkedTest(entry, options) {
331
+ if (typeof entry === "string") {
332
+ const command = toNonEmptyImportString(entry);
333
+ return command ? { command, scope: "project" } : undefined;
334
+ }
335
+ if (!isImportRecord(entry)) {
336
+ return undefined;
337
+ }
338
+ const command = firstNonEmptyImportString(entry, options.commandKeys ?? ["command"]);
339
+ const testPath = firstNonEmptyImportString(entry, options.pathKeys ?? ["path"]);
340
+ if (!command && (options.requireCommand === true || !testPath)) {
341
+ return undefined;
342
+ }
343
+ return {
344
+ ...(command ? { command } : {}),
345
+ ...(testPath ? { path: testPath } : {}),
346
+ scope: toImportLinkScope(entry.scope),
347
+ timeout_seconds: toImportLinkedTestTimeout(entry.timeout_seconds, options),
348
+ note: toNonEmptyImportString(entry.note),
349
+ ...(options.includeExtendedAssertions === true ? toImportLinkedTestAssertions(entry) : {}),
350
+ };
351
+ }
352
+ function toImportLinkedTestTimeout(value, options) {
353
+ const parsed = options.integerTimeout === true ? toImportInteger(value) : toImportFiniteNumber(value);
354
+ if (parsed === undefined) {
355
+ return undefined;
356
+ }
357
+ const minimum = options.timeoutMinimum ?? 0;
358
+ return options.timeoutExclusiveMinimum === true ? (parsed > minimum ? parsed : undefined) : parsed >= minimum ? parsed : undefined;
359
+ }
360
+ function toImportFiniteNumber(value) {
361
+ if (typeof value === "number" && Number.isFinite(value)) {
362
+ return value;
363
+ }
364
+ if (typeof value !== "string" || value.trim().length === 0) {
365
+ return undefined;
366
+ }
367
+ const parsed = Number(value);
368
+ return Number.isFinite(parsed) ? parsed : undefined;
369
+ }
370
+ function toImportLinkedTestAssertions(entry) {
371
+ return {
372
+ pm_context_mode: toImportNormalizedEnum(entry.pm_context_mode, ["schema", "tracker", "auto"]),
373
+ env_set: toImportStringMap(entry.env_set),
374
+ env_clear: toImportStringList(entry.env_clear),
375
+ shared_host_safe: toImportBoolean(entry.shared_host_safe),
376
+ assert_stdout_contains: toImportStringList(entry.assert_stdout_contains),
377
+ assert_stdout_regex: toImportStringList(entry.assert_stdout_regex),
378
+ assert_stderr_contains: toImportStringList(entry.assert_stderr_contains),
379
+ assert_stderr_regex: toImportStringList(entry.assert_stderr_regex),
380
+ assert_stdout_min_lines: toImportInteger(entry.assert_stdout_min_lines),
381
+ assert_json_field_equals: toImportStringMap(entry.assert_json_field_equals),
382
+ assert_json_field_gte: toImportNumberMap(entry.assert_json_field_gte),
383
+ };
384
+ }
113
385
  /**
114
386
  * Throws a NOT_FOUND PmCliError when the tracker has not been initialized.
115
387
  */
@@ -194,4 +466,4 @@ export async function commitImportedItem(params) {
194
466
  }
195
467
  }
196
468
  //# sourceMappingURL=package-import-adapters.js.map
197
- //# debugId=181a7b79-ce2a-5874-96db-7beb948a9859
469
+ //# debugId=75dc8e31-81cb-5c87-93a6-b4fa03327a18
@@ -1 +1 @@
1
- {"version":3,"file":"package-import-adapters.js","sources":["sdk/package-import-adapters.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Shared external-source import adapter primitives for bundled pm packages.\n *\n * The Beads (pm-beads) and Todos (pm-todos) importers map records from an\n * external format into pm items. The field-by-field mapping is intentionally\n * package-specific (different source schemas, type vocabularies, and timestamp\n * rules), but a number of value-coercion helpers and the item write/commit\n * sequence are behavior-identical across both adapters.\n *\n * These primitives are re-exported from the SDK runtime surface (`src/sdk/runtime.ts`),\n * which is the only module bundled packages are permitted to import (they load it\n * at runtime via `PM_CLI_PACKAGE_ROOT`). Centralizing them here removes copy-pasted\n * helper bodies while keeping each package's explicit field mapping in the package.\n */\n\nimport { appendHistoryEntry, createHistoryEntry } from \"../core/history/history.js\";\nimport { acquireLock } from \"../core/lock/lock.js\";\nimport { parseTags } from \"../core/item/parse.js\";\nimport { normalizeStatusInput } from \"../core/item/status.js\";\nimport { serializeItemDocument } from \"../core/item/item-format.js\";\nimport { getHistoryPath, getSettingsPath } from \"../core/store/paths.js\";\nimport { pathExists, removeFileIfExists, writeFileAtomic } from \"../core/fs/fs-utils.js\";\nimport { runActiveOnWriteHooks } from \"../core/extensions/index.js\";\nimport { EXIT_CODE } from \"../core/shared/constants.js\";\nimport { PmCliError } from \"../core/shared/errors.js\";\nimport { nowIso } from \"../core/shared/time.js\";\nimport type { ItemDocument, ItemMetadata, ItemStatus, PmSettings } from \"../types/index.js\";\n\n/**\n * Returns the trimmed string when `value` is a non-empty string, else undefined.\n */\nexport function toNonEmptyImportString(value: unknown): string | undefined {\n if (typeof value !== \"string\") {\n return undefined;\n }\n const trimmed = value.trim();\n return trimmed.length > 0 ? trimmed : undefined;\n}\n\n/**\n * Coerces a non-negative finite numeric estimate (number or numeric string).\n */\nexport function toEstimatedMinutesValue(value: unknown): number | undefined {\n if (typeof value === \"number\" && Number.isFinite(value) && value >= 0) {\n return value;\n }\n if (typeof value === \"string\" && value.trim().length > 0) {\n const parsed = Number(value);\n if (Number.isFinite(parsed) && parsed >= 0) {\n return parsed;\n }\n }\n return undefined;\n}\n\n/**\n * Coerces a priority into the 0..4 range, defaulting to 2.\n */\nexport function toImportPriority(value: unknown): 0 | 1 | 2 | 3 | 4 {\n if (typeof value === \"number\" && Number.isInteger(value) && value >= 0 && value <= 4) {\n return value as 0 | 1 | 2 | 3 | 4;\n }\n if (typeof value === \"string\" && value.trim().length > 0) {\n const parsed = Number(value);\n if (Number.isInteger(parsed) && parsed >= 0 && parsed <= 4) {\n return parsed as 0 | 1 | 2 | 3 | 4;\n }\n }\n return 2;\n}\n\n/**\n * Normalizes tags from an array of strings or a comma-separated string.\n */\nexport function toImportTags(value: unknown): string[] {\n if (Array.isArray(value)) {\n const tags = value\n .filter((entry): entry is string => typeof entry === \"string\")\n .map((entry) => entry.trim().toLowerCase())\n .filter((entry) => entry.length > 0);\n return Array.from(new Set(tags)).sort((left, right) => left.localeCompare(right));\n }\n if (typeof value === \"string\") {\n return parseTags(value);\n }\n return [];\n}\n\n/**\n * Maps a raw status value to a canonical pm status, defaulting to \"open\".\n */\nexport function toImportStatus(value: unknown): ItemStatus {\n const normalized = toNonEmptyImportString(value);\n if (normalized) {\n const canonical = normalizeStatusInput(normalized);\n if (canonical) {\n return canonical;\n }\n }\n return \"open\";\n}\n\n/**\n * Resolves the effective import author: explicit flag, PM_AUTHOR, then settings,\n * falling back to \"unknown\".\n */\nexport function selectImportAuthor(explicitAuthor: string | undefined, settingsAuthor: string): string {\n const explicit = explicitAuthor?.trim();\n if (explicit && explicit.length > 0) {\n return explicit;\n }\n const envAuthor = process.env.PM_AUTHOR?.trim();\n if (envAuthor && envAuthor.length > 0) {\n return envAuthor;\n }\n const settings = settingsAuthor.trim();\n return settings.length > 0 ? settings : \"unknown\";\n}\n\n/**\n * Throws a NOT_FOUND PmCliError when the tracker has not been initialized.\n */\nexport async function ensureTrackerInitialized(pmRoot: string): Promise<void> {\n const exists = await pathExists(getSettingsPath(pmRoot));\n if (!exists) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n}\n\n/**\n * Returns an empty item document used as the `before` state on import.\n */\nexport function emptyImportedDocument(): ItemDocument {\n return {\n metadata: {} as ItemMetadata,\n body: \"\",\n };\n}\n\n/**\n * Documents the commit imported item params payload exchanged by command, SDK, and package integrations.\n */\nexport interface CommitImportedItemParams {\n pmRoot: string;\n id: string;\n itemPath: string;\n document: ItemDocument;\n author: string;\n message: string;\n settings: PmSettings;\n /** Warning prefix emitted on a lock conflict, e.g. \"beads_import_lock_conflict\". */\n conflictWarningPrefix: string;\n}\n\n/**\n * Restricts commit imported item result values accepted by command, SDK, and storage contracts.\n */\nexport type CommitImportedItemResult =\n | { committed: true; writeWarnings: string[] }\n | { committed: false; conflictWarning: string };\n\n/**\n * Performs the shared item write/commit sequence: acquire the per-item lock,\n * atomically write the TOON document, append the import history entry, and run\n * on-write hooks. On a lock CONFLICT it returns a `conflictWarning` (using the\n * caller-supplied prefix) instead of throwing; any other error removes the\n * partially written file and rethrows.\n */\nexport async function commitImportedItem(\n params: CommitImportedItemParams,\n): Promise<CommitImportedItemResult> {\n const { pmRoot, id, itemPath, document, author, message, settings, conflictWarningPrefix } = params;\n const historyPath = getHistoryPath(pmRoot, id);\n const beforeDocument = emptyImportedDocument();\n try {\n const releaseLock = await acquireLock(pmRoot, id, settings.locks.ttl_seconds, author);\n try {\n await writeFileAtomic(itemPath, serializeItemDocument(document, { format: \"toon\" }));\n try {\n const entry = createHistoryEntry({\n nowIso: nowIso(),\n author,\n op: \"import\",\n before: beforeDocument,\n after: document,\n message,\n });\n await appendHistoryEntry(historyPath, entry);\n const writeWarnings = [\n ...(await runActiveOnWriteHooks({\n path: itemPath,\n scope: \"project\",\n op: \"import\",\n item_id: document.metadata.id,\n item_type: document.metadata.type,\n before: beforeDocument,\n after: document,\n changed_fields: [\"imported\"],\n })),\n ...(await runActiveOnWriteHooks({\n path: historyPath,\n scope: \"project\",\n op: \"import:history\",\n item_id: document.metadata.id,\n item_type: document.metadata.type,\n before: beforeDocument,\n after: document,\n changed_fields: [\"imported\"],\n })),\n ];\n return { committed: true, writeWarnings };\n } catch (error: unknown) {\n await removeFileIfExists(itemPath);\n throw error;\n }\n } finally {\n await releaseLock();\n }\n } catch (error: unknown) {\n if (error instanceof PmCliError && error.exitCode === EXIT_CODE.CONFLICT) {\n return { committed: false, conflictWarning: `${conflictWarningPrefix}:${id}` };\n }\n throw error;\n }\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;;;AAEH,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAC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AAQ,CAAC,QAAQ,CAAC,EAAE;wBAC7B,SAAS,EAAE,QAAQ,CAAC,QAAQ,CAAC,IAAI;wBACjC,MAAM,EAAE,cAAc;wBACtB,KAAK,EAAE,QAAQ;wBACf,cAAc,EAAE,CAAC,UAAU,CAAC;qBAC7B,CAAC,CAAC;iBACJ,CAAC;gBACF,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;YAC5C,CAAC;YAAC,OAAO,KAAc,EAAE,CAAC;gBACxB,MAAM,kBAAkB,CAAC,QAAQ,CAAC,CAAC;gBACnC,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC;gBAAS,CAAC;YACT,MAAM,WAAW,EAAE,CAAC;QACtB,CAAC;IACH,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,IAAI,KAAK,YAAY,UAAU,IAAI,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC,QAAQ,EAAE,CAAC;YACzE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,eAAe,EAAE,GAAG,qBAAqB,IAAI,EAAE,EAAE,EAAE,CAAC;QACjF,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC","debugId":"181a7b79-ce2a-5874-96db-7beb948a9859"}
1
+ {"version":3,"file":"package-import-adapters.js","sources":["sdk/package-import-adapters.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Shared external-source import adapter primitives for bundled pm packages.\n *\n * The Beads (pm-beads) and Todos (pm-todos) importers map records from an\n * external format into pm items. The field-by-field mapping is intentionally\n * package-specific (different source schemas, type vocabularies, and timestamp\n * rules), but a number of value-coercion helpers and the item write/commit\n * sequence are behavior-identical across both adapters.\n *\n * These primitives are re-exported from the SDK runtime surface (`src/sdk/runtime.ts`),\n * which is the only module bundled packages are permitted to import (they load it\n * at runtime via `PM_CLI_PACKAGE_ROOT`). Centralizing them here removes copy-pasted\n * helper bodies while keeping each package's explicit field mapping in the package.\n */\n\nimport { appendHistoryEntry, createHistoryEntry } from \"../core/history/history.js\";\nimport { acquireLock } from \"../core/lock/lock.js\";\nimport { parseTags } from \"../core/item/parse.js\";\nimport { normalizeStatusInput } from \"../core/item/status.js\";\nimport { serializeItemDocument } from \"../core/item/item-format.js\";\nimport { getHistoryPath, getSettingsPath } from \"../core/store/paths.js\";\nimport { pathExists, removeFileIfExists, writeFileAtomic } from \"../core/fs/fs-utils.js\";\nimport { runActiveOnWriteHooks } from \"../core/extensions/index.js\";\nimport { EXIT_CODE } from \"../core/shared/constants.js\";\nimport { PmCliError } from \"../core/shared/errors.js\";\nimport { nowIso } from \"../core/shared/time.js\";\nimport type {\n Dependency,\n ConfidenceTextLevel,\n ItemDocument,\n ItemMetadata,\n ItemStatus,\n LinkedDoc,\n LinkedFile,\n LinkedTest,\n LogNote,\n PmSettings,\n} from \"../types/index.js\";\n\n/**\n * Restricts shared import priority values accepted by import adapters.\n */\nexport type ImportPriorityValue = 0 | 1 | 2 | 3 | 4;\n\n/**\n * Restricts import linked-artifact scopes accepted by bundled package adapters.\n */\nexport type ImportLinkedScope = \"project\" | \"global\";\n\n/**\n * Configures conversion of loosely shaped source comments into pm log entries.\n */\nexport interface ToImportLogEntriesOptions {\n fallbackCreatedAt: string;\n fallbackAuthor: string;\n allowScalar?: boolean;\n textKeys?: readonly string[];\n createdAtKey?: string;\n authorKey?: string;\n toIsoString?: (value: unknown) => string | undefined;\n}\n\n/**\n * Configures conversion of loosely shaped source file/doc arrays into pm linked artifacts.\n */\nexport interface ToImportLinkedArtifactsOptions {\n allowScalar?: boolean;\n pathKeys?: readonly string[];\n}\n\n/**\n * Configures conversion of loosely shaped source test arrays into pm linked tests.\n */\nexport interface ToImportLinkedTestsOptions {\n allowScalar?: boolean;\n commandKeys?: readonly string[];\n pathKeys?: readonly string[];\n requireCommand?: boolean;\n includeExtendedAssertions?: boolean;\n integerTimeout?: boolean;\n timeoutMinimum?: number;\n timeoutExclusiveMinimum?: boolean;\n}\n\n/**\n * Returns the trimmed string when `value` is a non-empty string, else undefined.\n */\nexport function toNonEmptyImportString(value: unknown): string | undefined {\n if (typeof value !== \"string\") {\n return undefined;\n }\n const trimmed = value.trim();\n return trimmed.length > 0 ? trimmed : undefined;\n}\n\n/**\n * Coerces a non-negative finite numeric estimate (number or numeric string).\n */\nexport function toEstimatedMinutesValue(value: unknown): number | undefined {\n if (typeof value === \"number\" && Number.isFinite(value) && value >= 0) {\n return value;\n }\n if (typeof value === \"string\" && value.trim().length > 0) {\n const parsed = Number(value);\n if (Number.isFinite(parsed) && parsed >= 0) {\n return parsed;\n }\n }\n return undefined;\n}\n\n/**\n * Coerces a priority into the 0..4 range, defaulting to 2.\n */\nexport function toImportPriority(value: unknown): ImportPriorityValue {\n if (typeof value === \"number\" && Number.isInteger(value) && value >= 0 && value <= 4) {\n return value as ImportPriorityValue;\n }\n if (typeof value === \"string\" && value.trim().length > 0) {\n const parsed = Number(value);\n if (Number.isInteger(parsed) && parsed >= 0 && parsed <= 4) {\n return parsed as ImportPriorityValue;\n }\n }\n return 2;\n}\n\n/**\n * Normalizes tags from an array of strings or a comma-separated string.\n */\nexport function toImportTags(value: unknown): string[] {\n if (Array.isArray(value)) {\n const tags = value\n .filter((entry): entry is string => typeof entry === \"string\")\n .map((entry) => entry.trim().toLowerCase())\n .filter((entry) => entry.length > 0);\n return Array.from(new Set(tags)).sort((left, right) => left.localeCompare(right));\n }\n if (typeof value === \"string\") {\n return parseTags(value);\n }\n return [];\n}\n\n/**\n * Maps a raw status value to a canonical pm status, defaulting to \"open\".\n */\nexport function toImportStatus(value: unknown): ItemStatus {\n const normalized = toNonEmptyImportString(value);\n if (normalized) {\n const canonical = normalizeStatusInput(normalized);\n if (canonical) {\n return canonical;\n }\n }\n return \"open\";\n}\n\n/**\n * Coerces a finite integer from a number or non-empty numeric string.\n */\nexport function toImportInteger(value: unknown): number | undefined {\n if (typeof value === \"number\" && Number.isInteger(value)) {\n return value;\n }\n if (typeof value !== \"string\" || value.trim().length === 0) {\n return undefined;\n }\n const parsed = Number(value);\n return Number.isInteger(parsed) ? parsed : undefined;\n}\n\n/**\n * Coerces common boolean representations used by external package formats.\n */\nexport function toImportBoolean(value: unknown): boolean | undefined {\n if (typeof value === \"boolean\") {\n return value;\n }\n if (typeof value === \"number\") {\n return value === 1 ? true : value === 0 ? false : undefined;\n }\n if (typeof value !== \"string\") {\n return undefined;\n }\n const normalized = value.trim().toLowerCase();\n if (normalized === \"true\" || normalized === \"1\") {\n return true;\n }\n return normalized === \"false\" || normalized === \"0\" ? false : undefined;\n}\n\n/**\n * Coerces an array of non-empty strings.\n */\nexport function toImportStringList(value: unknown): string[] | undefined {\n if (!Array.isArray(value)) {\n return undefined;\n }\n const entries = value\n .map((entry) => toNonEmptyImportString(entry))\n .filter((entry): entry is string => entry !== undefined);\n return entries.length > 0 ? entries : undefined;\n}\n\n/**\n * Coerces a record of non-empty string values.\n */\nexport function toImportStringMap(value: unknown): Record<string, string> | undefined {\n return toImportValueMap(value, toNonEmptyImportString);\n}\n\n/**\n * Coerces a record of finite numeric values.\n */\nexport function toImportNumberMap(value: unknown): Record<string, number> | undefined {\n return toImportValueMap(value, toImportFiniteNumber);\n}\n\n/**\n * Maps a loose source confidence value onto pm's confidence field.\n */\nexport function toImportConfidence(\n value: unknown,\n allowedTextValues: readonly ConfidenceTextLevel[],\n): ItemMetadata[\"confidence\"] | undefined {\n if (typeof value === \"number\" && Number.isInteger(value) && value >= 0 && value <= 100) {\n return value;\n }\n const normalized = toNonEmptyImportString(value)?.toLowerCase();\n if (!normalized) {\n return undefined;\n }\n const candidate = normalized === \"med\" ? \"medium\" : normalized;\n if (allowedTextValues.some((entry) => entry === candidate)) {\n return candidate as ConfidenceTextLevel;\n }\n const parsed = Number(candidate);\n return Number.isInteger(parsed) && parsed >= 0 && parsed <= 100 ? parsed : undefined;\n}\n\n/**\n * Maps a string onto an allowed enum value, including the common \"med\" alias.\n */\nexport function toImportNormalizedEnum<T extends readonly string[]>(\n value: unknown,\n allowed: T,\n): T[number] | undefined {\n const normalized = toNonEmptyImportString(value)?.toLowerCase();\n if (!normalized) {\n return undefined;\n }\n const candidate = normalized === \"med\" ? \"medium\" : normalized;\n return allowed.includes(candidate as T[number]) ? (candidate as T[number]) : undefined;\n}\n\n/**\n * Resolves pm linked-artifact scope values, defaulting to project scope.\n */\nexport function toImportLinkScope(value: unknown): ImportLinkedScope {\n return toNonEmptyImportString(value)?.toLowerCase() === \"global\" ? \"global\" : \"project\";\n}\n\n/**\n * Converts source comments, notes, or learnings into pm log notes.\n */\nexport function toImportLogEntries(value: unknown, options: ToImportLogEntriesOptions): LogNote[] | undefined {\n const values = normalizeImportCollection(value, options.allowScalar === true);\n if (!values) {\n return undefined;\n }\n const entries = values\n .map((entry) => toImportLogEntry(entry, options))\n .filter((entry): entry is LogNote => entry !== undefined);\n return entries.length > 0 ? entries : undefined;\n}\n\n/**\n * Converts source file artifacts into pm linked files.\n */\nexport function toImportLinkedFiles(value: unknown, options: ToImportLinkedArtifactsOptions = {}): LinkedFile[] | undefined {\n return toImportLinkedArtifacts(value, options, (pathValue, record) => ({\n path: pathValue,\n scope: toImportLinkScope(record?.scope),\n note: toNonEmptyImportString(record?.note),\n }));\n}\n\n/**\n * Converts source doc artifacts into pm linked docs.\n */\nexport function toImportLinkedDocs(value: unknown, options: ToImportLinkedArtifactsOptions = {}): LinkedDoc[] | undefined {\n return toImportLinkedArtifacts(value, options, (pathValue, record) => ({\n path: pathValue,\n scope: toImportLinkScope(record?.scope),\n note: toNonEmptyImportString(record?.note),\n }));\n}\n\n/**\n * Converts source test artifacts into pm linked tests.\n */\nexport function toImportLinkedTests(value: unknown, options: ToImportLinkedTestsOptions = {}): LinkedTest[] | undefined {\n const values = normalizeImportCollection(value, options.allowScalar === true);\n if (!values) {\n return undefined;\n }\n const entries = values\n .map((entry) => toImportLinkedTest(entry, options))\n .filter((entry): entry is LinkedTest => entry !== undefined);\n return entries.length > 0 ? entries : undefined;\n}\n\n/**\n * Resolves the effective import author: explicit flag, PM_AUTHOR, then settings,\n * falling back to \"unknown\".\n */\nexport function selectImportAuthor(explicitAuthor: string | undefined, settingsAuthor: string): string {\n const explicit = explicitAuthor?.trim();\n if (explicit && explicit.length > 0) {\n return explicit;\n }\n const envAuthor = process.env.PM_AUTHOR?.trim();\n if (envAuthor && envAuthor.length > 0) {\n return envAuthor;\n }\n const settings = settingsAuthor.trim();\n return settings.length > 0 ? settings : \"unknown\";\n}\n\nfunction isImportRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction normalizeImportCollection(value: unknown, allowScalar: boolean): unknown[] | undefined {\n if (Array.isArray(value)) {\n return value;\n }\n return allowScalar ? [value] : undefined;\n}\n\nfunction firstNonEmptyImportString(record: Record<string, unknown>, keys: readonly string[]): string | undefined {\n for (const key of keys) {\n const value = toNonEmptyImportString(record[key]);\n if (value) {\n return value;\n }\n }\n return undefined;\n}\n\nfunction toImportValueMap<T>(\n value: unknown,\n coerce: (entryValue: unknown) => T | undefined,\n): Record<string, T> | undefined {\n if (!isImportRecord(value)) {\n return undefined;\n }\n const entries = Object.entries(value)\n .map(([key, entryValue]) => [key.trim(), coerce(entryValue)] as const)\n .filter((entry): entry is readonly [string, T] => entry[0].length > 0 && entry[1] !== undefined);\n return entries.length > 0 ? Object.fromEntries(entries) : undefined;\n}\n\nfunction toImportLogEntry(entry: unknown, options: ToImportLogEntriesOptions): LogNote | undefined {\n if (typeof entry === \"string\") {\n return toImportLogEntryFromText(entry, options);\n }\n if (!isImportRecord(entry)) {\n return undefined;\n }\n const text = firstNonEmptyImportString(entry, options.textKeys ?? [\"text\"]);\n if (!text) {\n return undefined;\n }\n const createdAtKey = options.createdAtKey ?? \"created_at\";\n const authorKey = options.authorKey ?? \"author\";\n const createdAt =\n (options.toIsoString ? options.toIsoString(entry[createdAtKey]) : toNonEmptyImportString(entry[createdAtKey])) ??\n options.fallbackCreatedAt;\n return {\n created_at: createdAt,\n author: toNonEmptyImportString(entry[authorKey]) ?? options.fallbackAuthor,\n text,\n };\n}\n\nfunction toImportLogEntryFromText(entry: string, options: ToImportLogEntriesOptions): LogNote | undefined {\n const text = toNonEmptyImportString(entry);\n return text\n ? {\n created_at: options.fallbackCreatedAt,\n author: options.fallbackAuthor,\n text,\n }\n : undefined;\n}\n\nfunction toImportLinkedArtifacts<T>(\n value: unknown,\n options: ToImportLinkedArtifactsOptions,\n build: (pathValue: string, record?: Record<string, unknown>) => T,\n): T[] | undefined {\n const values = normalizeImportCollection(value, options.allowScalar === true);\n if (!values) {\n return undefined;\n }\n const pathKeys = options.pathKeys ?? [\"path\"];\n const entries = values\n .map((entry) => toImportLinkedArtifact(entry, pathKeys, build))\n .filter((entry): entry is T => entry !== undefined);\n return entries.length > 0 ? entries : undefined;\n}\n\nfunction toImportLinkedArtifact<T>(\n entry: unknown,\n pathKeys: readonly string[],\n build: (pathValue: string, record?: Record<string, unknown>) => T,\n): T | undefined {\n if (typeof entry === \"string\") {\n const pathValue = toNonEmptyImportString(entry);\n return pathValue ? build(pathValue) : undefined;\n }\n if (!isImportRecord(entry)) {\n return undefined;\n }\n const pathValue = firstNonEmptyImportString(entry, pathKeys);\n return pathValue ? build(pathValue, entry) : undefined;\n}\n\nfunction toImportLinkedTest(entry: unknown, options: ToImportLinkedTestsOptions): LinkedTest | undefined {\n if (typeof entry === \"string\") {\n const command = toNonEmptyImportString(entry);\n return command ? { command, scope: \"project\" } : undefined;\n }\n if (!isImportRecord(entry)) {\n return undefined;\n }\n const command = firstNonEmptyImportString(entry, options.commandKeys ?? [\"command\"]);\n const testPath = firstNonEmptyImportString(entry, options.pathKeys ?? [\"path\"]);\n if (!command && (options.requireCommand === true || !testPath)) {\n return undefined;\n }\n return {\n ...(command ? { command } : {}),\n ...(testPath ? { path: testPath } : {}),\n scope: toImportLinkScope(entry.scope),\n timeout_seconds: toImportLinkedTestTimeout(entry.timeout_seconds, options),\n note: toNonEmptyImportString(entry.note),\n ...(options.includeExtendedAssertions === true ? toImportLinkedTestAssertions(entry) : {}),\n };\n}\n\nfunction toImportLinkedTestTimeout(value: unknown, options: ToImportLinkedTestsOptions): number | undefined {\n const parsed = options.integerTimeout === true ? toImportInteger(value) : toImportFiniteNumber(value);\n if (parsed === undefined) {\n return undefined;\n }\n const minimum = options.timeoutMinimum ?? 0;\n return options.timeoutExclusiveMinimum === true ? (parsed > minimum ? parsed : undefined) : parsed >= minimum ? parsed : undefined;\n}\n\nfunction toImportFiniteNumber(value: unknown): number | undefined {\n if (typeof value === \"number\" && Number.isFinite(value)) {\n return value;\n }\n if (typeof value !== \"string\" || value.trim().length === 0) {\n return undefined;\n }\n const parsed = Number(value);\n return Number.isFinite(parsed) ? parsed : undefined;\n}\n\nfunction toImportLinkedTestAssertions(entry: Record<string, unknown>): Partial<LinkedTest> {\n return {\n pm_context_mode: toImportNormalizedEnum(entry.pm_context_mode, [\"schema\", \"tracker\", \"auto\"] as const),\n env_set: toImportStringMap(entry.env_set),\n env_clear: toImportStringList(entry.env_clear),\n shared_host_safe: toImportBoolean(entry.shared_host_safe),\n assert_stdout_contains: toImportStringList(entry.assert_stdout_contains),\n assert_stdout_regex: toImportStringList(entry.assert_stdout_regex),\n assert_stderr_contains: toImportStringList(entry.assert_stderr_contains),\n assert_stderr_regex: toImportStringList(entry.assert_stderr_regex),\n assert_stdout_min_lines: toImportInteger(entry.assert_stdout_min_lines),\n assert_json_field_equals: toImportStringMap(entry.assert_json_field_equals),\n assert_json_field_gte: toImportNumberMap(entry.assert_json_field_gte),\n };\n}\n\n/**\n * Throws a NOT_FOUND PmCliError when the tracker has not been initialized.\n */\nexport async function ensureTrackerInitialized(pmRoot: string): Promise<void> {\n const exists = await pathExists(getSettingsPath(pmRoot));\n if (!exists) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n}\n\n/**\n * Returns an empty item document used as the `before` state on import.\n */\nexport function emptyImportedDocument(): ItemDocument {\n return {\n metadata: {} as ItemMetadata,\n body: \"\",\n };\n}\n\n/**\n * Documents the commit imported item params payload exchanged by command, SDK, and package integrations.\n */\nexport interface CommitImportedItemParams {\n pmRoot: string;\n id: string;\n itemPath: string;\n document: ItemDocument;\n author: string;\n message: string;\n settings: PmSettings;\n /** Warning prefix emitted on a lock conflict, e.g. \"beads_import_lock_conflict\". */\n conflictWarningPrefix: string;\n}\n\n/**\n * Restricts commit imported item result values accepted by command, SDK, and storage contracts.\n */\nexport type CommitImportedItemResult =\n | { committed: true; writeWarnings: string[] }\n | { committed: false; conflictWarning: string };\n\n/**\n * Performs the shared item write/commit sequence: acquire the per-item lock,\n * atomically write the TOON document, append the import history entry, and run\n * on-write hooks. On a lock CONFLICT it returns a `conflictWarning` (using the\n * caller-supplied prefix) instead of throwing; any other error removes the\n * partially written file and rethrows.\n */\nexport async function commitImportedItem(\n params: CommitImportedItemParams,\n): Promise<CommitImportedItemResult> {\n const { pmRoot, id, itemPath, document, author, message, settings, conflictWarningPrefix } = params;\n const historyPath = getHistoryPath(pmRoot, id);\n const beforeDocument = emptyImportedDocument();\n try {\n const releaseLock = await acquireLock(pmRoot, id, settings.locks.ttl_seconds, author);\n try {\n await writeFileAtomic(itemPath, serializeItemDocument(document, { format: \"toon\" }));\n try {\n const entry = createHistoryEntry({\n nowIso: nowIso(),\n author,\n op: \"import\",\n before: beforeDocument,\n after: document,\n message,\n });\n await appendHistoryEntry(historyPath, entry);\n const writeWarnings = [\n ...(await runActiveOnWriteHooks({\n path: itemPath,\n scope: \"project\",\n op: \"import\",\n item_id: document.metadata.id,\n item_type: document.metadata.type,\n before: beforeDocument,\n after: document,\n changed_fields: [\"imported\"],\n })),\n ...(await runActiveOnWriteHooks({\n path: historyPath,\n scope: \"project\",\n op: \"import:history\",\n item_id: document.metadata.id,\n item_type: document.metadata.type,\n before: beforeDocument,\n after: document,\n changed_fields: [\"imported\"],\n })),\n ];\n return { committed: true, writeWarnings };\n } catch (error: unknown) {\n await removeFileIfExists(itemPath);\n throw error;\n }\n } finally {\n await releaseLock();\n }\n } catch (error: unknown) {\n if (error instanceof PmCliError && error.exitCode === EXIT_CODE.CONFLICT) {\n return { committed: false, conflictWarning: `${conflictWarningPrefix}:${id}` };\n }\n throw error;\n }\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;;;AAEH,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AA2DhD;;GAEG;AACH,MAAM,UAAU,sBAAsB,CAAC,KAAc;IACnD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;AAClD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAAc;IACpD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAA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AE,QAAQ;wBACf,cAAc,EAAE,CAAC,UAAU,CAAC;qBAC7B,CAAC,CAAC;oBACH,GAAG,CAAC,MAAM,qBAAqB,CAAC;wBAC9B,IAAI,EAAE,WAAW;wBACjB,KAAK,EAAE,SAAS;wBAChB,EAAE,EAAE,gBAAgB;wBACpB,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE;wBAC7B,SAAS,EAAE,QAAQ,CAAC,QAAQ,CAAC,IAAI;wBACjC,MAAM,EAAE,cAAc;wBACtB,KAAK,EAAE,QAAQ;wBACf,cAAc,EAAE,CAAC,UAAU,CAAC;qBAC7B,CAAC,CAAC;iBACJ,CAAC;gBACF,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;YAC5C,CAAC;YAAC,OAAO,KAAc,EAAE,CAAC;gBACxB,MAAM,kBAAkB,CAAC,QAAQ,CAAC,CAAC;gBACnC,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC;gBAAS,CAAC;YACT,MAAM,WAAW,EAAE,CAAC;QACtB,CAAC;IACH,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,IAAI,KAAK,YAAY,UAAU,IAAI,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC,QAAQ,EAAE,CAAC;YACzE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,eAAe,EAAE,GAAG,qBAAqB,IAAI,EAAE,EAAE,EAAE,CAAC;QACjF,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC","debugId":"75dc8e31-81cb-5c87-93a6-b4fa03327a18"}
@@ -6,7 +6,7 @@ export { appendHistoryEntry, createHistoryEntry } from "../core/history/history.
6
6
  export { generateItemId, normalizeItemId, normalizeRawItemId } from "../core/item/id.js";
7
7
  export { readBooleanOption, readCsvListOption, readStringOption } from "./package-runtime-options.js";
8
8
  export { PM_CLI_EXPECTED_ERROR_NAME, createPmCliExpectedError, isPmCliExpectedError, type CreatePmCliExpectedErrorOptions, type PmCliExpectedError, } from "./errors.js";
9
- export { commitImportedItem, emptyImportedDocument, ensureTrackerInitialized, selectImportAuthor, toEstimatedMinutesValue, toImportPriority, toImportStatus, toImportTags, toNonEmptyImportString, type CommitImportedItemParams, type CommitImportedItemResult, } from "./package-import-adapters.js";
9
+ export { commitImportedItem, emptyImportedDocument, ensureTrackerInitialized, selectImportAuthor, toEstimatedMinutesValue, toImportBoolean, toImportConfidence, toImportInteger, toImportLinkedDocs, toImportLinkedFiles, toImportLinkedTests, toImportLogEntries, toImportNormalizedEnum, toImportNumberMap, toImportPriority, toImportStatus, toImportStringList, toImportStringMap, toImportTags, toNonEmptyImportString, type CommitImportedItemParams, type CommitImportedItemResult, type ImportLinkedScope, type ImportPriorityValue, type ToImportLinkedArtifactsOptions, type ToImportLinkedTestsOptions, type ToImportLogEntriesOptions, } from "./package-import-adapters.js";
10
10
  export { canonicalDocument, normalizeFrontMatter, serializeItemDocument, splitFrontMatter, } from "../core/item/item-format.js";
11
11
  export { BASELINE_ITEM_FORMAT_VERSION, CURRENT_ITEM_FORMAT_VERSION, classifyItemFormatVersion, effectiveItemFormatVersion, normalizeItemFormatVersion, scanItemFormatVersions, type ItemFormatVersionScanEntry, type ItemFormatVersionScanResult, type ItemFormatVersionStatus, } from "../core/item/item-format-version.js";
12
12
  export { parseTags } from "../core/item/parse.js";
@@ -4,7 +4,7 @@
4
4
  * Defines public SDK APIs and package-author helpers for Runtime.
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]="71dfb59e-b26e-5bac-b1ad-498489f858ec")}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]="9ed0f12b-4f84-58a2-86c7-aff1a8b86f0a")}catch(e){}}();
8
8
  import path from "node:path";
9
9
  import { activateExtensions, loadExtensions, } from "../core/extensions/index.js";
10
10
  import { resolveItemTypeRegistry } from "../core/item/type-registry.js";
@@ -17,7 +17,7 @@ export { appendHistoryEntry, createHistoryEntry } from "../core/history/history.
17
17
  export { generateItemId, normalizeItemId, normalizeRawItemId } from "../core/item/id.js";
18
18
  export { readBooleanOption, readCsvListOption, readStringOption } from "./package-runtime-options.js";
19
19
  export { PM_CLI_EXPECTED_ERROR_NAME, createPmCliExpectedError, isPmCliExpectedError, } from "./errors.js";
20
- export { commitImportedItem, emptyImportedDocument, ensureTrackerInitialized, selectImportAuthor, toEstimatedMinutesValue, toImportPriority, toImportStatus, toImportTags, toNonEmptyImportString, } from "./package-import-adapters.js";
20
+ export { commitImportedItem, emptyImportedDocument, ensureTrackerInitialized, selectImportAuthor, toEstimatedMinutesValue, toImportBoolean, toImportConfidence, toImportInteger, toImportLinkedDocs, toImportLinkedFiles, toImportLinkedTests, toImportLogEntries, toImportNormalizedEnum, toImportNumberMap, toImportPriority, toImportStatus, toImportStringList, toImportStringMap, toImportTags, toNonEmptyImportString, } from "./package-import-adapters.js";
21
21
  export { canonicalDocument, normalizeFrontMatter, serializeItemDocument, splitFrontMatter, } from "../core/item/item-format.js";
22
22
  export { BASELINE_ITEM_FORMAT_VERSION, CURRENT_ITEM_FORMAT_VERSION, classifyItemFormatVersion, effectiveItemFormatVersion, normalizeItemFormatVersion, scanItemFormatVersions, } from "../core/item/item-format-version.js";
23
23
  export { parseTags } from "../core/item/parse.js";
@@ -135,4 +135,4 @@ async function loadWorkspaceExtensionRegistrations(pmRoot, settings, cwd) {
135
135
  return activationResult.registrations;
136
136
  }
137
137
  //# sourceMappingURL=runtime.js.map
138
- //# debugId=71dfb59e-b26e-5bac-b1ad-498489f858ec
138
+ //# debugId=9ed0f12b-4f84-58a2-86c7-aff1a8b86f0a
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.js","sources":["sdk/runtime.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module sdk/runtime\n *\n * Defines public SDK APIs and package-author helpers for Runtime.\n */\nimport path from \"node:path\";\nimport {\n activateExtensions,\n loadExtensions,\n type ExtensionRegistrationRegistry,\n} from \"../core/extensions/index.js\";\nimport type { GlobalOptions } from \"../core/shared/command-types.js\";\nimport { resolveItemTypeRegistry } from \"../core/item/type-registry.js\";\nimport { resolveRuntimeStatusRegistry } from \"../core/schema/runtime-schema.js\";\nimport { readSettings } from \"../core/store/settings.js\";\nimport {\n runContracts,\n type ContractsCommandOptions,\n type ContractsResult,\n} from \"../cli/commands/contracts.js\";\n\nexport {\n getActiveExtensionRegistrations,\n runActiveOnReadHooks,\n runActiveOnWriteHooks,\n} from \"../core/extensions/index.js\";\nexport { pathExists, readFileIfExists, removeFileIfExists, writeFileAtomic } from \"../core/fs/fs-utils.js\";\nexport { appendHistoryEntry, createHistoryEntry } from \"../core/history/history.js\";\nexport { generateItemId, normalizeItemId, normalizeRawItemId } from \"../core/item/id.js\";\nexport { readBooleanOption, readCsvListOption, readStringOption } from \"./package-runtime-options.js\";\nexport {\n PM_CLI_EXPECTED_ERROR_NAME,\n createPmCliExpectedError,\n isPmCliExpectedError,\n type CreatePmCliExpectedErrorOptions,\n type PmCliExpectedError,\n} from \"./errors.js\";\nexport {\n commitImportedItem,\n emptyImportedDocument,\n ensureTrackerInitialized,\n selectImportAuthor,\n toEstimatedMinutesValue,\n toImportPriority,\n toImportStatus,\n toImportTags,\n toNonEmptyImportString,\n type CommitImportedItemParams,\n type CommitImportedItemResult,\n} from \"./package-import-adapters.js\";\nexport {\n canonicalDocument,\n normalizeFrontMatter,\n serializeItemDocument,\n splitFrontMatter,\n} from \"../core/item/item-format.js\";\nexport {\n BASELINE_ITEM_FORMAT_VERSION,\n CURRENT_ITEM_FORMAT_VERSION,\n classifyItemFormatVersion,\n effectiveItemFormatVersion,\n normalizeItemFormatVersion,\n scanItemFormatVersions,\n type ItemFormatVersionScanEntry,\n type ItemFormatVersionScanResult,\n type ItemFormatVersionStatus,\n} from \"../core/item/item-format-version.js\";\nexport { parseTags } from \"../core/item/parse.js\";\nexport { normalizeStatusInput } from \"../core/item/status.js\";\nexport { resolveItemTypeRegistry } from \"../core/item/type-registry.js\";\nexport { acquireLock } from \"../core/lock/lock.js\";\nexport { resolveRuntimeFieldRegistry, resolveRuntimeStatusRegistry } from \"../core/schema/runtime-schema.js\";\nexport { EXIT_CODE } from \"../core/shared/constants.js\";\nexport { PmCliError } from \"../core/shared/errors.js\";\nexport { isTimestampLiteral, nowIso } from \"../core/shared/time.js\";\nexport { listAllFrontMatter, locateItem, readLocatedItem } from \"../core/store/item-store.js\";\nexport { getHistoryPath, getItemPath, getSettingsPath, resolvePmRoot } from \"../core/store/paths.js\";\nexport { readSettings } from \"../core/store/settings.js\";\nexport {\n renderCalendarMarkdown,\n renderCalendarToon,\n resolveCalendarOutputFormat,\n runCalendar,\n type CalendarOptions,\n type CalendarResult,\n} from \"../cli/commands/calendar.js\";\nexport {\n renderGuideMarkdown,\n resolveGuideOutputFormat,\n runGuide,\n type GuideDepth,\n type GuideOptions,\n type GuideOutputFormat,\n type GuideResult,\n} from \"../cli/commands/guide.js\";\nexport { runCompletion, type CompletionResult, type CompletionShell } from \"../cli/commands/completion.js\";\nexport {\n runCommentsAudit,\n type CommentsAuditEntry,\n type CommentsAuditHistoryRow,\n type CommentsAuditOptions,\n type CommentsAuditResult,\n type CommentsAuditSummary,\n type CommentsAuditTypeSummary,\n} from \"../cli/commands/comments-audit.js\";\nexport {\n runDedupeAudit,\n type DedupeAuditCandidate,\n type DedupeAuditCluster,\n type DedupeAuditOptions,\n type DedupeAuditResult,\n} from \"../cli/commands/dedupe-audit.js\";\nexport {\n runDedupeMerge,\n type DedupeMergeChildReparent,\n type DedupeMergeCloseAction,\n type DedupeMergeDuplicateOutcome,\n type DedupeMergeOptions,\n type DedupeMergeResult,\n} from \"../cli/commands/dedupe-merge.js\";\nexport { runNormalize, type NormalizeCommandOptions, type NormalizeResult } from \"../cli/commands/normalize.js\";\nexport { runReindex, type ReindexOptions, type ReindexResult } from \"../cli/commands/reindex.js\";\nexport { runSearch, type SearchOptions, type SearchResult } from \"../cli/commands/search.js\";\nexport {\n loadCreateTemplateOptions,\n runTemplatesList,\n runTemplatesSave,\n runTemplatesShow,\n type CreateTemplateOptions,\n type TemplatesListResult,\n type TemplatesSaveResult,\n type TemplatesShowResult,\n} from \"../cli/commands/templates.js\";\nexport {\n runTestRunsList,\n runTestRunsLogs,\n runTestRunsResume,\n runTestRunsStatus,\n runTestRunsStop,\n type TestRunsListCommandOptions,\n type TestRunsLogsCommandOptions,\n type TestRunsResumeCommandOptions,\n type TestRunsStopCommandOptions,\n} from \"../cli/commands/test-runs.js\";\nexport {\n CONFIDENCE_TEXT_VALUES,\n DEPENDENCY_KIND_VALUES,\n BUILTIN_ITEM_TYPE_VALUES,\n ISSUE_SEVERITY_VALUES,\n ITEM_TYPE_VALUES,\n RISK_VALUES,\n STATUS_VALUES,\n} from \"../types/index.js\";\nexport type { GlobalOptions } from \"../core/shared/command-types.js\";\nexport type {\n Dependency,\n ItemDocument,\n ItemMetadata,\n ItemStatus,\n ItemType,\n LinkedDoc,\n LinkedFile,\n LinkedTest,\n LogNote,\n PmSettings,\n} from \"../types/index.js\";\n\n/**\n * Documents the get contracts options payload exchanged by command, SDK, and package integrations.\n */\nexport interface GetContractsOptions extends ContractsCommandOptions {\n pmRoot?: string;\n cwd?: string;\n noExtensions?: boolean;\n quiet?: boolean;\n profile?: boolean;\n}\n\n/**\n * Documents the workspace contracts options payload exchanged by command, SDK, and package integrations.\n */\nexport interface WorkspaceContractsOptions {\n extensionRegistrations?: ExtensionRegistrationRegistry | null;\n noExtensions?: boolean;\n cwd?: string;\n}\n\n/**\n * Documents the workspace contracts payload exchanged by command, SDK, and package integrations.\n */\nexport interface WorkspaceContracts {\n types: string[];\n statuses: string[];\n openStatus: string;\n closeStatus: string;\n canceledStatus: string;\n}\n\n/**\n * Process-lifetime memo of activated extension registrations, keyed by resolved\n * pm root + cwd + extension settings. `getWorkspaceContracts` is frequently\n * called by importers and package runtimes that cannot thread a registry\n * through; without the memo each call re-discovers, re-imports, and re-activates\n * every extension.\n *\n * Invalidation story: entries are size-bounded and otherwise live until cleared.\n * One-shot CLI processes are trivially correct. Long-lived hosts (e.g. the MCP\n * server) must either pass `options.extensionRegistrations` (which bypasses the\n * memo) or call {@link clearWorkspaceContractsCache} after installing/removing/\n * toggling extensions or editing settings. Settings themselves are re-read on\n * every call — only the extension load+activate step is memoized.\n */\nconst WORKSPACE_CONTRACTS_CACHE_LIMIT = 50;\nconst workspaceExtensionRegistrationsCache = new Map<string, Promise<ExtensionRegistrationRegistry | null>>();\n\nfunction buildWorkspaceExtensionRegistrationsCacheKey(\n pmRoot: string,\n settings: Awaited<ReturnType<typeof readSettings>>,\n cwd?: string,\n): string {\n return JSON.stringify([\n path.resolve(pmRoot),\n path.resolve(cwd ?? process.cwd()),\n settings.extensions.enabled,\n settings.extensions.disabled,\n settings.extensions.policy,\n ]);\n}\n\n/**\n * Drop all memoized workspace extension registrations so the next\n * `getWorkspaceContracts` call re-loads and re-activates extensions from disk.\n * Long-lived hosts should call this after any extension or settings mutation.\n */\nexport function clearWorkspaceContractsCache(): void {\n workspaceExtensionRegistrationsCache.clear();\n}\n\nasync function resolveWorkspaceExtensionRegistrations(\n pmRoot: string,\n settings: Awaited<ReturnType<typeof readSettings>>,\n cwd?: string,\n): Promise<ExtensionRegistrationRegistry | null> {\n const cacheKey = buildWorkspaceExtensionRegistrationsCacheKey(pmRoot, settings, cwd);\n const cached = workspaceExtensionRegistrationsCache.get(cacheKey);\n if (cached !== undefined) {\n return cached;\n }\n if (workspaceExtensionRegistrationsCache.size >= WORKSPACE_CONTRACTS_CACHE_LIMIT) {\n const oldestKey = workspaceExtensionRegistrationsCache.keys().next().value!;\n workspaceExtensionRegistrationsCache.delete(oldestKey);\n }\n const registrations = loadWorkspaceExtensionRegistrations(pmRoot, settings, cwd);\n workspaceExtensionRegistrationsCache.set(cacheKey, registrations);\n return registrations;\n}\n\n/**\n * Implements get workspace contracts for the public runtime surface of this module.\n */\nexport async function getWorkspaceContracts(\n pmRoot: string,\n options: WorkspaceContractsOptions = {},\n): Promise<WorkspaceContracts> {\n const settings = await readSettings(pmRoot);\n const extensionRegistrations =\n options.extensionRegistrations ??\n (options.noExtensions === true ? null : await resolveWorkspaceExtensionRegistrations(pmRoot, settings, options.cwd));\n const typeRegistry = resolveItemTypeRegistry(settings, extensionRegistrations);\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n\n return {\n types: [...typeRegistry.types],\n statuses: statusRegistry.definitions.map((definition) => definition.id),\n openStatus: statusRegistry.open_status,\n closeStatus: statusRegistry.close_status,\n canceledStatus: statusRegistry.canceled_status,\n };\n}\n\n/**\n * Implements get contracts for the public runtime surface of this module.\n */\nexport async function getContracts(\n pmRootOrOptions?: string | GetContractsOptions,\n options: GetContractsOptions = {},\n): Promise<ContractsResult> {\n const resolvedOptions =\n typeof pmRootOrOptions === \"string\"\n ? { ...options, pmRoot: pmRootOrOptions }\n : (pmRootOrOptions ?? options);\n const global: GlobalOptions = {\n json: true,\n quiet: resolvedOptions.quiet ?? true,\n noExtensions: resolvedOptions.noExtensions ?? false,\n noPager: true,\n profile: resolvedOptions.profile ?? false,\n path: resolvedOptions.pmRoot,\n };\n\n return runContracts(resolvedOptions, global);\n}\n\nasync function loadWorkspaceExtensionRegistrations(\n pmRoot: string,\n settings: Awaited<ReturnType<typeof readSettings>>,\n cwd?: string,\n): Promise<ExtensionRegistrationRegistry | null> {\n const loadResult = await loadExtensions({\n pmRoot,\n settings,\n cwd: cwd ?? process.cwd(),\n noExtensions: false,\n });\n const activationResult = await activateExtensions(loadResult);\n return activationResult.registrations;\n}\n\nexport type { ContractsCommandOptions, ContractsResult };\n"],"names":[],"mappings":"AAAA;;;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G,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE;QACzC,CAAC,CAAC,CAAC,eAAe,IAAI,OAAO,CAAC,CAAC;IACnC,MAAM,MAAM,GAAkB;QAC5B,IAAI,EAAE,IAAI;QACV,KAAK,EAAE,eAAe,CAAC,KAAK,IAAI,IAAI;QACpC,YAAY,EAAE,eAAe,CAAC,YAAY,IAAI,KAAK;QACnD,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,eAAe,CAAC,OAAO,IAAI,KAAK;QACzC,IAAI,EAAE,eAAe,CAAC,MAAM;KAC7B,CAAC;IAEF,OAAO,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;AAC/C,CAAC;AAED,KAAK,UAAU,mCAAmC,CAChD,MAAc,EACd,QAAkD,EAClD,GAAY;IAEZ,MAAM,UAAU,GAAG,MAAM,cAAc,CAAC;QACtC,MAAM;QACN,QAAQ;QACR,GAAG,EAAE,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE;QACzB,YAAY,EAAE,KAAK;KACpB,CAAC,CAAC;IACH,MAAM,gBAAgB,GAAG,MAAM,kBAAkB,CAAC,UAAU,CAAC,CAAC;IAC9D,OAAO,gBAAgB,CAAC,aAAa,CAAC;AACxC,CAAC","debugId":"71dfb59e-b26e-5bac-b1ad-498489f858ec"}
1
+ {"version":3,"file":"runtime.js","sources":["sdk/runtime.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module sdk/runtime\n *\n * Defines public SDK APIs and package-author helpers for Runtime.\n */\nimport path from \"node:path\";\nimport {\n activateExtensions,\n loadExtensions,\n type ExtensionRegistrationRegistry,\n} from \"../core/extensions/index.js\";\nimport type { GlobalOptions } from \"../core/shared/command-types.js\";\nimport { resolveItemTypeRegistry } from \"../core/item/type-registry.js\";\nimport { resolveRuntimeStatusRegistry } from \"../core/schema/runtime-schema.js\";\nimport { readSettings } from \"../core/store/settings.js\";\nimport {\n runContracts,\n type ContractsCommandOptions,\n type ContractsResult,\n} from \"../cli/commands/contracts.js\";\n\nexport {\n getActiveExtensionRegistrations,\n runActiveOnReadHooks,\n runActiveOnWriteHooks,\n} from \"../core/extensions/index.js\";\nexport { pathExists, readFileIfExists, removeFileIfExists, writeFileAtomic } from \"../core/fs/fs-utils.js\";\nexport { appendHistoryEntry, createHistoryEntry } from \"../core/history/history.js\";\nexport { generateItemId, normalizeItemId, normalizeRawItemId } from \"../core/item/id.js\";\nexport { readBooleanOption, readCsvListOption, readStringOption } from \"./package-runtime-options.js\";\nexport {\n PM_CLI_EXPECTED_ERROR_NAME,\n createPmCliExpectedError,\n isPmCliExpectedError,\n type CreatePmCliExpectedErrorOptions,\n type PmCliExpectedError,\n} from \"./errors.js\";\nexport {\n commitImportedItem,\n emptyImportedDocument,\n ensureTrackerInitialized,\n selectImportAuthor,\n toEstimatedMinutesValue,\n toImportBoolean,\n toImportConfidence,\n toImportInteger,\n toImportLinkedDocs,\n toImportLinkedFiles,\n toImportLinkedTests,\n toImportLogEntries,\n toImportNormalizedEnum,\n toImportNumberMap,\n toImportPriority,\n toImportStatus,\n toImportStringList,\n toImportStringMap,\n toImportTags,\n toNonEmptyImportString,\n type CommitImportedItemParams,\n type CommitImportedItemResult,\n type ImportLinkedScope,\n type ImportPriorityValue,\n type ToImportLinkedArtifactsOptions,\n type ToImportLinkedTestsOptions,\n type ToImportLogEntriesOptions,\n} from \"./package-import-adapters.js\";\nexport {\n canonicalDocument,\n normalizeFrontMatter,\n serializeItemDocument,\n splitFrontMatter,\n} from \"../core/item/item-format.js\";\nexport {\n BASELINE_ITEM_FORMAT_VERSION,\n CURRENT_ITEM_FORMAT_VERSION,\n classifyItemFormatVersion,\n effectiveItemFormatVersion,\n normalizeItemFormatVersion,\n scanItemFormatVersions,\n type ItemFormatVersionScanEntry,\n type ItemFormatVersionScanResult,\n type ItemFormatVersionStatus,\n} from \"../core/item/item-format-version.js\";\nexport { parseTags } from \"../core/item/parse.js\";\nexport { normalizeStatusInput } from \"../core/item/status.js\";\nexport { resolveItemTypeRegistry } from \"../core/item/type-registry.js\";\nexport { acquireLock } from \"../core/lock/lock.js\";\nexport { resolveRuntimeFieldRegistry, resolveRuntimeStatusRegistry } from \"../core/schema/runtime-schema.js\";\nexport { EXIT_CODE } from \"../core/shared/constants.js\";\nexport { PmCliError } from \"../core/shared/errors.js\";\nexport { isTimestampLiteral, nowIso } from \"../core/shared/time.js\";\nexport { listAllFrontMatter, locateItem, readLocatedItem } from \"../core/store/item-store.js\";\nexport { getHistoryPath, getItemPath, getSettingsPath, resolvePmRoot } from \"../core/store/paths.js\";\nexport { readSettings } from \"../core/store/settings.js\";\nexport {\n renderCalendarMarkdown,\n renderCalendarToon,\n resolveCalendarOutputFormat,\n runCalendar,\n type CalendarOptions,\n type CalendarResult,\n} from \"../cli/commands/calendar.js\";\nexport {\n renderGuideMarkdown,\n resolveGuideOutputFormat,\n runGuide,\n type GuideDepth,\n type GuideOptions,\n type GuideOutputFormat,\n type GuideResult,\n} from \"../cli/commands/guide.js\";\nexport { runCompletion, type CompletionResult, type CompletionShell } from \"../cli/commands/completion.js\";\nexport {\n runCommentsAudit,\n type CommentsAuditEntry,\n type CommentsAuditHistoryRow,\n type CommentsAuditOptions,\n type CommentsAuditResult,\n type CommentsAuditSummary,\n type CommentsAuditTypeSummary,\n} from \"../cli/commands/comments-audit.js\";\nexport {\n runDedupeAudit,\n type DedupeAuditCandidate,\n type DedupeAuditCluster,\n type DedupeAuditOptions,\n type DedupeAuditResult,\n} from \"../cli/commands/dedupe-audit.js\";\nexport {\n runDedupeMerge,\n type DedupeMergeChildReparent,\n type DedupeMergeCloseAction,\n type DedupeMergeDuplicateOutcome,\n type DedupeMergeOptions,\n type DedupeMergeResult,\n} from \"../cli/commands/dedupe-merge.js\";\nexport { runNormalize, type NormalizeCommandOptions, type NormalizeResult } from \"../cli/commands/normalize.js\";\nexport { runReindex, type ReindexOptions, type ReindexResult } from \"../cli/commands/reindex.js\";\nexport { runSearch, type SearchOptions, type SearchResult } from \"../cli/commands/search.js\";\nexport {\n loadCreateTemplateOptions,\n runTemplatesList,\n runTemplatesSave,\n runTemplatesShow,\n type CreateTemplateOptions,\n type TemplatesListResult,\n type TemplatesSaveResult,\n type TemplatesShowResult,\n} from \"../cli/commands/templates.js\";\nexport {\n runTestRunsList,\n runTestRunsLogs,\n runTestRunsResume,\n runTestRunsStatus,\n runTestRunsStop,\n type TestRunsListCommandOptions,\n type TestRunsLogsCommandOptions,\n type TestRunsResumeCommandOptions,\n type TestRunsStopCommandOptions,\n} from \"../cli/commands/test-runs.js\";\nexport {\n CONFIDENCE_TEXT_VALUES,\n DEPENDENCY_KIND_VALUES,\n BUILTIN_ITEM_TYPE_VALUES,\n ISSUE_SEVERITY_VALUES,\n ITEM_TYPE_VALUES,\n RISK_VALUES,\n STATUS_VALUES,\n} from \"../types/index.js\";\nexport type { GlobalOptions } from \"../core/shared/command-types.js\";\nexport type {\n Dependency,\n ItemDocument,\n ItemMetadata,\n ItemStatus,\n ItemType,\n LinkedDoc,\n LinkedFile,\n LinkedTest,\n LogNote,\n PmSettings,\n} from \"../types/index.js\";\n\n/**\n * Documents the get contracts options payload exchanged by command, SDK, and package integrations.\n */\nexport interface GetContractsOptions extends ContractsCommandOptions {\n pmRoot?: string;\n cwd?: string;\n noExtensions?: boolean;\n quiet?: boolean;\n profile?: boolean;\n}\n\n/**\n * Documents the workspace contracts options payload exchanged by command, SDK, and package integrations.\n */\nexport interface WorkspaceContractsOptions {\n extensionRegistrations?: ExtensionRegistrationRegistry | null;\n noExtensions?: boolean;\n cwd?: string;\n}\n\n/**\n * Documents the workspace contracts payload exchanged by command, SDK, and package integrations.\n */\nexport interface WorkspaceContracts {\n types: string[];\n statuses: string[];\n openStatus: string;\n closeStatus: string;\n canceledStatus: string;\n}\n\n/**\n * Process-lifetime memo of activated extension registrations, keyed by resolved\n * pm root + cwd + extension settings. `getWorkspaceContracts` is frequently\n * called by importers and package runtimes that cannot thread a registry\n * through; without the memo each call re-discovers, re-imports, and re-activates\n * every extension.\n *\n * Invalidation story: entries are size-bounded and otherwise live until cleared.\n * One-shot CLI processes are trivially correct. Long-lived hosts (e.g. the MCP\n * server) must either pass `options.extensionRegistrations` (which bypasses the\n * memo) or call {@link clearWorkspaceContractsCache} after installing/removing/\n * toggling extensions or editing settings. Settings themselves are re-read on\n * every call — only the extension load+activate step is memoized.\n */\nconst WORKSPACE_CONTRACTS_CACHE_LIMIT = 50;\nconst workspaceExtensionRegistrationsCache = new Map<string, Promise<ExtensionRegistrationRegistry | null>>();\n\nfunction buildWorkspaceExtensionRegistrationsCacheKey(\n pmRoot: string,\n settings: Awaited<ReturnType<typeof readSettings>>,\n cwd?: string,\n): string {\n return JSON.stringify([\n path.resolve(pmRoot),\n path.resolve(cwd ?? process.cwd()),\n settings.extensions.enabled,\n settings.extensions.disabled,\n settings.extensions.policy,\n ]);\n}\n\n/**\n * Drop all memoized workspace extension registrations so the next\n * `getWorkspaceContracts` call re-loads and re-activates extensions from disk.\n * Long-lived hosts should call this after any extension or settings mutation.\n */\nexport function clearWorkspaceContractsCache(): void {\n workspaceExtensionRegistrationsCache.clear();\n}\n\nasync function resolveWorkspaceExtensionRegistrations(\n pmRoot: string,\n settings: Awaited<ReturnType<typeof readSettings>>,\n cwd?: string,\n): Promise<ExtensionRegistrationRegistry | null> {\n const cacheKey = buildWorkspaceExtensionRegistrationsCacheKey(pmRoot, settings, cwd);\n const cached = workspaceExtensionRegistrationsCache.get(cacheKey);\n if (cached !== undefined) {\n return cached;\n }\n if (workspaceExtensionRegistrationsCache.size >= WORKSPACE_CONTRACTS_CACHE_LIMIT) {\n const oldestKey = workspaceExtensionRegistrationsCache.keys().next().value!;\n workspaceExtensionRegistrationsCache.delete(oldestKey);\n }\n const registrations = loadWorkspaceExtensionRegistrations(pmRoot, settings, cwd);\n workspaceExtensionRegistrationsCache.set(cacheKey, registrations);\n return registrations;\n}\n\n/**\n * Implements get workspace contracts for the public runtime surface of this module.\n */\nexport async function getWorkspaceContracts(\n pmRoot: string,\n options: WorkspaceContractsOptions = {},\n): Promise<WorkspaceContracts> {\n const settings = await readSettings(pmRoot);\n const extensionRegistrations =\n options.extensionRegistrations ??\n (options.noExtensions === true ? null : await resolveWorkspaceExtensionRegistrations(pmRoot, settings, options.cwd));\n const typeRegistry = resolveItemTypeRegistry(settings, extensionRegistrations);\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n\n return {\n types: [...typeRegistry.types],\n statuses: statusRegistry.definitions.map((definition) => definition.id),\n openStatus: statusRegistry.open_status,\n closeStatus: statusRegistry.close_status,\n canceledStatus: statusRegistry.canceled_status,\n };\n}\n\n/**\n * Implements get contracts for the public runtime surface of this module.\n */\nexport async function getContracts(\n pmRootOrOptions?: string | GetContractsOptions,\n options: GetContractsOptions = {},\n): Promise<ContractsResult> {\n const resolvedOptions =\n typeof pmRootOrOptions === \"string\"\n ? { ...options, pmRoot: pmRootOrOptions }\n : (pmRootOrOptions ?? options);\n const global: GlobalOptions = {\n json: true,\n quiet: resolvedOptions.quiet ?? true,\n noExtensions: resolvedOptions.noExtensions ?? false,\n noPager: true,\n profile: resolvedOptions.profile ?? false,\n path: resolvedOptions.pmRoot,\n };\n\n return runContracts(resolvedOptions, global);\n}\n\nasync function loadWorkspaceExtensionRegistrations(\n pmRoot: string,\n settings: Awaited<ReturnType<typeof readSettings>>,\n cwd?: string,\n): Promise<ExtensionRegistrationRegistry | null> {\n const loadResult = await loadExtensions({\n pmRoot,\n settings,\n cwd: cwd ?? process.cwd(),\n noExtensions: false,\n });\n const activationResult = await activateExtensions(loadResult);\n return activationResult.registrations;\n}\n\nexport type { ContractsCommandOptions, ContractsResult };\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,kBAAkB,EAClB,cAAc,GAEf,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,4BAA4B,EAAE,MAAM,kCAAk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,CAAC,eAAe,IAAI,OAAO,CAAC,CAAC;IACnC,MAAM,MAAM,GAAkB;QAC5B,IAAI,EAAE,IAAI;QACV,KAAK,EAAE,eAAe,CAAC,KAAK,IAAI,IAAI;QACpC,YAAY,EAAE,eAAe,CAAC,YAAY,IAAI,KAAK;QACnD,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,eAAe,CAAC,OAAO,IAAI,KAAK;QACzC,IAAI,EAAE,eAAe,CAAC,MAAM;KAC7B,CAAC;IAEF,OAAO,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;AAC/C,CAAC;AAED,KAAK,UAAU,mCAAmC,CAChD,MAAc,EACd,QAAkD,EAClD,GAAY;IAEZ,MAAM,UAAU,GAAG,MAAM,cAAc,CAAC;QACtC,MAAM;QACN,QAAQ;QACR,GAAG,EAAE,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE;QACzB,YAAY,EAAE,KAAK;KACpB,CAAC,CAAC;IACH,MAAM,gBAAgB,GAAG,MAAM,kBAAkB,CAAC,UAAU,CAAC,CAAC;IAC9D,OAAO,gBAAgB,CAAC,aAAa,CAAC;AACxC,CAAC","debugId":"9ed0f12b-4f84-58a2-86c7-aff1a8b86f0a"}
@@ -120,7 +120,7 @@ pm release <item-id>
120
120
  | Full machine payload | `pm get <id> --full --json` |
121
121
  | Command flags | `pm <command> --help --json` |
122
122
  | Low-noise machine contracts | `pm contracts --command <command> --flags-only --json` |
123
- | Semantic index refresh | `pm reindex --mode semantic --progress` (stale-first by default; add `--full` to force full rebuild) |
123
+ | Semantic index refresh | `pm reindex --mode semantic --progress` (stale-first by default; add `--full` to force full rebuild; requires the `search-advanced` package) |
124
124
  | Timeline | `pm activity --id <id> --limit 20` |
125
125
  | Audited history redaction | `pm history-redact <id> --literal "<secret>" --replacement "[redacted]" --dry-run` |
126
126
  | Audited history re-anchor | `pm history-repair <id> --dry-run` (clears drift flagged by `pm health`/`pm validate`) |
@@ -189,7 +189,7 @@ Use these defaults unless the task requires otherwise:
189
189
  - `pm schema add-status <id> --role <role>` / `pm schema remove-status <id>` manage custom lifecycle statuses in `.agents/pm/schema/statuses.json`; roles come from the runtime status-role vocabulary, the upsert is idempotent, and built-in default statuses cannot be removed. `pm schema list` now reports statuses (builtin vs custom) alongside types.
190
190
  - `pm init --type-preset agile|ops|research` for new projects that should start with domain item types instead of generic tasks only.
191
191
  - After switching embedding provider/model, run `pm reindex --mode semantic --full` or `pm reindex --mode hybrid --full` to rebuild vectors completely; `pm reindex --mode keyword` ignores `--full` and now warns when ledger identity drift is detected.
192
- - `pm normalize --dry-run --json` before lifecycle metadata cleanups.
192
+ - `pm normalize --dry-run --json` before lifecycle metadata cleanups (requires the `governance-audit` package).
193
193
  - `pm health --check-only` when inspecting repository health without refresh side effects.
194
194
  - Mistyped command names get a `Did you mean: <command>?` hint, including typos of the executable shortcut aliases — `pm shwo <id>` suggests `get` (the canonical of `show`/`view`), and `pm comemnt` suggests `comments`.
195
195
 
@@ -14,7 +14,7 @@ Tracked documentation work: [pm-u9d0](../.agents/pm/epics/pm-u9d0.toon).
14
14
 
15
15
  ## System Overview
16
16
 
17
- `pm-cli` is a TypeScript ESM CLI for Node.js 20+. It is file-backed, git-native, deterministic, and designed for concurrent human plus agent workflows.
17
+ `pm-cli` is a TypeScript ESM CLI for Node.js 22.18+. It is file-backed, git-native, deterministic, and designed for concurrent human plus agent workflows.
18
18
 
19
19
  High-level flow:
20
20
 
@@ -304,7 +304,7 @@ Useful commands:
304
304
 
305
305
  ```bash
306
306
  pm search "restore history" --mode keyword --limit 10
307
- pm reindex --mode hybrid --progress
307
+ pm reindex --mode hybrid --progress # requires the search-advanced package
308
308
  pm health --check-only
309
309
  ```
310
310
 
package/docs/COMMANDS.md CHANGED
@@ -30,9 +30,9 @@ Tracked documentation work: [pm-u9d0](../.agents/pm/epics/pm-u9d0.toon).
30
30
  | Bulk | `update-many`, `close-many` | apply one change across a matched, dry-run-previewed set with a rollback checkpoint |
31
31
  | Scheduling | `meet`, `event`, `remind` | low-friction Meeting/Event/Reminder creation |
32
32
  | Planning | `plan create`, `plan add-step`, `plan update-step`, `plan complete-step`, `plan link`, `plan approve`, `plan materialize` | agent-optimized living plans with ordered steps, evidence, decisions, validation, and materialization |
33
- | Logs | `comments`, `notes`, `learnings`, `comments-audit` | record progress and durable context |
33
+ | Logs | `comments`, `notes`, `learnings`, `comments-audit`* | record progress and durable context |
34
34
  | Links | `files`, `docs`, `test`, `deps` | connect items to artifacts, tests, and relationships |
35
- | Verification | `test`, `test-all`, `test-runs`, `validate`, `gc` | run linked tests and repository checks |
35
+ | Verification | `test`, `test-all`, `test-runs`†, `validate`, `gc` | run linked tests and repository checks |
36
36
  | History | `history`, `history-compact`, `history-redact`, `history-repair`, `activity`, `restore`, `stats` | inspect, compact, redact, re-anchor, and recover item state |
37
37
  | Schema | `schema add-type` / `remove-type` / `add-status` / `remove-status` / `add-field` / `remove-field` / `apply-preset` | manage config-driven custom item types (`.agents/pm/schema/types.json`), statuses (`.agents/pm/schema/statuses.json`), and custom metadata fields (`.agents/pm/schema/fields.json`); `apply-preset` adopts a domain type preset; `add-type --infer` derives types from title-prefix conventions |
38
38
  | Profiles | `profile list` / `show` / `apply` / `lint` | compose item types, statuses, fields, workflows, config, templates, and recommended packages into archetype bundles (agile/ops/research); `apply` stages every dimension idempotently; `lint` reports author-time consistency findings without writing |
@@ -40,7 +40,9 @@ Tracked documentation work: [pm-u9d0](../.agents/pm/epics/pm-u9d0.toon).
40
40
  | Packages | `install`, `upgrade`, `package`, `packages`, `extension`, package/extension command groups | install, upgrade, manage, and run package-backed extension commands |
41
41
  | Machines | `contracts`, `help`, optional `guide`/`completion` | command contracts plus optional guide-shell docs routing and shell helpers |
42
42
 
43
- `*` `dedupe-audit` and `dedupe-merge` are provided by the optional `governance-audit` package (`pm install governance-audit --project`).
43
+ `*` `dedupe-audit`, `dedupe-merge`, `comments-audit`, and `normalize` are provided by the optional `governance-audit` package (`pm install governance-audit --project`).
44
+
45
+ `†` `test-runs` subcommands are provided by the optional `linked-test-adapters` package (`pm install linked-test-adapters --project`).
44
46
 
45
47
  ## Bootstrap
46
48
 
@@ -746,7 +748,7 @@ pm create Spike "Investigate retry backoff"
746
748
  - `add-type` is an idempotent UPSERT keyed on the type name (case-insensitive); re-running it merges aliases and overrides supplied fields while preserving everything else.
747
749
  - `remove-type <Name>` removes a custom type definition (case-insensitive). Built-in types are refused. It WARNS (non-blocking) with `items_using_type:<N>` when items of that type still exist, then removes the definition.
748
750
  - `add-status <id>` writes a custom lifecycle status (idempotent UPSERT keyed on the normalized id; re-adding sets `replaced: true`). Roles are validated against the runtime status roles: `draft`, `active`, `blocked`, `terminal`, `terminal_done`, `terminal_canceled`, `default_open`, `default_close`, `default_cancel`.
749
- - `remove-status <id>` removes a custom status. The five built-in default statuses (`open`, `in_progress`, `blocked`, `closed`, `canceled`, plus `draft`) are refused. It WARNS (non-blocking) with `items_using_status:<N>` when items currently use that status.
751
+ - `remove-status <id>` removes a custom status. The six built-in statuses (`open`, `in_progress`, `blocked`, `closed`, `canceled`, `draft`) are refused. It WARNS (non-blocking) with `items_using_status:<N>` when items currently use that status.
750
752
  - Built-in types (Chore, Decision, Epic, Event, Feature, Issue, Meeting, Milestone, Plan, Reminder, Task) are reserved and cannot be redefined or removed.
751
753
  - `add-field <key>` registers a custom metadata field in `.agents/pm/schema/fields.json` (shape: `{ "fields": [RuntimeFieldDefinition...] }`). Each custom field dynamically registers a CLI flag on create/update (and any other commands you list) so projects can capture typed project-specific metadata without hand-editing JSON. It is an idempotent UPSERT keyed on the normalized key, and refuses keys that shadow a built-in field. `list-fields` / `show-field <key>` inspect registered fields; `remove-field <key>` drops one and WARNS (non-blocking) with `items_using_field:<N>` when items still carry a value. See [CONFIGURATION.md](CONFIGURATION.md) for the full `schema/fields.json` format.
752
754
  - `apply-preset <agile|ops|research>` batch-registers a domain type preset into an already-initialized project (the same vocabulary `pm init --type-preset` seeds); it is idempotent (re-running reports `replaced` entries) and shares its definitions with init.
@@ -856,6 +858,8 @@ Agents should use runtime contracts instead of hard-coding flag lists. Contract
856
858
 
857
859
  ## Completion
858
860
 
861
+ `pm completion` is provided by the optional `guide-shell` package (`pm install guide-shell --project`).
862
+
859
863
  ```bash
860
864
  pm completion bash
861
865
  pm completion zsh
@@ -168,7 +168,7 @@ pm get <id> --full --json
168
168
  pm contracts --json
169
169
  ```
170
170
 
171
- `pm calendar` defaults to markdown because date-centric summaries are easier to scan in that format.
171
+ `pm calendar` (provided by the optional `calendar` package — `pm install calendar --project`) defaults to markdown because date-centric summaries are easier to scan in that format.
172
172
 
173
173
  ## Validation Policies
174
174