@unbrained/pm-cli 2026.5.31 → 2026.6.6

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 (638) hide show
  1. package/CHANGELOG.md +167 -0
  2. package/CONTRIBUTING.md +1 -0
  3. package/README.md +12 -4
  4. package/dist/cli/argv-utils.js +7 -3
  5. package/dist/cli/argv-utils.js.map +1 -1
  6. package/dist/cli/bootstrap-args.d.ts +1 -0
  7. package/dist/cli/bootstrap-args.js +23 -3
  8. package/dist/cli/bootstrap-args.js.map +1 -1
  9. package/dist/cli/commands/calendar.js +17 -3
  10. package/dist/cli/commands/calendar.js.map +1 -1
  11. package/dist/cli/commands/close-many.d.ts +63 -0
  12. package/dist/cli/commands/close-many.js +302 -0
  13. package/dist/cli/commands/close-many.js.map +1 -0
  14. package/dist/cli/commands/completion.d.ts +1 -0
  15. package/dist/cli/commands/completion.js +260 -32
  16. package/dist/cli/commands/completion.js.map +1 -1
  17. package/dist/cli/commands/config.d.ts +4 -4
  18. package/dist/cli/commands/config.js +115 -3
  19. package/dist/cli/commands/config.js.map +1 -1
  20. package/dist/cli/commands/contracts.js +193 -162
  21. package/dist/cli/commands/contracts.js.map +1 -1
  22. package/dist/cli/commands/create.d.ts +1 -0
  23. package/dist/cli/commands/create.js +77 -114
  24. package/dist/cli/commands/create.js.map +1 -1
  25. package/dist/cli/commands/extension/doctor.d.ts +12 -0
  26. package/dist/cli/commands/extension/doctor.js +97 -2
  27. package/dist/cli/commands/extension/doctor.js.map +1 -1
  28. package/dist/cli/commands/extension/scaffold.js +49 -48
  29. package/dist/cli/commands/extension/scaffold.js.map +1 -1
  30. package/dist/cli/commands/extension.js +51 -23
  31. package/dist/cli/commands/extension.js.map +1 -1
  32. package/dist/cli/commands/gc.d.ts +8 -1
  33. package/dist/cli/commands/gc.js +26 -3
  34. package/dist/cli/commands/gc.js.map +1 -1
  35. package/dist/cli/commands/get.js +7 -7
  36. package/dist/cli/commands/get.js.map +1 -1
  37. package/dist/cli/commands/health.js +51 -3
  38. package/dist/cli/commands/health.js.map +1 -1
  39. package/dist/cli/commands/history.d.ts +4 -1
  40. package/dist/cli/commands/history.js +12 -24
  41. package/dist/cli/commands/history.js.map +1 -1
  42. package/dist/cli/commands/index.d.ts +3 -1
  43. package/dist/cli/commands/index.js +5 -3
  44. package/dist/cli/commands/index.js.map +1 -1
  45. package/dist/cli/commands/init.d.ts +10 -0
  46. package/dist/cli/commands/init.js +107 -4
  47. package/dist/cli/commands/init.js.map +1 -1
  48. package/dist/cli/commands/list.d.ts +5 -0
  49. package/dist/cli/commands/list.js +58 -26
  50. package/dist/cli/commands/list.js.map +1 -1
  51. package/dist/cli/commands/reindex.js +163 -47
  52. package/dist/cli/commands/reindex.js.map +1 -1
  53. package/dist/cli/commands/repeatable-metadata-parsers.d.ts +15 -0
  54. package/dist/cli/commands/repeatable-metadata-parsers.js +120 -0
  55. package/dist/cli/commands/repeatable-metadata-parsers.js.map +1 -0
  56. package/dist/cli/commands/restore.js +25 -4
  57. package/dist/cli/commands/restore.js.map +1 -1
  58. package/dist/cli/commands/schema.d.ts +122 -1
  59. package/dist/cli/commands/schema.js +536 -6
  60. package/dist/cli/commands/schema.js.map +1 -1
  61. package/dist/cli/commands/search.d.ts +1 -0
  62. package/dist/cli/commands/search.js +18 -4
  63. package/dist/cli/commands/search.js.map +1 -1
  64. package/dist/cli/commands/stats.d.ts +8 -1
  65. package/dist/cli/commands/stats.js +18 -17
  66. package/dist/cli/commands/stats.js.map +1 -1
  67. package/dist/cli/commands/telemetry.d.ts +8 -0
  68. package/dist/cli/commands/telemetry.js +253 -0
  69. package/dist/cli/commands/telemetry.js.map +1 -0
  70. package/dist/cli/commands/test.js +4 -3
  71. package/dist/cli/commands/test.js.map +1 -1
  72. package/dist/cli/commands/update-many.js +69 -140
  73. package/dist/cli/commands/update-many.js.map +1 -1
  74. package/dist/cli/commands/update.d.ts +2 -0
  75. package/dist/cli/commands/update.js +138 -119
  76. package/dist/cli/commands/update.js.map +1 -1
  77. package/dist/cli/commands/validate.d.ts +1 -0
  78. package/dist/cli/commands/validate.js +63 -33
  79. package/dist/cli/commands/validate.js.map +1 -1
  80. package/dist/cli/error-guidance.js +26 -3
  81. package/dist/cli/error-guidance.js.map +1 -1
  82. package/dist/cli/help-content.js +91 -3
  83. package/dist/cli/help-content.js.map +1 -1
  84. package/dist/cli/main.js +377 -23
  85. package/dist/cli/main.js.map +1 -1
  86. package/dist/cli/register-list-query.js +14 -5
  87. package/dist/cli/register-list-query.js.map +1 -1
  88. package/dist/cli/register-mutation.js +200 -28
  89. package/dist/cli/register-mutation.js.map +1 -1
  90. package/dist/cli/register-operations.js +31 -6
  91. package/dist/cli/register-operations.js.map +1 -1
  92. package/dist/cli/register-setup.js +4 -2
  93. package/dist/cli/register-setup.js.map +1 -1
  94. package/dist/cli/registration-helpers.js +31 -4
  95. package/dist/cli/registration-helpers.js.map +1 -1
  96. package/dist/cli-bundle/chunks/activity-CVXTCHYY.js +16 -0
  97. package/dist/cli-bundle/chunks/activity-JM6DTDND.js +20 -0
  98. package/dist/cli-bundle/chunks/activity-JM6DTDND.js.map +1 -0
  99. package/dist/cli-bundle/chunks/aggregate-GI7WSZPH.js +206 -0
  100. package/dist/cli-bundle/chunks/aggregate-GI7WSZPH.js.map +1 -0
  101. package/dist/cli-bundle/chunks/{aggregate-ADUOSFRO.js → aggregate-VNAHUNNF.js} +11 -11
  102. package/dist/cli-bundle/chunks/{append-JD2DETU7.js → append-7H5N64R2.js} +8 -9
  103. package/dist/cli-bundle/chunks/{append-JD2DETU7.js.map → append-7H5N64R2.js.map} +1 -1
  104. package/dist/cli-bundle/chunks/append-WMKRXKCE.js +69 -0
  105. package/dist/cli-bundle/chunks/append-WMKRXKCE.js.map +1 -0
  106. package/dist/cli-bundle/chunks/{chunk-3M73P3G6.js → chunk-23YFZ3IG.js} +210 -132
  107. package/dist/cli-bundle/chunks/chunk-23YFZ3IG.js.map +7 -0
  108. package/dist/cli-bundle/chunks/chunk-2HVRUSQA.js +128 -0
  109. package/dist/cli-bundle/chunks/chunk-2HVRUSQA.js.map +1 -0
  110. package/dist/cli-bundle/chunks/chunk-2RSPZI5H.js +266 -0
  111. package/dist/cli-bundle/chunks/chunk-2RSPZI5H.js.map +1 -0
  112. package/dist/cli-bundle/chunks/chunk-2VBQ6ZXS.js +631 -0
  113. package/dist/cli-bundle/chunks/chunk-2VBQ6ZXS.js.map +1 -0
  114. package/dist/cli-bundle/chunks/chunk-2VVCGBNV.js +380 -0
  115. package/dist/cli-bundle/chunks/chunk-2VVCGBNV.js.map +1 -0
  116. package/dist/cli-bundle/chunks/chunk-3BWOVLTH.js +1664 -0
  117. package/dist/cli-bundle/chunks/chunk-3BWOVLTH.js.map +1 -0
  118. package/dist/cli-bundle/chunks/{chunk-6HT2F4TK.js → chunk-3FI4SEFT.js} +175 -54
  119. package/dist/cli-bundle/chunks/chunk-3FI4SEFT.js.map +7 -0
  120. package/dist/cli-bundle/chunks/{chunk-JULRTHJQ.js → chunk-3LB74A67.js} +119 -6
  121. package/dist/cli-bundle/chunks/chunk-3LB74A67.js.map +7 -0
  122. package/dist/cli-bundle/chunks/chunk-3VAM3NNM.js +57 -0
  123. package/dist/cli-bundle/chunks/chunk-3VAM3NNM.js.map +1 -0
  124. package/dist/cli-bundle/chunks/chunk-4LL6TK5B.js +1832 -0
  125. package/dist/cli-bundle/chunks/chunk-4LL6TK5B.js.map +1 -0
  126. package/dist/cli-bundle/chunks/chunk-52MAOQ6J.js +422 -0
  127. package/dist/cli-bundle/chunks/chunk-52MAOQ6J.js.map +7 -0
  128. package/dist/cli-bundle/chunks/chunk-5FDATVEZ.js +412 -0
  129. package/dist/cli-bundle/chunks/chunk-5FDATVEZ.js.map +1 -0
  130. package/dist/cli-bundle/chunks/chunk-5SFCOO6B.js +5622 -0
  131. package/dist/cli-bundle/chunks/chunk-5SFCOO6B.js.map +1 -0
  132. package/dist/cli-bundle/chunks/{chunk-U7FMKRXH.js → chunk-6ER6DXH5.js} +37 -16
  133. package/dist/cli-bundle/chunks/chunk-6ER6DXH5.js.map +7 -0
  134. package/dist/cli-bundle/chunks/chunk-6P6GGMOG.js +218 -0
  135. package/dist/cli-bundle/chunks/chunk-6P6GGMOG.js.map +1 -0
  136. package/dist/cli-bundle/chunks/chunk-77GFDHGF.js +80 -0
  137. package/dist/cli-bundle/chunks/chunk-77GFDHGF.js.map +1 -0
  138. package/dist/cli-bundle/chunks/{chunk-MD7K4JYF.js → chunk-AO442XLN.js} +26 -15
  139. package/dist/cli-bundle/chunks/chunk-AO442XLN.js.map +7 -0
  140. package/dist/cli-bundle/chunks/chunk-AY43SBIN.js +751 -0
  141. package/dist/cli-bundle/chunks/chunk-AY43SBIN.js.map +1 -0
  142. package/dist/cli-bundle/chunks/{chunk-D7AOMPRH.js → chunk-BQHUILZS.js} +5 -5
  143. package/dist/cli-bundle/chunks/chunk-E5FJNAZA.js +242 -0
  144. package/dist/cli-bundle/chunks/chunk-E5FJNAZA.js.map +1 -0
  145. package/dist/cli-bundle/chunks/{chunk-OGZEG5TT.js → chunk-ECCMVXGM.js} +164 -53
  146. package/dist/cli-bundle/chunks/chunk-ECCMVXGM.js.map +7 -0
  147. package/dist/cli-bundle/chunks/chunk-FRAUKRU2.js +182 -0
  148. package/dist/cli-bundle/chunks/chunk-FRAUKRU2.js.map +1 -0
  149. package/dist/cli-bundle/chunks/chunk-GCOQW437.js +130 -0
  150. package/dist/cli-bundle/chunks/chunk-GCOQW437.js.map +1 -0
  151. package/dist/cli-bundle/chunks/chunk-GGYWB3Y2.js +1340 -0
  152. package/dist/cli-bundle/chunks/chunk-GGYWB3Y2.js.map +1 -0
  153. package/dist/cli-bundle/chunks/{chunk-G57E5D7T.js → chunk-GU2ZJ2VV.js} +5 -5
  154. package/dist/cli-bundle/chunks/chunk-GXSUPCBV.js +231 -0
  155. package/dist/cli-bundle/chunks/chunk-GXSUPCBV.js.map +1 -0
  156. package/dist/cli-bundle/chunks/chunk-HZGUAH22.js +76 -0
  157. package/dist/cli-bundle/chunks/chunk-HZGUAH22.js.map +1 -0
  158. package/dist/cli-bundle/chunks/chunk-I2HSTRJF.js +346 -0
  159. package/dist/cli-bundle/chunks/chunk-I2HSTRJF.js.map +1 -0
  160. package/dist/cli-bundle/chunks/chunk-I6BNFU5X.js +140 -0
  161. package/dist/cli-bundle/chunks/chunk-I6BNFU5X.js.map +7 -0
  162. package/dist/cli-bundle/chunks/{chunk-JTWRXG4B.js → chunk-IJGCZSIQ.js} +251 -251
  163. package/dist/cli-bundle/chunks/chunk-IJGCZSIQ.js.map +7 -0
  164. package/dist/cli-bundle/chunks/chunk-IOR7LGF4.js +1491 -0
  165. package/dist/cli-bundle/chunks/chunk-IOR7LGF4.js.map +1 -0
  166. package/dist/cli-bundle/chunks/chunk-IUV734HF.js +17 -0
  167. package/dist/cli-bundle/chunks/chunk-IUV734HF.js.map +1 -0
  168. package/dist/cli-bundle/chunks/chunk-J27KIHTG.js +15 -0
  169. package/dist/cli-bundle/chunks/chunk-J27KIHTG.js.map +1 -0
  170. package/dist/cli-bundle/chunks/{chunk-AKOOMO3T.js → chunk-KAG77BY3.js} +2 -2
  171. package/dist/cli-bundle/chunks/{chunk-KBQY3YG5.js → chunk-KJ33AOCY.js} +3 -3
  172. package/dist/cli-bundle/chunks/{chunk-WDPXDQFG.js → chunk-KJE2FOS4.js} +6 -4
  173. package/dist/cli-bundle/chunks/chunk-KJE2FOS4.js.map +7 -0
  174. package/dist/cli-bundle/chunks/chunk-KWU6HG75.js +3883 -0
  175. package/dist/cli-bundle/chunks/chunk-KWU6HG75.js.map +1 -0
  176. package/dist/cli-bundle/chunks/chunk-LB3RUL2N.js +1325 -0
  177. package/dist/cli-bundle/chunks/chunk-LB3RUL2N.js.map +1 -0
  178. package/dist/cli-bundle/chunks/{chunk-5HSEP75M.js → chunk-LCM63IXU.js} +18 -6
  179. package/dist/cli-bundle/chunks/chunk-LCM63IXU.js.map +7 -0
  180. package/dist/cli-bundle/chunks/chunk-LXYVKYMQ.js +24 -0
  181. package/dist/cli-bundle/chunks/chunk-LXYVKYMQ.js.map +1 -0
  182. package/dist/cli-bundle/chunks/chunk-ME2YH6FN.js +182 -0
  183. package/dist/cli-bundle/chunks/chunk-ME2YH6FN.js.map +1 -0
  184. package/dist/cli-bundle/chunks/chunk-MITFDD35.js +1809 -0
  185. package/dist/cli-bundle/chunks/chunk-MITFDD35.js.map +1 -0
  186. package/dist/cli-bundle/chunks/{chunk-WJ2NAC37.js → chunk-N7ACFE26.js} +3 -3
  187. package/dist/cli-bundle/chunks/chunk-NUZ5HKR4.js +332 -0
  188. package/dist/cli-bundle/chunks/chunk-NUZ5HKR4.js.map +1 -0
  189. package/dist/cli-bundle/chunks/{chunk-7Y53ZJIQ.js → chunk-OVQCEJPG.js} +22 -3
  190. package/dist/cli-bundle/chunks/chunk-OVQCEJPG.js.map +7 -0
  191. package/dist/cli-bundle/chunks/{chunk-PXUAZUUY.js → chunk-OZ7NSQHL.js} +12 -11
  192. package/dist/cli-bundle/chunks/chunk-OZ7NSQHL.js.map +7 -0
  193. package/dist/cli-bundle/chunks/{chunk-P53TN6IA.js → chunk-PDDFYW4X.js} +35 -8
  194. package/dist/cli-bundle/chunks/chunk-PDDFYW4X.js.map +7 -0
  195. package/dist/cli-bundle/chunks/{chunk-6YCV7WSL.js → chunk-PIU6RSL3.js} +10 -12
  196. package/dist/cli-bundle/chunks/{chunk-6YCV7WSL.js.map → chunk-PIU6RSL3.js.map} +1 -1
  197. package/dist/cli-bundle/chunks/chunk-PO3GSVFV.js +338 -0
  198. package/dist/cli-bundle/chunks/chunk-PO3GSVFV.js.map +1 -0
  199. package/dist/cli-bundle/chunks/{chunk-LRBOHPUE.js → chunk-PRJCELV4.js} +108 -21
  200. package/dist/cli-bundle/chunks/chunk-PRJCELV4.js.map +7 -0
  201. package/dist/cli-bundle/chunks/{chunk-GN7IJPCD.js → chunk-PROOHX4K.js} +332 -32
  202. package/dist/cli-bundle/chunks/chunk-PROOHX4K.js.map +7 -0
  203. package/dist/cli-bundle/chunks/{chunk-FQE6XZDB.js → chunk-Q7SPNHLW.js} +54 -32
  204. package/dist/cli-bundle/chunks/chunk-Q7SPNHLW.js.map +7 -0
  205. package/dist/cli-bundle/chunks/{chunk-PVNQLCIS.js → chunk-QO7EBBOM.js} +2 -2
  206. package/dist/cli-bundle/chunks/{chunk-A7E7PUVX.js → chunk-R6UFP2GE.js} +7 -7
  207. package/dist/cli-bundle/chunks/chunk-RWPSOIEE.js +154 -0
  208. package/dist/cli-bundle/chunks/chunk-RWPSOIEE.js.map +1 -0
  209. package/dist/cli-bundle/chunks/chunk-RZN6VURO.js +119 -0
  210. package/dist/cli-bundle/chunks/chunk-RZN6VURO.js.map +1 -0
  211. package/dist/cli-bundle/chunks/chunk-SKJWX3QB.js +1501 -0
  212. package/dist/cli-bundle/chunks/chunk-SKJWX3QB.js.map +7 -0
  213. package/dist/cli-bundle/chunks/{chunk-CEFIVZPG.js → chunk-T3LC5LKB.js} +2 -2
  214. package/dist/cli-bundle/chunks/chunk-TCD3R2PF.js +173 -0
  215. package/dist/cli-bundle/chunks/chunk-TCD3R2PF.js.map +1 -0
  216. package/dist/cli-bundle/chunks/chunk-TPH5XEVD.js +2988 -0
  217. package/dist/cli-bundle/chunks/chunk-TPH5XEVD.js.map +1 -0
  218. package/dist/cli-bundle/chunks/{chunk-LSXGH6NE.js → chunk-U5SXYXSY.js} +821 -200
  219. package/dist/cli-bundle/chunks/chunk-U5SXYXSY.js.map +7 -0
  220. package/dist/cli-bundle/chunks/chunk-UBOPJT3S.js +540 -0
  221. package/dist/cli-bundle/chunks/chunk-UBOPJT3S.js.map +1 -0
  222. package/dist/cli-bundle/chunks/{chunk-JFWUHHS2.js → chunk-UM2GBHS4.js} +5 -4
  223. package/dist/cli-bundle/chunks/chunk-W7XABV4H.js +454 -0
  224. package/dist/cli-bundle/chunks/chunk-W7XABV4H.js.map +1 -0
  225. package/dist/cli-bundle/chunks/{chunk-SEXQN4KL.js → chunk-WKY2IBOQ.js} +3 -3
  226. package/dist/cli-bundle/chunks/chunk-WOPXVEZP.js +698 -0
  227. package/dist/cli-bundle/chunks/chunk-WOPXVEZP.js.map +1 -0
  228. package/dist/cli-bundle/chunks/chunk-WSMOSYRD.js +1704 -0
  229. package/dist/cli-bundle/chunks/chunk-WSMOSYRD.js.map +1 -0
  230. package/dist/cli-bundle/chunks/{chunk-NGN7UV5K.js → chunk-XLTD2HN3.js} +2 -2
  231. package/dist/cli-bundle/chunks/chunk-XSJCLN2R.js +131 -0
  232. package/dist/cli-bundle/chunks/chunk-XSJCLN2R.js.map +7 -0
  233. package/dist/cli-bundle/chunks/chunk-XSLQSXAH.js +53 -0
  234. package/dist/cli-bundle/chunks/chunk-XSLQSXAH.js.map +1 -0
  235. package/dist/cli-bundle/chunks/{chunk-BUPWJ3IJ.js → chunk-XTGLRY2Y.js} +484 -49
  236. package/dist/cli-bundle/chunks/chunk-XTGLRY2Y.js.map +7 -0
  237. package/dist/cli-bundle/chunks/{chunk-L2FXEKDB.js → chunk-YL2DJGYS.js} +7 -7
  238. package/dist/cli-bundle/chunks/{claim-EE4TKKCV.js → claim-4DBF6RVG.js} +10 -11
  239. package/dist/cli-bundle/chunks/{claim-EE4TKKCV.js.map → claim-4DBF6RVG.js.map} +1 -1
  240. package/dist/cli-bundle/chunks/claim-X2P4IB7J.js +129 -0
  241. package/dist/cli-bundle/chunks/claim-X2P4IB7J.js.map +1 -0
  242. package/dist/cli-bundle/chunks/close-3HDWDA3L.js +13 -0
  243. package/dist/cli-bundle/chunks/close-PTYFA45H.js +17 -0
  244. package/dist/cli-bundle/chunks/close-PTYFA45H.js.map +1 -0
  245. package/dist/cli-bundle/chunks/close-many-7CGIDPTJ.js +314 -0
  246. package/dist/cli-bundle/chunks/close-many-7CGIDPTJ.js.map +7 -0
  247. package/dist/cli-bundle/chunks/close-many-ERFO6LHR.js +311 -0
  248. package/dist/cli-bundle/chunks/close-many-ERFO6LHR.js.map +1 -0
  249. package/dist/cli-bundle/chunks/comments-OONGABK5.js +100 -0
  250. package/dist/cli-bundle/chunks/comments-OONGABK5.js.map +1 -0
  251. package/dist/cli-bundle/chunks/{comments-AAKJQ6LW.js → comments-QKBYCWKD.js} +10 -11
  252. package/dist/cli-bundle/chunks/{comments-AAKJQ6LW.js.map → comments-QKBYCWKD.js.map} +1 -1
  253. package/dist/cli-bundle/chunks/config-6FXCQKIF.js +1671 -0
  254. package/dist/cli-bundle/chunks/config-6FXCQKIF.js.map +1 -0
  255. package/dist/cli-bundle/chunks/{config-V3FZOKLI.js → config-U4RZ4CQB.js} +121 -10
  256. package/dist/cli-bundle/chunks/config-U4RZ4CQB.js.map +7 -0
  257. package/dist/cli-bundle/chunks/{context-RZ5QPNJB.js → context-FYYJGFWS.js} +32 -19
  258. package/dist/cli-bundle/chunks/{context-RZ5QPNJB.js.map → context-FYYJGFWS.js.map} +2 -2
  259. package/dist/cli-bundle/chunks/context-YMJ3Z2HQ.js +1461 -0
  260. package/dist/cli-bundle/chunks/context-YMJ3Z2HQ.js.map +1 -0
  261. package/dist/cli-bundle/chunks/contracts-QDB6OMLQ.js +1278 -0
  262. package/dist/cli-bundle/chunks/contracts-QDB6OMLQ.js.map +1 -0
  263. package/dist/cli-bundle/chunks/{contracts-YLMH33VU.js → contracts-RFSPGVVJ.js} +198 -162
  264. package/dist/cli-bundle/chunks/contracts-RFSPGVVJ.js.map +7 -0
  265. package/dist/cli-bundle/chunks/create-I5L4EYYZ.js +31 -0
  266. package/dist/cli-bundle/chunks/create-I5L4EYYZ.js.map +1 -0
  267. package/dist/cli-bundle/chunks/create-JTZNCTQC.js +27 -0
  268. package/dist/cli-bundle/chunks/delete-7HPGI4GZ.js +55 -0
  269. package/dist/cli-bundle/chunks/delete-7HPGI4GZ.js.map +1 -0
  270. package/dist/cli-bundle/chunks/{delete-RHCTEORS.js → delete-VXUPH5RS.js} +7 -8
  271. package/dist/cli-bundle/chunks/{delete-RHCTEORS.js.map → delete-VXUPH5RS.js.map} +1 -1
  272. package/dist/cli-bundle/chunks/{deps-MZYCMLAO.js → deps-JSRRWC3Z.js} +7 -8
  273. package/dist/cli-bundle/chunks/{deps-MZYCMLAO.js.map → deps-JSRRWC3Z.js.map} +1 -1
  274. package/dist/cli-bundle/chunks/deps-SCZIFK2Z.js +225 -0
  275. package/dist/cli-bundle/chunks/deps-SCZIFK2Z.js.map +1 -0
  276. package/dist/cli-bundle/chunks/docs-GJK6K4VP.js +31 -0
  277. package/dist/cli-bundle/chunks/docs-GJK6K4VP.js.map +1 -0
  278. package/dist/cli-bundle/chunks/{docs-FXXUCZYU.js → docs-WW4N3MBM.js} +9 -10
  279. package/dist/cli-bundle/chunks/{docs-FXXUCZYU.js.map → docs-WW4N3MBM.js.map} +1 -1
  280. package/dist/cli-bundle/chunks/{extension-B4WL7BQU.js → extension-J7IBMFTD.js} +4 -5
  281. package/dist/cli-bundle/chunks/extension-VDY2U33M.js +28 -0
  282. package/dist/cli-bundle/chunks/extension-VDY2U33M.js.map +1 -0
  283. package/dist/cli-bundle/chunks/files-ISZJGILQ.js +282 -0
  284. package/dist/cli-bundle/chunks/files-ISZJGILQ.js.map +1 -0
  285. package/dist/cli-bundle/chunks/{files-WVOX67PE.js → files-WKOD326U.js} +9 -10
  286. package/dist/cli-bundle/chunks/{files-WVOX67PE.js.map → files-WKOD326U.js.map} +1 -1
  287. package/dist/cli-bundle/chunks/gc-JDVJ6OQ2.js +362 -0
  288. package/dist/cli-bundle/chunks/gc-JDVJ6OQ2.js.map +1 -0
  289. package/dist/cli-bundle/chunks/gc-ULPVWMTN.js +372 -0
  290. package/dist/cli-bundle/chunks/gc-ULPVWMTN.js.map +7 -0
  291. package/dist/cli-bundle/chunks/get-RV37HT3G.js +194 -0
  292. package/dist/cli-bundle/chunks/get-RV37HT3G.js.map +1 -0
  293. package/dist/cli-bundle/chunks/{get-LTK3HOCQ.js → get-WXU6WI5P.js} +16 -17
  294. package/dist/cli-bundle/chunks/get-WXU6WI5P.js.map +7 -0
  295. package/dist/cli-bundle/chunks/{health-TCWL55KM.js → health-6L6EH4WR.js} +57 -16
  296. package/dist/cli-bundle/chunks/health-6L6EH4WR.js.map +7 -0
  297. package/dist/cli-bundle/chunks/health-LOI2HHKB.js +1271 -0
  298. package/dist/cli-bundle/chunks/health-LOI2HHKB.js.map +1 -0
  299. package/dist/cli-bundle/chunks/history-2BA3T5AE.js +20 -0
  300. package/dist/cli-bundle/chunks/history-PKN67D5O.js +24 -0
  301. package/dist/cli-bundle/chunks/history-PKN67D5O.js.map +1 -0
  302. package/dist/cli-bundle/chunks/history-redact-JBZNXHGR.js +19 -0
  303. package/dist/cli-bundle/chunks/history-redact-V4FOJGS7.js +23 -0
  304. package/dist/cli-bundle/chunks/history-redact-V4FOJGS7.js.map +1 -0
  305. package/dist/cli-bundle/chunks/{history-repair-ZWSTDRH2.js → history-repair-HIBCBIKK.js} +12 -14
  306. package/dist/cli-bundle/chunks/{history-repair-ZWSTDRH2.js.map → history-repair-HIBCBIKK.js.map} +1 -1
  307. package/dist/cli-bundle/chunks/history-repair-SDMHR7JT.js +193 -0
  308. package/dist/cli-bundle/chunks/history-repair-SDMHR7JT.js.map +1 -0
  309. package/dist/cli-bundle/chunks/init-HIVSNX3O.js +16 -0
  310. package/dist/cli-bundle/chunks/init-P56QYWJF.js +20 -0
  311. package/dist/cli-bundle/chunks/init-P56QYWJF.js.map +1 -0
  312. package/dist/cli-bundle/chunks/learnings-GDFRG5J7.js +44 -0
  313. package/dist/cli-bundle/chunks/learnings-GDFRG5J7.js.map +1 -0
  314. package/dist/cli-bundle/chunks/{learnings-NXTWE3FR.js → learnings-MIXSESLK.js} +10 -11
  315. package/dist/cli-bundle/chunks/{learnings-NXTWE3FR.js.map → learnings-MIXSESLK.js.map} +1 -1
  316. package/dist/cli-bundle/chunks/list-FGOWQMSM.js +24 -0
  317. package/dist/cli-bundle/chunks/list-FGOWQMSM.js.map +1 -0
  318. package/dist/cli-bundle/chunks/list-MUSQNMTD.js +20 -0
  319. package/dist/cli-bundle/chunks/{notes-DFS5ZGOO.js → notes-4XVSH2AZ.js} +10 -11
  320. package/dist/cli-bundle/chunks/{notes-DFS5ZGOO.js.map → notes-4XVSH2AZ.js.map} +1 -1
  321. package/dist/cli-bundle/chunks/notes-5UK3GEH2.js +44 -0
  322. package/dist/cli-bundle/chunks/notes-5UK3GEH2.js.map +1 -0
  323. package/dist/cli-bundle/chunks/plan-DUMBV3QB.js +1171 -0
  324. package/dist/cli-bundle/chunks/plan-DUMBV3QB.js.map +1 -0
  325. package/dist/cli-bundle/chunks/{plan-67AB2PLM.js → plan-SLMODHWX.js} +13 -14
  326. package/dist/cli-bundle/chunks/{plan-67AB2PLM.js.map → plan-SLMODHWX.js.map} +1 -1
  327. package/dist/cli-bundle/chunks/register-list-query-POCFZ5JW.js +229 -0
  328. package/dist/cli-bundle/chunks/register-list-query-POCFZ5JW.js.map +1 -0
  329. package/dist/cli-bundle/chunks/{register-list-query-UP3VRUFS.js → register-list-query-WST76HSQ.js} +26 -26
  330. package/dist/cli-bundle/chunks/register-list-query-WST76HSQ.js.map +7 -0
  331. package/dist/cli-bundle/chunks/register-mutation-N5GSUZJV.js +813 -0
  332. package/dist/cli-bundle/chunks/register-mutation-N5GSUZJV.js.map +1 -0
  333. package/dist/cli-bundle/chunks/{register-mutation-YWSBF545.js → register-mutation-OA675SOU.js} +154 -43
  334. package/dist/cli-bundle/chunks/register-mutation-OA675SOU.js.map +7 -0
  335. package/dist/cli-bundle/chunks/register-operations-GNHBE5I3.js +383 -0
  336. package/dist/cli-bundle/chunks/register-operations-GNHBE5I3.js.map +1 -0
  337. package/dist/cli-bundle/chunks/{register-operations-3BDTGSDH.js → register-operations-N3PMHXH5.js} +49 -37
  338. package/dist/cli-bundle/chunks/register-operations-N3PMHXH5.js.map +7 -0
  339. package/dist/cli-bundle/chunks/register-setup-JIMPKJKV.js +242 -0
  340. package/dist/cli-bundle/chunks/register-setup-JIMPKJKV.js.map +1 -0
  341. package/dist/cli-bundle/chunks/{register-setup-V56GDRUS.js → register-setup-ZHJI2DI3.js} +18 -19
  342. package/dist/cli-bundle/chunks/{register-setup-V56GDRUS.js.map → register-setup-ZHJI2DI3.js.map} +2 -2
  343. package/dist/cli-bundle/chunks/restore-D4RGNX33.js +17 -0
  344. package/dist/cli-bundle/chunks/restore-PBL6T5TW.js +21 -0
  345. package/dist/cli-bundle/chunks/restore-PBL6T5TW.js.map +1 -0
  346. package/dist/cli-bundle/chunks/schema-2NOO6NGB.js +780 -0
  347. package/dist/cli-bundle/chunks/schema-2NOO6NGB.js.map +7 -0
  348. package/dist/cli-bundle/chunks/schema-EBI4NLUO.js +770 -0
  349. package/dist/cli-bundle/chunks/schema-EBI4NLUO.js.map +1 -0
  350. package/dist/cli-bundle/chunks/search-JPUQTVCY.js +1127 -0
  351. package/dist/cli-bundle/chunks/search-JPUQTVCY.js.map +1 -0
  352. package/dist/cli-bundle/chunks/{search-HENBL456.js → search-OA6JX27A.js} +25 -16
  353. package/dist/cli-bundle/chunks/search-OA6JX27A.js.map +7 -0
  354. package/dist/cli-bundle/chunks/stats-CV54BAWY.js +202 -0
  355. package/dist/cli-bundle/chunks/stats-CV54BAWY.js.map +1 -0
  356. package/dist/cli-bundle/chunks/stats-XYB6KTFG.js +212 -0
  357. package/dist/cli-bundle/chunks/stats-XYB6KTFG.js.map +7 -0
  358. package/dist/cli-bundle/chunks/telemetry-LMJ7PFUO.js +251 -0
  359. package/dist/cli-bundle/chunks/telemetry-LMJ7PFUO.js.map +7 -0
  360. package/dist/cli-bundle/chunks/telemetry-NCMEPJNR.js +248 -0
  361. package/dist/cli-bundle/chunks/telemetry-NCMEPJNR.js.map +1 -0
  362. package/dist/cli-bundle/chunks/test-MXX3E5JL.js +31 -0
  363. package/dist/cli-bundle/chunks/test-WBROAJIE.js +35 -0
  364. package/dist/cli-bundle/chunks/test-WBROAJIE.js.map +1 -0
  365. package/dist/cli-bundle/chunks/test-all-N6NSRDTV.js +328 -0
  366. package/dist/cli-bundle/chunks/test-all-N6NSRDTV.js.map +1 -0
  367. package/dist/cli-bundle/chunks/{test-all-G2AZOHXI.js → test-all-NTOZ7C3M.js} +13 -14
  368. package/dist/cli-bundle/chunks/{test-all-G2AZOHXI.js.map → test-all-NTOZ7C3M.js.map} +1 -1
  369. package/dist/cli-bundle/chunks/test-runs-V6A7LPWZ.js +929 -0
  370. package/dist/cli-bundle/chunks/test-runs-V6A7LPWZ.js.map +1 -0
  371. package/dist/cli-bundle/chunks/{test-runs-GX5HTPSF.js → test-runs-WMVTQU3Y.js} +5 -5
  372. package/dist/cli-bundle/chunks/update-OSV3NAQB.js +25 -0
  373. package/dist/cli-bundle/chunks/update-OSV3NAQB.js.map +1 -0
  374. package/dist/cli-bundle/chunks/update-YRXSUGYQ.js +21 -0
  375. package/dist/cli-bundle/chunks/update-many-EM6OXYGO.js +605 -0
  376. package/dist/cli-bundle/chunks/update-many-EM6OXYGO.js.map +1 -0
  377. package/dist/cli-bundle/chunks/{update-many-46HRSP2Q.js → update-many-KGGEYABR.js} +78 -146
  378. package/dist/cli-bundle/chunks/update-many-KGGEYABR.js.map +7 -0
  379. package/dist/cli-bundle/chunks/{upgrade-H5HHM5UV.js → upgrade-BLI7XBAJ.js} +5 -7
  380. package/dist/cli-bundle/chunks/{upgrade-H5HHM5UV.js.map → upgrade-BLI7XBAJ.js.map} +1 -1
  381. package/dist/cli-bundle/chunks/upgrade-LXPOQKFV.js +266 -0
  382. package/dist/cli-bundle/chunks/upgrade-LXPOQKFV.js.map +1 -0
  383. package/dist/cli-bundle/chunks/{validate-TMCVKIGZ.js → validate-AGOAUOVW.js} +61 -48
  384. package/dist/cli-bundle/chunks/validate-AGOAUOVW.js.map +7 -0
  385. package/dist/cli-bundle/chunks/validate-L5J6A7YO.js +1120 -0
  386. package/dist/cli-bundle/chunks/validate-L5J6A7YO.js.map +1 -0
  387. package/dist/cli-bundle/main.js +534 -1505
  388. package/dist/cli-bundle/main.js.map +4 -4
  389. package/dist/core/checkpoint/mutation-checkpoint.d.ts +44 -0
  390. package/dist/core/checkpoint/mutation-checkpoint.js +119 -0
  391. package/dist/core/checkpoint/mutation-checkpoint.js.map +1 -0
  392. package/dist/core/config/positional-value.js +4 -2
  393. package/dist/core/config/positional-value.js.map +1 -1
  394. package/dist/core/diagnostics/remediation.d.ts +73 -0
  395. package/dist/core/diagnostics/remediation.js +328 -0
  396. package/dist/core/diagnostics/remediation.js.map +1 -0
  397. package/dist/core/extensions/extension-hook-runtime.js +9 -2
  398. package/dist/core/extensions/extension-hook-runtime.js.map +1 -1
  399. package/dist/core/extensions/extension-types.d.ts +60 -4
  400. package/dist/core/extensions/extension-types.js +2 -2
  401. package/dist/core/extensions/extension-types.js.map +1 -1
  402. package/dist/core/extensions/index.d.ts +5 -1
  403. package/dist/core/extensions/index.js +61 -2
  404. package/dist/core/extensions/index.js.map +1 -1
  405. package/dist/core/extensions/item-fields.d.ts +5 -1
  406. package/dist/core/extensions/item-fields.js +126 -4
  407. package/dist/core/extensions/item-fields.js.map +1 -1
  408. package/dist/core/extensions/loader.js +283 -8
  409. package/dist/core/extensions/loader.js.map +1 -1
  410. package/dist/core/history/history-diff.d.ts +47 -0
  411. package/dist/core/history/history-diff.js +152 -0
  412. package/dist/core/history/history-diff.js.map +1 -0
  413. package/dist/core/history/history-storage-stats.d.ts +31 -0
  414. package/dist/core/history/history-storage-stats.js +101 -0
  415. package/dist/core/history/history-storage-stats.js.map +1 -0
  416. package/dist/core/item/item-format.d.ts +3 -2
  417. package/dist/core/item/item-format.js +15 -10
  418. package/dist/core/item/item-format.js.map +1 -1
  419. package/dist/core/item/status-filter.d.ts +29 -0
  420. package/dist/core/item/status-filter.js +97 -0
  421. package/dist/core/item/status-filter.js.map +1 -0
  422. package/dist/core/item/type-registry.js +4 -2
  423. package/dist/core/item/type-registry.js.map +1 -1
  424. package/dist/core/lock/lock-gc.d.ts +46 -0
  425. package/dist/core/lock/lock-gc.js +194 -0
  426. package/dist/core/lock/lock-gc.js.map +1 -0
  427. package/dist/core/output/output.js +17 -5
  428. package/dist/core/output/output.js.map +1 -1
  429. package/dist/core/schema/item-types-file.d.ts +15 -0
  430. package/dist/core/schema/item-types-file.js +27 -2
  431. package/dist/core/schema/item-types-file.js.map +1 -1
  432. package/dist/core/schema/runtime-field-filters.js +4 -3
  433. package/dist/core/schema/runtime-field-filters.js.map +1 -1
  434. package/dist/core/schema/runtime-field-values.d.ts +1 -1
  435. package/dist/core/schema/runtime-field-values.js +10 -4
  436. package/dist/core/schema/runtime-field-values.js.map +1 -1
  437. package/dist/core/schema/runtime-schema.js +75 -2
  438. package/dist/core/schema/runtime-schema.js.map +1 -1
  439. package/dist/core/schema/status-defs-file.d.ts +113 -0
  440. package/dist/core/schema/status-defs-file.js +260 -0
  441. package/dist/core/schema/status-defs-file.js.map +1 -0
  442. package/dist/core/schema/type-workflows.d.ts +64 -0
  443. package/dist/core/schema/type-workflows.js +98 -0
  444. package/dist/core/schema/type-workflows.js.map +1 -0
  445. package/dist/core/search/cache.d.ts +3 -1
  446. package/dist/core/search/cache.js +104 -28
  447. package/dist/core/search/cache.js.map +1 -1
  448. package/dist/core/search/http-client.d.ts +2 -2
  449. package/dist/core/search/http-client.js +2 -2
  450. package/dist/core/search/http-client.js.map +1 -1
  451. package/dist/core/search/vector-stores.d.ts +1 -0
  452. package/dist/core/search/vector-stores.js +64 -14
  453. package/dist/core/search/vector-stores.js.map +1 -1
  454. package/dist/core/search/vectorization-metadata.d.ts +13 -0
  455. package/dist/core/search/vectorization-metadata.js +65 -0
  456. package/dist/core/search/vectorization-metadata.js.map +1 -0
  457. package/dist/core/shared/serial-queue.d.ts +12 -0
  458. package/dist/core/shared/serial-queue.js +43 -0
  459. package/dist/core/shared/serial-queue.js.map +1 -0
  460. package/dist/core/shared/serialization.d.ts +1 -0
  461. package/dist/core/shared/serialization.js +86 -2
  462. package/dist/core/shared/serialization.js.map +1 -1
  463. package/dist/core/store/front-matter-cache.js +14 -5
  464. package/dist/core/store/front-matter-cache.js.map +1 -1
  465. package/dist/core/store/item-store.d.ts +2 -0
  466. package/dist/core/store/item-store.js +61 -6
  467. package/dist/core/store/item-store.js.map +1 -1
  468. package/dist/core/store/settings-validator.js +18 -2
  469. package/dist/core/store/settings-validator.js.map +1 -1
  470. package/dist/core/store/settings.d.ts +19 -1
  471. package/dist/core/store/settings.js +130 -10
  472. package/dist/core/store/settings.js.map +1 -1
  473. package/dist/core/telemetry/consent.js +3 -3
  474. package/dist/core/telemetry/consent.js.map +1 -1
  475. package/dist/core/telemetry/observability.js +5 -4
  476. package/dist/core/telemetry/observability.js.map +1 -1
  477. package/dist/core/telemetry/runtime.js +16 -4
  478. package/dist/core/telemetry/runtime.js.map +1 -1
  479. package/dist/mcp/server.d.ts +1 -0
  480. package/dist/mcp/server.js +372 -45
  481. package/dist/mcp/server.js.map +1 -1
  482. package/dist/sdk/cli-contracts/commander-mutation-options.js +16 -2
  483. package/dist/sdk/cli-contracts/commander-mutation-options.js.map +1 -1
  484. package/dist/sdk/cli-contracts/commander-types.js +7 -2
  485. package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
  486. package/dist/sdk/cli-contracts/enum-contracts.d.ts +2 -2
  487. package/dist/sdk/cli-contracts/enum-contracts.js +6 -2
  488. package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
  489. package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +1 -0
  490. package/dist/sdk/cli-contracts/tool-option-contracts.js +53 -3
  491. package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
  492. package/dist/sdk/cli-contracts/tool-parameter-tables.js +42 -10
  493. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  494. package/dist/sdk/cli-contracts.d.ts +42 -1
  495. package/dist/sdk/cli-contracts.js +225 -19
  496. package/dist/sdk/cli-contracts.js.map +1 -1
  497. package/dist/sdk/errors.d.ts +22 -0
  498. package/dist/sdk/errors.js +46 -0
  499. package/dist/sdk/errors.js.map +1 -0
  500. package/dist/sdk/index.d.ts +2 -1
  501. package/dist/sdk/index.js +3 -2
  502. package/dist/sdk/index.js.map +1 -1
  503. package/dist/sdk/package-import-adapters.js +14 -3
  504. package/dist/sdk/package-import-adapters.js.map +1 -1
  505. package/dist/sdk/runtime.d.ts +1 -0
  506. package/dist/sdk/runtime.js +3 -2
  507. package/dist/sdk/runtime.js.map +1 -1
  508. package/dist/sdk/testing.d.ts +77 -0
  509. package/dist/sdk/testing.js +239 -0
  510. package/dist/sdk/testing.js.map +1 -0
  511. package/dist/types.d.ts +19 -0
  512. package/dist/types.js +3 -2
  513. package/dist/types.js.map +1 -1
  514. package/docs/AGENT_GUIDE.md +22 -3
  515. package/docs/ARCHITECTURE.md +11 -1
  516. package/docs/CLAUDE_CODE_PLUGIN.md +2 -2
  517. package/docs/COMMANDS.md +118 -7
  518. package/docs/CONFIGURATION.md +57 -2
  519. package/docs/EXTENSIONS.md +125 -6
  520. package/docs/EXTENSION_AUTHOR_CONTRACTS.md +73 -0
  521. package/docs/ONBOARDING.md +165 -0
  522. package/docs/QUICKSTART.md +3 -1
  523. package/docs/README.md +12 -4
  524. package/docs/RELEASING.md +38 -3
  525. package/docs/SDK.md +273 -1
  526. package/docs/TESTING.md +36 -1
  527. package/docs/examples/policy-restricted-extension/manifest.json +1 -0
  528. package/docs/examples/starter-extension/index.js +9 -1
  529. package/docs/examples/starter-extension/manifest.json +1 -0
  530. package/package.json +16 -7
  531. package/packages/pm-beads/extensions/beads/index.js +2 -4
  532. package/packages/pm-beads/extensions/beads/index.ts +43 -33
  533. package/packages/pm-beads/extensions/beads/manifest.json +12 -1
  534. package/packages/pm-calendar/README.md +6 -0
  535. package/packages/pm-calendar/extensions/calendar/index.js +6 -1
  536. package/packages/pm-calendar/extensions/calendar/index.ts +6 -1
  537. package/packages/pm-calendar/extensions/calendar/manifest.json +6 -1
  538. package/packages/pm-governance-audit/extensions/governance-audit/manifest.json +6 -1
  539. package/packages/pm-guide-shell/README.md +4 -0
  540. package/packages/pm-guide-shell/extensions/guide-shell/index.js +22 -0
  541. package/packages/pm-guide-shell/extensions/guide-shell/index.ts +22 -0
  542. package/packages/pm-guide-shell/extensions/guide-shell/manifest.json +6 -1
  543. package/packages/pm-guide-shell/extensions/guide-shell/runtime.js +74 -3
  544. package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +84 -4
  545. package/packages/pm-lifecycle-hooks/README.md +29 -0
  546. package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/index.js +18 -0
  547. package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/index.ts +20 -0
  548. package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/manifest.json +9 -0
  549. package/packages/pm-lifecycle-hooks/package.json +52 -0
  550. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/manifest.json +13 -1
  551. package/packages/pm-search-advanced/extensions/search-advanced/index.js +69 -1
  552. package/packages/pm-search-advanced/extensions/search-advanced/index.ts +91 -2
  553. package/packages/pm-search-advanced/extensions/search-advanced/manifest.json +13 -1
  554. package/packages/pm-templates/extensions/templates/manifest.json +6 -1
  555. package/packages/pm-todos/extensions/todos/index.js +3 -7
  556. package/packages/pm-todos/extensions/todos/index.ts +55 -42
  557. package/packages/pm-todos/extensions/todos/manifest.json +13 -1
  558. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  559. package/plugins/pm-claude/README.md +7 -4
  560. package/plugins/pm-claude/agents/pm-coordinator.md +1 -1
  561. package/plugins/pm-claude/commands/pm-init.md +1 -1
  562. package/scripts/bundle-cli.mjs +121 -17
  563. package/dist/cli-bundle/chunks/activity-OWYSUZOY.js +0 -17
  564. package/dist/cli-bundle/chunks/chunk-3M73P3G6.js.map +0 -7
  565. package/dist/cli-bundle/chunks/chunk-4AEZR5EJ.js +0 -189
  566. package/dist/cli-bundle/chunks/chunk-4AEZR5EJ.js.map +0 -7
  567. package/dist/cli-bundle/chunks/chunk-5HSEP75M.js.map +0 -7
  568. package/dist/cli-bundle/chunks/chunk-6HT2F4TK.js.map +0 -7
  569. package/dist/cli-bundle/chunks/chunk-7Y53ZJIQ.js.map +0 -7
  570. package/dist/cli-bundle/chunks/chunk-BUPWJ3IJ.js.map +0 -7
  571. package/dist/cli-bundle/chunks/chunk-EGUGFSNX.js +0 -47
  572. package/dist/cli-bundle/chunks/chunk-EGUGFSNX.js.map +0 -7
  573. package/dist/cli-bundle/chunks/chunk-FM26RGSU.js +0 -56
  574. package/dist/cli-bundle/chunks/chunk-FM26RGSU.js.map +0 -7
  575. package/dist/cli-bundle/chunks/chunk-FQE6XZDB.js.map +0 -7
  576. package/dist/cli-bundle/chunks/chunk-GN7IJPCD.js.map +0 -7
  577. package/dist/cli-bundle/chunks/chunk-JTWRXG4B.js.map +0 -7
  578. package/dist/cli-bundle/chunks/chunk-JULRTHJQ.js.map +0 -7
  579. package/dist/cli-bundle/chunks/chunk-LRBOHPUE.js.map +0 -7
  580. package/dist/cli-bundle/chunks/chunk-LSXGH6NE.js.map +0 -7
  581. package/dist/cli-bundle/chunks/chunk-MD7K4JYF.js.map +0 -7
  582. package/dist/cli-bundle/chunks/chunk-OGZEG5TT.js.map +0 -7
  583. package/dist/cli-bundle/chunks/chunk-P53TN6IA.js.map +0 -7
  584. package/dist/cli-bundle/chunks/chunk-PXUAZUUY.js.map +0 -7
  585. package/dist/cli-bundle/chunks/chunk-U7FMKRXH.js.map +0 -7
  586. package/dist/cli-bundle/chunks/chunk-VGICHR7D.js +0 -141
  587. package/dist/cli-bundle/chunks/chunk-VGICHR7D.js.map +0 -7
  588. package/dist/cli-bundle/chunks/chunk-WDPXDQFG.js.map +0 -7
  589. package/dist/cli-bundle/chunks/close-XY4CSAYF.js +0 -14
  590. package/dist/cli-bundle/chunks/config-V3FZOKLI.js.map +0 -7
  591. package/dist/cli-bundle/chunks/contracts-YLMH33VU.js.map +0 -7
  592. package/dist/cli-bundle/chunks/create-PZVHRIZQ.js +0 -28
  593. package/dist/cli-bundle/chunks/gc-JWNF66EC.js +0 -181
  594. package/dist/cli-bundle/chunks/gc-JWNF66EC.js.map +0 -7
  595. package/dist/cli-bundle/chunks/get-LTK3HOCQ.js.map +0 -7
  596. package/dist/cli-bundle/chunks/health-TCWL55KM.js.map +0 -7
  597. package/dist/cli-bundle/chunks/history-A2JUDXUE.js +0 -21
  598. package/dist/cli-bundle/chunks/history-redact-ED6RFCPL.js +0 -20
  599. package/dist/cli-bundle/chunks/init-M2WUB4YH.js +0 -16
  600. package/dist/cli-bundle/chunks/list-OGWQPC26.js +0 -20
  601. package/dist/cli-bundle/chunks/register-list-query-UP3VRUFS.js.map +0 -7
  602. package/dist/cli-bundle/chunks/register-mutation-YWSBF545.js.map +0 -7
  603. package/dist/cli-bundle/chunks/register-operations-3BDTGSDH.js.map +0 -7
  604. package/dist/cli-bundle/chunks/restore-MB2ISME7.js +0 -18
  605. package/dist/cli-bundle/chunks/schema-Q622KC46.js +0 -119
  606. package/dist/cli-bundle/chunks/schema-Q622KC46.js.map +0 -7
  607. package/dist/cli-bundle/chunks/search-HENBL456.js.map +0 -7
  608. package/dist/cli-bundle/chunks/stats-N6H3YP2F.js +0 -124
  609. package/dist/cli-bundle/chunks/stats-N6H3YP2F.js.map +0 -7
  610. package/dist/cli-bundle/chunks/test-VNBDRJ4Z.js +0 -32
  611. package/dist/cli-bundle/chunks/update-H6SCWNMA.js +0 -22
  612. package/dist/cli-bundle/chunks/update-many-46HRSP2Q.js.map +0 -7
  613. package/dist/cli-bundle/chunks/validate-TMCVKIGZ.js.map +0 -7
  614. /package/dist/cli-bundle/chunks/{activity-OWYSUZOY.js.map → activity-CVXTCHYY.js.map} +0 -0
  615. /package/dist/cli-bundle/chunks/{aggregate-ADUOSFRO.js.map → aggregate-VNAHUNNF.js.map} +0 -0
  616. /package/dist/cli-bundle/chunks/{chunk-D7AOMPRH.js.map → chunk-BQHUILZS.js.map} +0 -0
  617. /package/dist/cli-bundle/chunks/{chunk-G57E5D7T.js.map → chunk-GU2ZJ2VV.js.map} +0 -0
  618. /package/dist/cli-bundle/chunks/{chunk-AKOOMO3T.js.map → chunk-KAG77BY3.js.map} +0 -0
  619. /package/dist/cli-bundle/chunks/{chunk-KBQY3YG5.js.map → chunk-KJ33AOCY.js.map} +0 -0
  620. /package/dist/cli-bundle/chunks/{chunk-WJ2NAC37.js.map → chunk-N7ACFE26.js.map} +0 -0
  621. /package/dist/cli-bundle/chunks/{chunk-PVNQLCIS.js.map → chunk-QO7EBBOM.js.map} +0 -0
  622. /package/dist/cli-bundle/chunks/{chunk-A7E7PUVX.js.map → chunk-R6UFP2GE.js.map} +0 -0
  623. /package/dist/cli-bundle/chunks/{chunk-CEFIVZPG.js.map → chunk-T3LC5LKB.js.map} +0 -0
  624. /package/dist/cli-bundle/chunks/{chunk-JFWUHHS2.js.map → chunk-UM2GBHS4.js.map} +0 -0
  625. /package/dist/cli-bundle/chunks/{chunk-SEXQN4KL.js.map → chunk-WKY2IBOQ.js.map} +0 -0
  626. /package/dist/cli-bundle/chunks/{chunk-NGN7UV5K.js.map → chunk-XLTD2HN3.js.map} +0 -0
  627. /package/dist/cli-bundle/chunks/{chunk-L2FXEKDB.js.map → chunk-YL2DJGYS.js.map} +0 -0
  628. /package/dist/cli-bundle/chunks/{close-XY4CSAYF.js.map → close-3HDWDA3L.js.map} +0 -0
  629. /package/dist/cli-bundle/chunks/{create-PZVHRIZQ.js.map → create-JTZNCTQC.js.map} +0 -0
  630. /package/dist/cli-bundle/chunks/{extension-B4WL7BQU.js.map → extension-J7IBMFTD.js.map} +0 -0
  631. /package/dist/cli-bundle/chunks/{history-A2JUDXUE.js.map → history-2BA3T5AE.js.map} +0 -0
  632. /package/dist/cli-bundle/chunks/{history-redact-ED6RFCPL.js.map → history-redact-JBZNXHGR.js.map} +0 -0
  633. /package/dist/cli-bundle/chunks/{init-M2WUB4YH.js.map → init-HIVSNX3O.js.map} +0 -0
  634. /package/dist/cli-bundle/chunks/{list-OGWQPC26.js.map → list-MUSQNMTD.js.map} +0 -0
  635. /package/dist/cli-bundle/chunks/{restore-MB2ISME7.js.map → restore-D4RGNX33.js.map} +0 -0
  636. /package/dist/cli-bundle/chunks/{test-VNBDRJ4Z.js.map → test-MXX3E5JL.js.map} +0 -0
  637. /package/dist/cli-bundle/chunks/{test-runs-GX5HTPSF.js.map → test-runs-WMVTQU3Y.js.map} +0 -0
  638. /package/dist/cli-bundle/chunks/{update-H6SCWNMA.js.map → update-YRXSUGYQ.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"history.js","sources":["cli/commands/history.ts"],"sourceRoot":"/","sourcesContent":["import { pathExists, readFileIfExists } from \"../../core/fs/fs-utils.js\";\nimport { hashDocument, hashEmptyDocument } from \"../../core/history/history.js\";\nimport { verifyHistoryChain } from \"../../core/history/replay.js\";\nimport { enforceHistoryStreamPolicyForItem } from \"../../core/history/history-stream-policy.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { findFirstMergeConflictMarker } from \"../../core/shared/conflict-markers.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { getActiveExtensionRegistrations, runActiveOnReadHooks } from \"../../core/extensions/index.js\";\nimport { normalizeItemId } from \"../../core/item/id.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { locateItem, readLocatedItem } from \"../../core/store/item-store.js\";\nimport { getHistoryPath, getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport { parseLimit } from \"../shared-parsers.js\";\nimport type { HistoryEntry } from \"../../types/index.js\";\n\nexport { verifyHistoryChain } from \"../../core/history/replay.js\";\n\nexport interface HistoryCommandOptions {\n limit?: string;\n diff?: boolean;\n verify?: boolean;\n compact?: boolean;\n}\n\nexport interface HistoryDiffEntry {\n index: number;\n ts: string;\n op: string;\n author: string;\n patch_ops: number;\n changed_fields: string[];\n}\n\nexport interface HistoryVerificationResult {\n ok: boolean;\n entries: number;\n errors: string[];\n latest_after_hash?: string;\n current_item_hash?: string;\n current_matches_latest?: boolean;\n}\n\nexport interface HistoryResult {\n id: string;\n history: HistoryEntry[];\n compact_history?: HistoryDiffEntry[];\n compact: boolean;\n count: number;\n limit: number | null;\n diff?: HistoryDiffEntry[];\n verification?: HistoryVerificationResult;\n}\n\nfunction limitEntries<T>(values: T[], limit: number | undefined): T[] {\n if (limit === undefined) return values;\n return values.slice(Math.max(0, values.length - limit));\n}\n\nfunction decodeJsonPointerSegment(segment: string): string {\n return segment.replaceAll(\"~1\", \"/\").replaceAll(\"~0\", \"~\");\n}\n\nfunction patchPathToChangedField(path: string): string {\n if (path === \"/body\" || path.startsWith(\"/body/\")) {\n return \"body\";\n }\n if (\n path === \"/metadata\" ||\n path.startsWith(\"/metadata/\") ||\n path === \"/front_matter\" ||\n path.startsWith(\"/front_matter/\")\n ) {\n const segment = path.replace(/^\\/(?:metadata|front_matter)\\/?/, \"\").split(\"/\")[0];\n if (!segment) {\n return \"metadata\";\n }\n return decodeJsonPointerSegment(segment);\n }\n const segment = path.replace(/^\\//, \"\").split(\"/\")[0];\n return segment ? decodeJsonPointerSegment(segment) : \"root\";\n}\n\nfunction buildDiffEntries(entries: HistoryEntry[], startIndex: number): HistoryDiffEntry[] {\n return entries.map((entry, index) => {\n const changedFields = new Set<string>();\n for (const op of entry.patch) {\n changedFields.add(patchPathToChangedField(op.path));\n if (op.from) {\n changedFields.add(patchPathToChangedField(op.from));\n }\n }\n return {\n index: startIndex + index + 1,\n ts: entry.ts,\n op: entry.op,\n author: entry.author,\n patch_ops: entry.patch.length,\n changed_fields: [...changedFields].sort((left, right) => left.localeCompare(right)),\n };\n });\n}\n\nexport async function readHistoryEntries(historyPath: string, itemId: string): Promise<HistoryEntry[]> {\n const raw = await readFileIfExists(historyPath);\n if (raw === null) {\n return [];\n }\n await runActiveOnReadHooks({\n path: historyPath,\n scope: \"project\",\n });\n if (raw.trim() === \"\") {\n return [];\n }\n const conflictMarker = findFirstMergeConflictMarker(raw);\n if (conflictMarker) {\n throw new PmCliError(\n `History for ${itemId} contains merge conflict markers at line ${conflictMarker.line} (${conflictMarker.marker}). Resolve <<<<<<< ======= >>>>>>> markers and retry.`,\n EXIT_CODE.GENERIC_FAILURE,\n {\n code: \"history_merge_conflict_markers_detected\",\n required: \"Repair the history stream by resolving merge-conflict markers.\",\n why: \"Conflict markers break JSONL parsing and invalidate deterministic audit history.\",\n examples: [`pm history ${itemId}`, `pm restore ${itemId} <timestamp-or-version>`],\n nextSteps: [\"Resolve or restore the history file, then rerun the command.\"],\n },\n );\n }\n\n const entries: HistoryEntry[] = [];\n const lines = raw.split(/\\r?\\n/);\n for (let index = 0; index < lines.length; index += 1) {\n const line = lines[index]?.trim();\n if (!line) continue;\n try {\n entries.push(JSON.parse(line) as HistoryEntry);\n } catch {\n throw new PmCliError(\n `History for ${itemId} contains invalid JSON at line ${index + 1}. Repair or restore the history stream and retry.`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n }\n return entries;\n}\n\nexport async function runHistory(id: string, options: HistoryCommandOptions, global: GlobalOptions): Promise<HistoryResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n\n const limit = parseLimit(options.limit);\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const normalizedId = normalizeItemId(id, settings.id_prefix);\n const located = await locateItem(\n pmRoot,\n normalizedId,\n settings.id_prefix,\n settings.item_format,\n typeRegistry.type_to_folder,\n );\n const resolvedId = located?.id ?? normalizedId;\n const historyPath = getHistoryPath(pmRoot, resolvedId);\n if (!located && !(await pathExists(historyPath))) {\n throw new PmCliError(`Item ${id} not found`, EXIT_CODE.NOT_FOUND);\n }\n if (located) {\n await enforceHistoryStreamPolicyForItem({\n pmRoot,\n settings,\n itemId: located.id,\n commandLabel: \"history\",\n });\n }\n\n const fullHistory = await readHistoryEntries(historyPath, resolvedId);\n const history = limitEntries(fullHistory, limit);\n const compact = options.compact === true;\n const compactHistory = compact ? buildDiffEntries(history, Math.max(0, fullHistory.length - history.length)) : undefined;\n const result: HistoryResult = {\n id: resolvedId,\n history: compact ? [] : history,\n compact_history: compactHistory,\n compact,\n count: history.length,\n limit: limit ?? null,\n };\n\n if (options.diff) {\n result.diff = compact ? [] : buildDiffEntries(history, Math.max(0, fullHistory.length - history.length));\n }\n\n if (options.verify) {\n const verification = verifyHistoryChain(fullHistory);\n const latestAfterHash = fullHistory.length > 0 ? fullHistory[fullHistory.length - 1].after_hash : hashEmptyDocument();\n let currentItemHash: string | undefined;\n let currentMatchesLatest: boolean | undefined;\n const errors = [...verification.errors];\n\n if (located) {\n const loaded = await readLocatedItem(located, { schema: settings.schema });\n currentItemHash = hashDocument(loaded.document);\n currentMatchesLatest = currentItemHash === latestAfterHash;\n if (!currentMatchesLatest) {\n errors.push(\"verify_failed:current_item_hash_mismatch\");\n }\n }\n\n result.verification = {\n ok: errors.length === 0,\n entries: fullHistory.length,\n errors,\n latest_after_hash: fullHistory.length > 0 ? fullHistory[fullHistory.length - 1].after_hash : undefined,\n current_item_hash: currentItemHash,\n current_matches_latest: currentMatchesLatest,\n };\n }\n\n return result;\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,iCAAiC,EAAE,MAAM,6CAA6C,CAAC;AAChG,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AAErF,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OA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AAC;QACnB,MAAM,YAAY,GAAG,kBAAkB,CAAC,WAAW,CAAC,CAAC;QACrD,MAAM,eAAe,GAAG,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;QACtH,IAAI,eAAmC,CAAC;QACxC,IAAI,oBAAyC,CAAC;QAC9C,MAAM,MAAM,GAAG,CAAC,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;QAExC,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;YAC3E,eAAe,GAAG,YAAY,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAChD,oBAAoB,GAAG,eAAe,KAAK,eAAe,CAAC;YAC3D,IAAI,CAAC,oBAAoB,EAAE,CAAC;gBAC1B,MAAM,CAAC,IAAI,CAAC,0CAA0C,CAAC,CAAC;YAC1D,CAAC;QACH,CAAC;QAED,MAAM,CAAC,YAAY,GAAG;YACpB,EAAE,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC;YACvB,OAAO,EAAE,WAAW,CAAC,MAAM;YAC3B,MAAM;YACN,iBAAiB,EAAE,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS;YACtG,iBAAiB,EAAE,eAAe;YAClC,sBAAsB,EAAE,oBAAoB;SAC7C,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC","debugId":"7dab57b7-674a-5649-ac20-6307a59ce87d"}
1
+ {"version":3,"file":"history.js","sources":["cli/commands/history.ts"],"sourceRoot":"/","sourcesContent":["import { pathExists, readFileIfExists } from \"../../core/fs/fs-utils.js\";\nimport { computeHistoryDiff, patchPathToChangedField, type HistoryDiffValueEntry } from \"../../core/history/history-diff.js\";\nimport { hashDocument, hashEmptyDocument } from \"../../core/history/history.js\";\nimport { verifyHistoryChain } from \"../../core/history/replay.js\";\nimport { enforceHistoryStreamPolicyForItem } from \"../../core/history/history-stream-policy.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { findFirstMergeConflictMarker } from \"../../core/shared/conflict-markers.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { getActiveExtensionRegistrations, runActiveOnReadHooks } from \"../../core/extensions/index.js\";\nimport { normalizeItemId } from \"../../core/item/id.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { locateItem, readLocatedItem } from \"../../core/store/item-store.js\";\nimport { getHistoryPath, getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport { parseLimit } from \"../shared-parsers.js\";\nimport type { HistoryEntry } from \"../../types/index.js\";\n\nexport { verifyHistoryChain } from \"../../core/history/replay.js\";\n\nexport interface HistoryCommandOptions {\n limit?: string;\n diff?: boolean;\n /** Restrict --diff to a single field's before/after transitions (implies --diff). */\n field?: string;\n verify?: boolean;\n compact?: boolean;\n}\n\nexport interface HistoryDiffEntry {\n index: number;\n ts: string;\n op: string;\n author: string;\n patch_ops: number;\n changed_fields: string[];\n}\n\nexport interface HistoryVerificationResult {\n ok: boolean;\n entries: number;\n errors: string[];\n latest_after_hash?: string;\n current_item_hash?: string;\n current_matches_latest?: boolean;\n}\n\nexport interface HistoryResult {\n id: string;\n history: HistoryEntry[];\n compact_history?: HistoryDiffEntry[];\n compact: boolean;\n count: number;\n limit: number | null;\n diff?: HistoryDiffValueEntry[];\n verification?: HistoryVerificationResult;\n}\n\nfunction limitEntries<T>(values: T[], limit: number | undefined): T[] {\n if (limit === undefined) return values;\n return values.slice(Math.max(0, values.length - limit));\n}\n\nfunction buildDiffEntries(entries: HistoryEntry[], startIndex: number): HistoryDiffEntry[] {\n return entries.map((entry, index) => {\n const changedFields = new Set<string>();\n for (const op of entry.patch) {\n changedFields.add(patchPathToChangedField(op.path));\n if (op.from) {\n changedFields.add(patchPathToChangedField(op.from));\n }\n }\n return {\n index: startIndex + index + 1,\n ts: entry.ts,\n op: entry.op,\n author: entry.author,\n patch_ops: entry.patch.length,\n changed_fields: [...changedFields].sort((left, right) => left.localeCompare(right)),\n };\n });\n}\n\nexport async function readHistoryEntries(historyPath: string, itemId: string): Promise<HistoryEntry[]> {\n const raw = await readFileIfExists(historyPath);\n if (raw === null) {\n return [];\n }\n await runActiveOnReadHooks({\n path: historyPath,\n scope: \"project\",\n });\n if (raw.trim() === \"\") {\n return [];\n }\n const conflictMarker = findFirstMergeConflictMarker(raw);\n if (conflictMarker) {\n throw new PmCliError(\n `History for ${itemId} contains merge conflict markers at line ${conflictMarker.line} (${conflictMarker.marker}). Resolve <<<<<<< ======= >>>>>>> markers and retry.`,\n EXIT_CODE.GENERIC_FAILURE,\n {\n code: \"history_merge_conflict_markers_detected\",\n required: \"Repair the history stream by resolving merge-conflict markers.\",\n why: \"Conflict markers break JSONL parsing and invalidate deterministic audit history.\",\n examples: [`pm history ${itemId}`, `pm restore ${itemId} <timestamp-or-version>`],\n nextSteps: [\"Resolve or restore the history file, then rerun the command.\"],\n },\n );\n }\n\n const entries: HistoryEntry[] = [];\n const lines = raw.split(/\\r?\\n/);\n for (let index = 0; index < lines.length; index += 1) {\n const line = lines[index]?.trim();\n if (!line) continue;\n try {\n entries.push(JSON.parse(line) as HistoryEntry);\n } catch {\n throw new PmCliError(\n `History for ${itemId} contains invalid JSON at line ${index + 1}. Repair or restore the history stream and retry.`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n }\n return entries;\n}\n\nexport async function runHistory(id: string, options: HistoryCommandOptions, global: GlobalOptions): Promise<HistoryResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n\n const limit = parseLimit(options.limit);\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const normalizedId = normalizeItemId(id, settings.id_prefix);\n const located = await locateItem(\n pmRoot,\n normalizedId,\n settings.id_prefix,\n settings.item_format,\n typeRegistry.type_to_folder,\n );\n const resolvedId = located?.id ?? normalizedId;\n const historyPath = getHistoryPath(pmRoot, resolvedId);\n if (!located && !(await pathExists(historyPath))) {\n throw new PmCliError(`Item ${id} not found`, EXIT_CODE.NOT_FOUND);\n }\n if (located) {\n await enforceHistoryStreamPolicyForItem({\n pmRoot,\n settings,\n itemId: located.id,\n commandLabel: \"history\",\n });\n }\n\n const fullHistory = await readHistoryEntries(historyPath, resolvedId);\n const history = limitEntries(fullHistory, limit);\n const compact = options.compact === true;\n const compactHistory = compact ? buildDiffEntries(history, Math.max(0, fullHistory.length - history.length)) : undefined;\n const result: HistoryResult = {\n id: resolvedId,\n history: compact ? [] : history,\n compact_history: compactHistory,\n compact,\n count: history.length,\n limit: limit ?? null,\n };\n\n if (options.diff || options.field !== undefined) {\n // --diff replays the full chain to surface per-field before/after values for\n // the displayed window (the latest --limit entries). --field narrows to a\n // single field's transitions (\"when did status change?\"). Unlike the compact\n // projection above, the value diff is independent of the compact/full toggle.\n result.diff = computeHistoryDiff(fullHistory, {\n windowStartIndex: Math.max(0, fullHistory.length - history.length),\n field: options.field,\n });\n }\n\n if (options.verify) {\n const verification = verifyHistoryChain(fullHistory);\n const latestAfterHash = fullHistory.length > 0 ? fullHistory[fullHistory.length - 1].after_hash : hashEmptyDocument();\n let currentItemHash: string | undefined;\n let currentMatchesLatest: boolean | undefined;\n const errors = [...verification.errors];\n\n if (located) {\n const loaded = await readLocatedItem(located, { schema: settings.schema });\n currentItemHash = hashDocument(loaded.document);\n currentMatchesLatest = currentItemHash === latestAfterHash;\n if (!currentMatchesLatest) {\n errors.push(\"verify_failed:current_item_hash_mismatch\");\n }\n }\n\n result.verification = {\n ok: errors.length === 0,\n entries: fullHistory.length,\n errors,\n latest_after_hash: fullHistory.length > 0 ? fullHistory[fullHistory.length - 1].after_hash : undefined,\n current_item_hash: currentItemHash,\n current_matches_latest: currentMatchesLatest,\n };\n }\n\n return result;\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAA8B,MAAM,oCAAoC,CAAC;AAC7H,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,iCAAiC,EAAE,MAAM,6CAA6C,CAAC;AAChG,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AAErF,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,+BAA+B,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACvG,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGlD,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CA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AC;QACrD,MAAM,eAAe,GAAG,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;QACtH,IAAI,eAAmC,CAAC;QACxC,IAAI,oBAAyC,CAAC;QAC9C,MAAM,MAAM,GAAG,CAAC,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;QAExC,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;YAC3E,eAAe,GAAG,YAAY,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAChD,oBAAoB,GAAG,eAAe,KAAK,eAAe,CAAC;YAC3D,IAAI,CAAC,oBAAoB,EAAE,CAAC;gBAC1B,MAAM,CAAC,IAAI,CAAC,0CAA0C,CAAC,CAAC;YAC1D,CAAC;QACH,CAAC;QAED,MAAM,CAAC,YAAY,GAAG;YACpB,EAAE,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC;YACvB,OAAO,EAAE,WAAW,CAAC,MAAM;YAC3B,MAAM;YACN,iBAAiB,EAAE,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS;YACtG,iBAAiB,EAAE,eAAe;YAClC,sBAAsB,EAAE,oBAAoB;SAC7C,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC","debugId":"50bc01ba-8e6c-54aa-a0f7-81540f1eaddc"}
@@ -3,6 +3,7 @@ export { runAggregate, type AggregateOptions, type AggregateResult } from "./agg
3
3
  export { runActivity } from "./activity.js";
4
4
  export { runClaim, runRelease } from "./claim.js";
5
5
  export { runClose, type CloseCommandOptions, type CloseResult } from "./close.js";
6
+ export { runCloseMany, type CloseManyCommandOptions, type CloseManyResult } from "./close-many.js";
6
7
  export { runComments } from "./comments.js";
7
8
  export { runConfig, type ConfigCommandOptions, type ConfigResult } from "./config.js";
8
9
  export { runContracts, type ContractsCommandOptions, type ContractsResult } from "./contracts.js";
@@ -24,10 +25,11 @@ export { runLearnings } from "./learnings.js";
24
25
  export { runList, type ListOptions } from "./list.js";
25
26
  export { runNotes } from "./notes.js";
26
27
  export { runPlan, PLAN_SUBCOMMANDS, PLAN_SHOW_DEPTH_VALUES, type PlanCommandOptions, type PlanCommandResult, type PlanDispatchInput, type PlanResultPlan, type PlanStepSummary, type PlanShowDepth, type PlanSubcommand, } from "./plan.js";
27
- export { runSchemaAddType, formatSchemaAddTypeHuman, SCHEMA_SUBCOMMANDS, type SchemaSubcommand, type SchemaAddTypeCommandOptions, type SchemaAddTypeResult, } from "./schema.js";
28
+ export { runSchemaAddType, runSchemaRemoveType, runSchemaAddStatus, runSchemaRemoveStatus, runSchemaList, runSchemaShow, formatSchemaAddTypeHuman, formatSchemaRemoveTypeHuman, formatSchemaAddStatusHuman, formatSchemaRemoveStatusHuman, formatSchemaListHuman, formatSchemaShowHuman, SCHEMA_SUBCOMMANDS, type SchemaSubcommand, type SchemaAddTypeCommandOptions, type SchemaAddTypeResult, type SchemaRemoveTypeCommandOptions, type SchemaRemoveTypeResult, type SchemaAddStatusCommandOptions, type SchemaAddStatusResult, type SchemaRemoveStatusCommandOptions, type SchemaRemoveStatusResult, type SchemaListResult, type SchemaShowResult, } from "./schema.js";
28
29
  export { runSearch } from "./search.js";
29
30
  export { runRestore } from "./restore.js";
30
31
  export { runStats } from "./stats.js";
32
+ export { runTelemetry, TELEMETRY_SUBCOMMANDS, type TelemetryCommandOptions, type TelemetrySubcommand } from "./telemetry.js";
31
33
  export { runTest } from "./test.js";
32
34
  export { runTestAll } from "./test-all.js";
33
35
  export { runStartBackgroundRun, runTestRunsList, runTestRunsLogs, runTestRunsResume, runTestRunsStatus, runTestRunsStop, runTestRunsWorker, } from "./test-runs.js";
@@ -1,10 +1,11 @@
1
1
 
2
- !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]="976d2cdf-7f8e-5cd9-9146-7fdb15fa1512")}catch(e){}}();
2
+ !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]="15b13b88-d275-530e-b31b-fcdeb9e38579")}catch(e){}}();
3
3
  export { runAppend } from "./append.js";
4
4
  export { runAggregate } from "./aggregate.js";
5
5
  export { runActivity } from "./activity.js";
6
6
  export { runClaim, runRelease } from "./claim.js";
7
7
  export { runClose } from "./close.js";
8
+ export { runCloseMany } from "./close-many.js";
8
9
  export { runComments } from "./comments.js";
9
10
  export { runConfig } from "./config.js";
10
11
  export { runContracts } from "./contracts.js";
@@ -26,10 +27,11 @@ export { runLearnings } from "./learnings.js";
26
27
  export { runList } from "./list.js";
27
28
  export { runNotes } from "./notes.js";
28
29
  export { runPlan, PLAN_SUBCOMMANDS, PLAN_SHOW_DEPTH_VALUES, } from "./plan.js";
29
- export { runSchemaAddType, formatSchemaAddTypeHuman, SCHEMA_SUBCOMMANDS, } from "./schema.js";
30
+ export { runSchemaAddType, runSchemaRemoveType, runSchemaAddStatus, runSchemaRemoveStatus, runSchemaList, runSchemaShow, formatSchemaAddTypeHuman, formatSchemaRemoveTypeHuman, formatSchemaAddStatusHuman, formatSchemaRemoveStatusHuman, formatSchemaListHuman, formatSchemaShowHuman, SCHEMA_SUBCOMMANDS, } from "./schema.js";
30
31
  export { runSearch } from "./search.js";
31
32
  export { runRestore } from "./restore.js";
32
33
  export { runStats } from "./stats.js";
34
+ export { runTelemetry, TELEMETRY_SUBCOMMANDS } from "./telemetry.js";
33
35
  export { runTest } from "./test.js";
34
36
  export { runTestAll } from "./test-all.js";
35
37
  export { runStartBackgroundRun, runTestRunsList, runTestRunsLogs, runTestRunsResume, runTestRunsStatus, runTestRunsStop, runTestRunsWorker, } from "./test-runs.js";
@@ -38,4 +40,4 @@ export { runUpdateMany } from "./update-many.js";
38
40
  export { runUpgrade } from "./upgrade.js";
39
41
  export { runValidate } from "./validate.js";
40
42
  //# sourceMappingURL=index.js.map
41
- //# debugId=976d2cdf-7f8e-5cd9-9146-7fdb15fa1512
43
+ //# debugId=15b13b88-d275-530e-b31b-fcdeb9e38579
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["cli/commands/index.ts"],"sourceRoot":"/","sourcesContent":["export { runAppend } from \"./append.js\";\nexport { runAggregate, type AggregateOptions, type AggregateResult } from \"./aggregate.js\";\nexport { runActivity } from \"./activity.js\";\nexport { runClaim, runRelease } from \"./claim.js\";\nexport { runClose, type CloseCommandOptions, type CloseResult } from \"./close.js\";\nexport { runComments } from \"./comments.js\";\nexport { runConfig, type ConfigCommandOptions, type ConfigResult } from \"./config.js\";\nexport { runContracts, type ContractsCommandOptions, type ContractsResult } from \"./contracts.js\";\nexport {\n CONTEXT_OUTPUT_VALUES,\n renderContextMarkdown,\n resolveContextOutputFormat,\n runContext,\n type ContextOptions,\n type ContextOutputFormat,\n type ContextResult,\n} from \"./context.js\";\nexport { runCreate, type CreateCommandOptions } from \"./create.js\";\nexport { runDelete, type DeleteCommandOptions, type DeleteResult } from \"./delete.js\";\nexport { runDeps, DEPS_FORMAT_VALUES, type DepsCommandOptions, type DepsFormat, type DepsResult } from \"./deps.js\";\nexport { runDocs } from \"./docs.js\";\nexport { runExtension, type ExtensionCommandOptions, type ExtensionCommandResult } from \"./extension.js\";\nexport { runFiles, runFilesDiscover } from \"./files.js\";\nexport { runGc } from \"./gc.js\";\nexport { runGet } from \"./get.js\";\nexport { runHealth } from \"./health.js\";\nexport { runHistory } from \"./history.js\";\nexport { runHistoryRedact, type HistoryRedactCommandOptions, type HistoryRedactResult } from \"./history-redact.js\";\nexport { runHistoryRepair, type HistoryRepairCommandOptions, type HistoryRepairResult } from \"./history-repair.js\";\nexport { runInit, summarizeInitResult, type InitConciseResult } from \"./init.js\";\nexport { runLearnings } from \"./learnings.js\";\nexport { runList, type ListOptions } from \"./list.js\";\nexport { runNotes } from \"./notes.js\";\nexport {\n runPlan,\n PLAN_SUBCOMMANDS,\n PLAN_SHOW_DEPTH_VALUES,\n type PlanCommandOptions,\n type PlanCommandResult,\n type PlanDispatchInput,\n type PlanResultPlan,\n type PlanStepSummary,\n type PlanShowDepth,\n type PlanSubcommand,\n} from \"./plan.js\";\nexport {\n runSchemaAddType,\n formatSchemaAddTypeHuman,\n SCHEMA_SUBCOMMANDS,\n type SchemaSubcommand,\n type SchemaAddTypeCommandOptions,\n type SchemaAddTypeResult,\n} from \"./schema.js\";\nexport { runSearch } from \"./search.js\";\nexport { runRestore } from \"./restore.js\";\nexport { runStats } from \"./stats.js\";\nexport { runTest } from \"./test.js\";\nexport { runTestAll } from \"./test-all.js\";\nexport {\n runStartBackgroundRun,\n runTestRunsList,\n runTestRunsLogs,\n runTestRunsResume,\n runTestRunsStatus,\n runTestRunsStop,\n runTestRunsWorker,\n} from \"./test-runs.js\";\nexport { runUpdate } from \"./update.js\";\nexport { runUpdateMany, type UpdateManyCommandOptions, type UpdateManyResult } from \"./update-many.js\";\nexport { runUpgrade, type UpgradeCommandOptions, type UpgradeResult } from \"./upgrade.js\";\nexport { runValidate, type ValidateCheck, type ValidateCommandOptions, type ValidateResult } from \"./validate.js\";\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAA+C,MAAM,gBAAgB,CAAC;AAC3F,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,QAAQ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AM,WAAW,CAAC;AACnB,OAAO,EACL,gBAAgB,EAChB,wBAAwB,EACxB,kBAAkB,GAInB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,aAAa,EAAwD,MAAM,kBAAkB,CAAC;AACvG,OAAO,EAAE,UAAU,EAAkD,MAAM,cAAc,CAAC;AAC1F,OAAO,EAAE,WAAW,EAAwE,MAAM,eAAe,CAAC","debugId":"976d2cdf-7f8e-5cd9-9146-7fdb15fa1512"}
1
+ {"version":3,"file":"index.js","sources":["cli/commands/index.ts"],"sourceRoot":"/","sourcesContent":["export { runAppend } from \"./append.js\";\nexport { runAggregate, type AggregateOptions, type AggregateResult } from \"./aggregate.js\";\nexport { runActivity } from \"./activity.js\";\nexport { runClaim, runRelease } from \"./claim.js\";\nexport { runClose, type CloseCommandOptions, type CloseResult } from \"./close.js\";\nexport { runCloseMany, type CloseManyCommandOptions, type CloseManyResult } from \"./close-many.js\";\nexport { runComments } from \"./comments.js\";\nexport { runConfig, type ConfigCommandOptions, type ConfigResult } from \"./config.js\";\nexport { runContracts, type ContractsCommandOptions, type ContractsResult } from \"./contracts.js\";\nexport {\n CONTEXT_OUTPUT_VALUES,\n renderContextMarkdown,\n resolveContextOutputFormat,\n runContext,\n type ContextOptions,\n type ContextOutputFormat,\n type ContextResult,\n} from \"./context.js\";\nexport { runCreate, type CreateCommandOptions } from \"./create.js\";\nexport { runDelete, type DeleteCommandOptions, type DeleteResult } from \"./delete.js\";\nexport { runDeps, DEPS_FORMAT_VALUES, type DepsCommandOptions, type DepsFormat, type DepsResult } from \"./deps.js\";\nexport { runDocs } from \"./docs.js\";\nexport { runExtension, type ExtensionCommandOptions, type ExtensionCommandResult } from \"./extension.js\";\nexport { runFiles, runFilesDiscover } from \"./files.js\";\nexport { runGc } from \"./gc.js\";\nexport { runGet } from \"./get.js\";\nexport { runHealth } from \"./health.js\";\nexport { runHistory } from \"./history.js\";\nexport { runHistoryRedact, type HistoryRedactCommandOptions, type HistoryRedactResult } from \"./history-redact.js\";\nexport { runHistoryRepair, type HistoryRepairCommandOptions, type HistoryRepairResult } from \"./history-repair.js\";\nexport { runInit, summarizeInitResult, type InitConciseResult } from \"./init.js\";\nexport { runLearnings } from \"./learnings.js\";\nexport { runList, type ListOptions } from \"./list.js\";\nexport { runNotes } from \"./notes.js\";\nexport {\n runPlan,\n PLAN_SUBCOMMANDS,\n PLAN_SHOW_DEPTH_VALUES,\n type PlanCommandOptions,\n type PlanCommandResult,\n type PlanDispatchInput,\n type PlanResultPlan,\n type PlanStepSummary,\n type PlanShowDepth,\n type PlanSubcommand,\n} from \"./plan.js\";\nexport {\n runSchemaAddType,\n runSchemaRemoveType,\n runSchemaAddStatus,\n runSchemaRemoveStatus,\n runSchemaList,\n runSchemaShow,\n formatSchemaAddTypeHuman,\n formatSchemaRemoveTypeHuman,\n formatSchemaAddStatusHuman,\n formatSchemaRemoveStatusHuman,\n formatSchemaListHuman,\n formatSchemaShowHuman,\n SCHEMA_SUBCOMMANDS,\n type SchemaSubcommand,\n type SchemaAddTypeCommandOptions,\n type SchemaAddTypeResult,\n type SchemaRemoveTypeCommandOptions,\n type SchemaRemoveTypeResult,\n type SchemaAddStatusCommandOptions,\n type SchemaAddStatusResult,\n type SchemaRemoveStatusCommandOptions,\n type SchemaRemoveStatusResult,\n type SchemaListResult,\n type SchemaShowResult,\n} from \"./schema.js\";\nexport { runSearch } from \"./search.js\";\nexport { runRestore } from \"./restore.js\";\nexport { runStats } from \"./stats.js\";\nexport { runTelemetry, TELEMETRY_SUBCOMMANDS, type TelemetryCommandOptions, type TelemetrySubcommand } from \"./telemetry.js\";\nexport { runTest } from \"./test.js\";\nexport { runTestAll } from \"./test-all.js\";\nexport {\n runStartBackgroundRun,\n runTestRunsList,\n runTestRunsLogs,\n runTestRunsResume,\n runTestRunsStatus,\n runTestRunsStop,\n runTestRunsWorker,\n} from \"./test-runs.js\";\nexport { runUpdate } from \"./update.js\";\nexport { runUpdateMany, type UpdateManyCommandOptions, type UpdateManyResult } from \"./update-many.js\";\nexport { runUpgrade, type UpgradeCommandOptions, type UpgradeResult } from \"./upgrade.js\";\nexport { runValidate, type ValidateCheck, type ValidateCommandOptions, type ValidateResult } from \"./validate.js\";\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAA+C,MAAM,gBAAgB,CAAC;AAC3F,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,QAAQ,EAA8C,MAAM,YAAY,CAAC;AAClF,OAAO,EAAE,YAAY,EAAsD,MAAM,iBAAiB,CAAC;AACnG,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAgD,MAAM,aAAa,CAAC;AACtF,OAAO,EAAE,YAAY,EAAsD,MAAM,gBAAgB,CAAC;AAClG,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,0BAA0B,EAC1B,UAAU,GAIX,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,SAAS,EAA6B,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,SAAS,EAAgD,MAAM,aAAa,CAAC;AACtF,OAAO,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B,CAAC;AAC7H,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,aAAa,EAAwD,MAAM,kBAAkB,CAAC;AACvG,OAAO,EAAE,UAAU,EAAkD,MAAM,cAAc,CAAC;AAC1F,OAAO,EAAE,WAAW,EAAwE,MAAM,eAAe,CAAC","debugId":"15b13b88-d275-530e-b31b-fcdeb9e38579"}
@@ -9,6 +9,13 @@ export interface InitInstalledPackagesSummary {
9
9
  ok: boolean;
10
10
  }>;
11
11
  }
12
+ export type InitTypePresetName = "agile" | "ops" | "research";
13
+ export interface InitRegisteredTypePresetSummary {
14
+ name: InitTypePresetName;
15
+ registered: string[];
16
+ updated: string[];
17
+ file: string;
18
+ }
12
19
  export interface InitResult {
13
20
  ok: boolean;
14
21
  path: string;
@@ -17,6 +24,7 @@ export interface InitResult {
17
24
  warnings: string[];
18
25
  governance_preset: GovernancePreset;
19
26
  wizard_used: boolean;
27
+ registered_type_preset?: InitRegisteredTypePresetSummary;
20
28
  installed_packages?: InitInstalledPackagesSummary;
21
29
  next_steps: string[];
22
30
  agent_guidance: InitAgentGuidanceSummary;
@@ -27,6 +35,7 @@ export interface InitCommandOptions {
27
35
  author?: string;
28
36
  withPackages?: boolean;
29
37
  agentGuidance?: string;
38
+ typePreset?: string;
30
39
  }
31
40
  /**
32
41
  * Concise projection of an InitResult for the default (toon) renderer. It keeps
@@ -50,6 +59,7 @@ export interface InitConciseResult {
50
59
  created_dirs: string[];
51
60
  warnings: string[];
52
61
  wizard_used: boolean;
62
+ registered_type_preset?: InitRegisteredTypePresetSummary;
53
63
  installed_packages?: InitInstalledPackagesSummary;
54
64
  next_steps: string[];
55
65
  agent_guidance: InitAgentGuidanceSummary;
@@ -1,14 +1,15 @@
1
1
 
2
- !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]="e4370e86-cea8-5bf3-837b-de4b3c51daa1")}catch(e){}}();
2
+ !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]="9395c248-0605-5d4c-bc9a-ce5b433a4fb0")}catch(e){}}();
3
3
  import fs from "node:fs/promises";
4
4
  import path from "node:path";
5
5
  import readline from "node:readline/promises";
6
6
  import { stdin as input, stdout as output } from "node:process";
7
7
  import { getActiveExtensionRegistrations, runActiveOnWriteHooks } from "../../core/extensions/index.js";
8
- import { pathExists } from "../../core/fs/fs-utils.js";
8
+ import { pathExists, readFileIfExists, writeFileAtomic } from "../../core/fs/fs-utils.js";
9
9
  import { normalizePrefix } from "../../core/item/id.js";
10
10
  import { resolveItemTypeRegistry } from "../../core/item/type-registry.js";
11
- import { ensureRuntimeSchemaFileScaffold } from "../../core/schema/runtime-schema.js";
11
+ import { DEFAULT_RUNTIME_SCHEMA_FILE_PATHS, ensureRuntimeSchemaFileScaffold, filePathForSchemaSection, normalizeRuntimeSchemaSettings, } from "../../core/schema/runtime-schema.js";
12
+ import { normalizeAddTypeInput, parseItemTypesFile, serializeItemTypesFile, upsertItemType, } from "../../core/schema/item-types-file.js";
12
13
  import { EXIT_CODE, GOVERNANCE_PRESET_DEFAULTS, PM_REQUIRED_SUBDIRS, SETTINGS_DEFAULTS } from "../../core/shared/constants.js";
13
14
  import { PmCliError } from "../../core/shared/errors.js";
14
15
  import { resolvePmRoot } from "../../core/store/paths.js";
@@ -30,6 +31,7 @@ export function summarizeInitResult(result) {
30
31
  created_dirs: result.created_dirs,
31
32
  warnings: result.warnings,
32
33
  wizard_used: result.wizard_used,
34
+ ...(result.registered_type_preset ? { registered_type_preset: result.registered_type_preset } : {}),
33
35
  ...(result.installed_packages ? { installed_packages: result.installed_packages } : {}),
34
36
  next_steps: result.next_steps,
35
37
  agent_guidance: result.agent_guidance,
@@ -40,6 +42,57 @@ function cloneDefaults() {
40
42
  return structuredClone(SETTINGS_DEFAULTS);
41
43
  }
42
44
  const BUILTIN_GOVERNANCE_PRESETS = ["minimal", "default", "strict"];
45
+ const INIT_TYPE_PRESET_NAMES = ["agile", "ops", "research"];
46
+ const INIT_TYPE_PRESET_DEFINITIONS = {
47
+ agile: [
48
+ {
49
+ name: "Story",
50
+ description: "User-facing outcome or capability slice expressed from a stakeholder perspective.",
51
+ defaultStatus: "open",
52
+ folder: "stories",
53
+ aliases: ["user-story"],
54
+ },
55
+ {
56
+ name: "Spike",
57
+ description: "Time-boxed investigation used to reduce uncertainty before implementation.",
58
+ defaultStatus: "open",
59
+ folder: "spikes",
60
+ aliases: ["research-spike"],
61
+ },
62
+ ],
63
+ ops: [
64
+ {
65
+ name: "Incident",
66
+ description: "Operational disruption, degradation, or support escalation with recovery tracking.",
67
+ defaultStatus: "open",
68
+ folder: "incidents",
69
+ aliases: ["outage"],
70
+ },
71
+ {
72
+ name: "Runbook",
73
+ description: "Repeatable operational procedure, diagnostic path, or response playbook.",
74
+ defaultStatus: "open",
75
+ folder: "runbooks",
76
+ aliases: ["playbook"],
77
+ },
78
+ ],
79
+ research: [
80
+ {
81
+ name: "Experiment",
82
+ description: "Validated-learning activity with hypothesis, method, and outcome tracking.",
83
+ defaultStatus: "open",
84
+ folder: "experiments",
85
+ aliases: ["study"],
86
+ },
87
+ {
88
+ name: "Hypothesis",
89
+ description: "Testable claim or assumption that should be supported, rejected, or refined.",
90
+ defaultStatus: "open",
91
+ folder: "hypotheses",
92
+ aliases: ["assumption"],
93
+ },
94
+ ],
95
+ };
43
96
  function normalizeInitGovernancePreset(rawValue) {
44
97
  if (rawValue === undefined) {
45
98
  return undefined;
@@ -56,6 +109,19 @@ function normalizeInitGovernancePreset(rawValue) {
56
109
  }
57
110
  throw new PmCliError(`Invalid --preset value "${rawValue}". Allowed: ${BUILTIN_GOVERNANCE_PRESETS.join(", ")}`, EXIT_CODE.USAGE);
58
111
  }
112
+ function normalizeInitTypePreset(rawValue) {
113
+ if (rawValue === undefined) {
114
+ return undefined;
115
+ }
116
+ const normalized = rawValue.trim().toLowerCase().replaceAll("-", "_");
117
+ if (normalized.length === 0) {
118
+ throw new PmCliError("--type-preset must not be empty", EXIT_CODE.USAGE);
119
+ }
120
+ if (normalized === "agile" || normalized === "ops" || normalized === "research") {
121
+ return normalized;
122
+ }
123
+ throw new PmCliError(`Invalid --type-preset value "${rawValue}". Allowed: ${INIT_TYPE_PRESET_NAMES.join(", ")}`, EXIT_CODE.USAGE);
124
+ }
59
125
  function normalizeOptionalInitAuthor(rawValue) {
60
126
  if (rawValue === undefined) {
61
127
  return undefined;
@@ -114,6 +180,27 @@ function summarizeInstalledPackages(result) {
114
180
  : [],
115
181
  };
116
182
  }
183
+ async function registerInitTypePreset(pmRoot, settings, preset) {
184
+ const schema = normalizeRuntimeSchemaSettings(settings.schema);
185
+ const typesPath = filePathForSchemaSection(pmRoot, schema.files.types, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types);
186
+ const parsed = parseItemTypesFile(await readFileIfExists(typesPath));
187
+ let nextFile = parsed;
188
+ const registered = [];
189
+ const updated = [];
190
+ for (const rawDefinition of INIT_TYPE_PRESET_DEFINITIONS[preset]) {
191
+ const normalized = normalizeAddTypeInput(rawDefinition);
192
+ const upsert = upsertItemType(nextFile, normalized);
193
+ nextFile = upsert.file;
194
+ (upsert.replaced ? updated : registered).push(upsert.definition.name);
195
+ }
196
+ await writeFileAtomic(typesPath, serializeItemTypesFile(nextFile));
197
+ return {
198
+ name: preset,
199
+ registered,
200
+ updated,
201
+ file: typesPath,
202
+ };
203
+ }
117
204
  async function runInitWizard(initialPrefix, telemetryDefault) {
118
205
  const rl = readline.createInterface({ input, output });
119
206
  try {
@@ -175,6 +262,7 @@ export async function runInit(prefixArg, global, options = {}) {
175
262
  const authorFromOption = normalizeOptionalInitAuthor(options.author);
176
263
  const installBundledPackages = options.withPackages === true;
177
264
  const agentGuidanceMode = normalizeInitAgentGuidanceMode(options.agentGuidance);
265
+ const typePreset = normalizeInitTypePreset(options.typePreset);
178
266
  let chosenPreset = presetFromOption;
179
267
  let chosenTelemetryEnabled;
180
268
  let settings;
@@ -242,6 +330,17 @@ export async function runInit(prefixArg, global, options = {}) {
242
330
  op: "init:runtime_schema_file",
243
331
  })));
244
332
  }
333
+ let registeredTypePreset;
334
+ if (typePreset !== undefined) {
335
+ registeredTypePreset = await registerInitTypePreset(pmRoot, settings, typePreset);
336
+ warnings.push(`registered_type_preset:${typePreset}`);
337
+ warnings.push(...(await runActiveOnWriteHooks({
338
+ path: registeredTypePreset.file,
339
+ scope: "project",
340
+ op: "init:type_preset",
341
+ })));
342
+ settings = await readSettings(pmRoot);
343
+ }
245
344
  const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
246
345
  for (const typeFolder of typeRegistry.folders) {
247
346
  if (PM_REQUIRED_SUBDIRS.includes(typeFolder)) {
@@ -283,6 +382,9 @@ export async function runInit(prefixArg, global, options = {}) {
283
382
  else {
284
383
  nextSteps.push("Explore newly-available commands: pm cal, pm templates, pm guide");
285
384
  }
385
+ if (registeredTypePreset) {
386
+ nextSteps.push(`Inspect registered preset types: pm schema list, pm schema show ${registeredTypePreset.registered[0] ?? registeredTypePreset.updated[0]}`);
387
+ }
286
388
  nextSteps.push("Set PM_AUTHOR=<your-agent-id> so mutations attribute to the right caller.");
287
389
  for (const guidanceNextStep of agentGuidanceResult.next_steps) {
288
390
  if (!nextSteps.includes(guidanceNextStep)) {
@@ -297,10 +399,11 @@ export async function runInit(prefixArg, global, options = {}) {
297
399
  warnings,
298
400
  governance_preset: settings.governance.preset,
299
401
  wizard_used: wizardUsed,
402
+ ...(registeredTypePreset ? { registered_type_preset: registeredTypePreset } : {}),
300
403
  ...(installedPackages ? { installed_packages: installedPackages } : {}),
301
404
  next_steps: nextSteps,
302
405
  agent_guidance: agentGuidanceResult.summary,
303
406
  };
304
407
  }
305
408
  //# sourceMappingURL=init.js.map
306
- //# debugId=e4370e86-cea8-5bf3-837b-de4b3c51daa1
409
+ //# debugId=9395c248-0605-5d4c-bc9a-ce5b433a4fb0
@@ -1 +1 @@
1
- {"version":3,"file":"init.js","sources":["cli/commands/init.ts"],"sourceRoot":"/","sourcesContent":["import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport readline from \"node:readline/promises\";\nimport { stdin as input, stdout as output } from \"node:process\";\nimport { getActiveExtensionRegistrations, runActiveOnWriteHooks } from \"../../core/extensions/index.js\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { normalizePrefix } from \"../../core/item/id.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { ensureRuntimeSchemaFileScaffold } from \"../../core/schema/runtime-schema.js\";\nimport { EXIT_CODE, GOVERNANCE_PRESET_DEFAULTS, PM_REQUIRED_SUBDIRS, SETTINGS_DEFAULTS } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings, writeSettings } from \"../../core/store/settings.js\";\nimport type { GovernancePreset, PmSettings } from \"../../types/index.js\";\nimport { runExtension, type ExtensionCommandResult } from \"./extension.js\";\nimport {\n INIT_AGENT_GUIDANCE_MODE_VALUES,\n runInitAgentGuidance,\n type InitAgentGuidanceMode,\n type InitAgentGuidanceSummary,\n} from \"./init-agent-guidance.js\";\n\nexport interface InitInstalledPackagesSummary {\n installed_all: boolean;\n installed_count: number;\n packages: Array<{\n alias: string;\n ok: boolean;\n }>;\n}\n\nexport interface InitResult {\n ok: boolean;\n path: string;\n settings: PmSettings;\n created_dirs: string[];\n warnings: string[];\n governance_preset: GovernancePreset;\n wizard_used: boolean;\n installed_packages?: InitInstalledPackagesSummary;\n next_steps: string[];\n agent_guidance: InitAgentGuidanceSummary;\n}\n\nexport interface InitCommandOptions {\n preset?: string;\n defaults?: boolean;\n author?: string;\n withPackages?: boolean;\n agentGuidance?: string;\n}\n\n/**\n * Concise projection of an InitResult for the default (toon) renderer. It keeps\n * every piece of information that only init can surface — the resolved path, id\n * prefix, governance preset, telemetry capture level, created-directory count,\n * the full warnings list (including `already_exists:` markers), agent-guidance\n * summary, and next steps — but replaces the verbose full settings tree (~190\n * lines) with a compact `settings` summary. Use --verbose for the full tree.\n */\nexport interface InitConciseResult {\n ok: boolean;\n path: string;\n id_prefix: string;\n governance_preset: GovernancePreset;\n telemetry: {\n enabled: boolean;\n capture_level: string;\n };\n output_format: string;\n created_dirs_count: number;\n created_dirs: string[];\n warnings: string[];\n wizard_used: boolean;\n installed_packages?: InitInstalledPackagesSummary;\n next_steps: string[];\n agent_guidance: InitAgentGuidanceSummary;\n hint: string;\n}\n\nexport function summarizeInitResult(result: InitResult): InitConciseResult {\n return {\n ok: result.ok,\n path: result.path,\n id_prefix: result.settings.id_prefix,\n governance_preset: result.governance_preset,\n telemetry: {\n enabled: result.settings.telemetry.enabled,\n capture_level: result.settings.telemetry.capture_level,\n },\n output_format: result.settings.output.default_format,\n created_dirs_count: result.created_dirs.length,\n created_dirs: result.created_dirs,\n warnings: result.warnings,\n wizard_used: result.wizard_used,\n ...(result.installed_packages ? { installed_packages: result.installed_packages } : {}),\n next_steps: result.next_steps,\n agent_guidance: result.agent_guidance,\n hint: \"Re-run with --verbose for the full settings tree.\",\n };\n}\n\nfunction cloneDefaults(): PmSettings {\n return structuredClone(SETTINGS_DEFAULTS);\n}\n\ntype BuiltinGovernancePreset = Exclude<GovernancePreset, \"custom\">;\nconst BUILTIN_GOVERNANCE_PRESETS: BuiltinGovernancePreset[] = [\"minimal\", \"default\", \"strict\"];\n\nfunction normalizeInitGovernancePreset(rawValue: string | undefined): BuiltinGovernancePreset | undefined {\n if (rawValue === undefined) {\n return undefined;\n }\n const normalized = rawValue.trim().toLowerCase().replaceAll(\"-\", \"_\");\n if (normalized.length === 0) {\n throw new PmCliError(\"--preset must not be empty\", EXIT_CODE.USAGE);\n }\n if (normalized === \"minimal\" || normalized === \"default\" || normalized === \"strict\") {\n return normalized;\n }\n if (normalized === \"lite\" || normalized === \"minimum\") {\n return \"minimal\";\n }\n throw new PmCliError(\n `Invalid --preset value \"${rawValue}\". Allowed: ${BUILTIN_GOVERNANCE_PRESETS.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n}\n\nfunction normalizeOptionalInitAuthor(rawValue: string | undefined): string | undefined {\n if (rawValue === undefined) {\n return undefined;\n }\n const normalized = rawValue.trim();\n if (normalized.length === 0) {\n throw new PmCliError(\"--author must not be empty\", EXIT_CODE.USAGE);\n }\n return normalized;\n}\n\nfunction normalizeInitAgentGuidanceMode(rawValue: string | undefined): InitAgentGuidanceMode {\n if (rawValue === undefined) {\n return \"ask\";\n }\n const normalized = rawValue.trim().toLowerCase().replaceAll(\"-\", \"_\");\n if (normalized.length === 0) {\n throw new PmCliError(\"--agent-guidance must not be empty\", EXIT_CODE.USAGE);\n }\n if (normalized === \"ask\" || normalized === \"add\" || normalized === \"skip\" || normalized === \"status\") {\n return normalized;\n }\n throw new PmCliError(\n `Invalid --agent-guidance value \"${rawValue}\". Allowed: ${INIT_AGENT_GUIDANCE_MODE_VALUES.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n}\n\nfunction parseYesNoChoice(answer: string, currentDefault: boolean): boolean {\n const normalized = answer.trim().toLowerCase();\n if (normalized.length === 0) {\n return currentDefault;\n }\n if (normalized === \"y\" || normalized === \"yes\") {\n return true;\n }\n if (normalized === \"n\" || normalized === \"no\") {\n return false;\n }\n return currentDefault;\n}\n\nfunction applyGovernancePreset(settings: PmSettings, preset: BuiltinGovernancePreset): void {\n const knobs = GOVERNANCE_PRESET_DEFAULTS[preset];\n settings.governance = {\n preset,\n ...knobs,\n };\n settings.validation.parent_reference = knobs.parent_reference;\n settings.validation.metadata_profile = knobs.metadata_profile;\n}\n\nfunction summarizeInstalledPackages(result: ExtensionCommandResult): InitInstalledPackagesSummary {\n const details = result.details as {\n installed_all?: unknown;\n installed_count?: unknown;\n packages?: Array<{\n alias?: unknown;\n ok?: unknown;\n }>;\n };\n return {\n installed_all: details.installed_all === true,\n installed_count: typeof details.installed_count === \"number\" ? details.installed_count : 0,\n packages: Array.isArray(details.packages)\n ? details.packages.map((entry) => ({\n alias: typeof entry.alias === \"string\" ? entry.alias : \"\",\n ok: entry.ok === true,\n }))\n : [],\n };\n}\n\nasync function runInitWizard(initialPrefix: string, telemetryDefault: boolean): Promise<{\n prefix: string;\n preset: BuiltinGovernancePreset;\n telemetry_enabled: boolean;\n}> {\n const rl = readline.createInterface({ input, output });\n try {\n output.write(\"pm init setup wizard (agent-optimized)\\n\");\n output.write(\"This walkthrough is non-destructive and each choice can be changed later with pm config.\\n\\n\");\n\n output.write(\"1/3 Item ID prefix\\n\");\n output.write(\"Prefix is prepended to generated IDs (for example pm-a1b2).\\n\");\n const prefixAnswer = await rl.question(`Item ID prefix [${initialPrefix}]: `);\n const resolvedPrefix = prefixAnswer.trim().length > 0 ? normalizePrefix(prefixAnswer) : initialPrefix;\n\n output.write(\"\\n2/3 Governance preset\\n\");\n output.write(\"minimal: no ownership blocking, progressive create defaults, close validation off.\\n\");\n output.write(\"default: ownership conflict warnings, progressive create defaults, close validation warn.\\n\");\n output.write(\"strict: ownership blocking, strict create defaults, close validation strict.\\n\");\n const presetAnswer = await rl.question(\"Governance preset [minimal/default/strict] (default: minimal): \");\n const resolvedPreset = normalizeInitGovernancePreset(presetAnswer.trim().length > 0 ? presetAnswer : \"minimal\") ?? \"minimal\";\n\n output.write(\"\\n3/3 Project telemetry\\n\");\n output.write(\"Telemetry helps improve reliability and can be disabled anytime via pm config.\\n\");\n const telemetryLabel = telemetryDefault ? \"Y/n\" : \"y/N\";\n const telemetryAnswer = await rl.question(`Enable telemetry for this project? [${telemetryLabel}] `);\n const telemetryEnabled = parseYesNoChoice(telemetryAnswer, telemetryDefault);\n\n output.write(\"\\n\");\n return {\n prefix: resolvedPrefix,\n preset: resolvedPreset,\n telemetry_enabled: telemetryEnabled,\n };\n } finally {\n rl.close();\n }\n}\n\nexport async function runInit(\n prefixArg: string | undefined,\n global: GlobalOptions,\n options: InitCommandOptions = {},\n): Promise<InitResult> {\n const cwd = process.cwd();\n const pmRoot = resolvePmRoot(cwd, global.path);\n const createdDirs: string[] = [];\n const warnings: string[] = [];\n let wizardUsed = false;\n\n for (const subdir of PM_REQUIRED_SUBDIRS) {\n const target = subdir ? path.join(pmRoot, subdir) : pmRoot;\n const existed = await pathExists(target);\n await fs.mkdir(target, { recursive: true });\n if (existed) {\n warnings.push(`already_exists:${target}`);\n } else {\n createdDirs.push(target);\n }\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: target,\n scope: \"project\",\n op: \"init:ensure_dir\",\n })),\n );\n }\n\n const settingsPath = path.join(pmRoot, \"settings.json\");\n const settingsExists = await pathExists(settingsPath);\n let normalizedPrefix = normalizePrefix(prefixArg);\n const presetFromOption = normalizeInitGovernancePreset(options.preset);\n const useDefaults = options.defaults === true;\n const authorFromOption = normalizeOptionalInitAuthor(options.author);\n const installBundledPackages = options.withPackages === true;\n const agentGuidanceMode = normalizeInitAgentGuidanceMode(options.agentGuidance);\n let chosenPreset = presetFromOption;\n let chosenTelemetryEnabled: boolean | undefined;\n\n let settings: PmSettings;\n if (settingsExists) {\n settings = await readSettings(pmRoot);\n warnings.push(`already_exists:${settingsPath}`);\n let changed = false;\n if (prefixArg !== undefined && settings.id_prefix !== normalizedPrefix) {\n settings.id_prefix = normalizedPrefix;\n warnings.push(`updated:id_prefix:${normalizedPrefix}`);\n changed = true;\n }\n if (presetFromOption !== undefined && settings.governance.preset !== presetFromOption) {\n applyGovernancePreset(settings, presetFromOption);\n warnings.push(`updated:governance_preset:${presetFromOption}`);\n changed = true;\n }\n if (authorFromOption !== undefined && settings.author_default !== authorFromOption) {\n settings.author_default = authorFromOption;\n warnings.push(`updated:author_default:${authorFromOption}`);\n changed = true;\n }\n if (changed) {\n await writeSettings(pmRoot, settings);\n }\n } else {\n if (presetFromOption === undefined && !useDefaults && process.stdin.isTTY === true && process.stdout.isTTY === true) {\n const wizardChoices = await runInitWizard(normalizedPrefix, SETTINGS_DEFAULTS.telemetry.enabled);\n normalizedPrefix = wizardChoices.prefix;\n chosenPreset = wizardChoices.preset;\n chosenTelemetryEnabled = wizardChoices.telemetry_enabled;\n wizardUsed = true;\n }\n const effectivePreset = chosenPreset ?? \"minimal\";\n settings = cloneDefaults();\n settings.id_prefix = normalizedPrefix;\n applyGovernancePreset(settings, effectivePreset);\n if (authorFromOption !== undefined) {\n settings.author_default = authorFromOption;\n }\n if (chosenTelemetryEnabled !== undefined) {\n settings.telemetry.enabled = chosenTelemetryEnabled;\n settings.telemetry.first_run_prompt_completed = true;\n }\n await writeSettings(pmRoot, settings);\n }\n\n const agentGuidanceResult = await runInitAgentGuidance({\n pm_root: pmRoot,\n cwd,\n mode: agentGuidanceMode,\n interactive: process.stdin.isTTY === true && process.stdout.isTTY === true,\n settings,\n });\n warnings.push(...agentGuidanceResult.warnings);\n if (agentGuidanceResult.settings_changed) {\n await writeSettings(pmRoot, settings);\n }\n\n const runtimeSchemaScaffold = await ensureRuntimeSchemaFileScaffold(pmRoot, settings.schema);\n for (const createdPath of runtimeSchemaScaffold.created_paths) {\n createdDirs.push(createdPath);\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: createdPath,\n scope: \"project\",\n op: \"init:runtime_schema_file\",\n })),\n );\n }\n\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n for (const typeFolder of typeRegistry.folders) {\n if ((PM_REQUIRED_SUBDIRS as readonly string[]).includes(typeFolder)) {\n continue;\n }\n const target = path.join(pmRoot, typeFolder);\n const existed = await pathExists(target);\n await fs.mkdir(target, { recursive: true });\n if (existed) {\n warnings.push(`already_exists:${target}`);\n } else {\n createdDirs.push(target);\n }\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: target,\n scope: \"project\",\n op: \"init:ensure_dir\",\n })),\n );\n }\n\n let installedPackages: InitInstalledPackagesSummary | undefined;\n if (installBundledPackages) {\n const packageInstallResult = await runExtension(\"all\", { install: true, project: true }, global);\n warnings.push(...packageInstallResult.warnings);\n installedPackages = summarizeInstalledPackages(packageInstallResult);\n if (!installedPackages.installed_all || installedPackages.packages.some((entry) => !entry.ok)) {\n throw new PmCliError(\"pm init --with-packages did not install all bundled packages successfully.\", EXIT_CODE.GENERIC_FAILURE);\n }\n }\n\n const nextSteps: string[] = [\n 'Create your first item: pm create --type Task --title \"<title>\"',\n 'List active items: pm list',\n 'Get agent-friendly project context: pm context',\n ];\n if (!installBundledPackages) {\n nextSteps.push(\n \"Add optional packages for richer workflows: pm install calendar --project, pm install templates --project, pm install guide-shell --project\",\n );\n nextSteps.push(\"Or install everything bundled: pm init --with-packages (idempotent on re-run)\");\n } else {\n nextSteps.push(\"Explore newly-available commands: pm cal, pm templates, pm guide\");\n }\n nextSteps.push(\"Set PM_AUTHOR=<your-agent-id> so mutations attribute to the right caller.\");\n for (const guidanceNextStep of agentGuidanceResult.next_steps) {\n if (!nextSteps.includes(guidanceNextStep)) {\n nextSteps.push(guidanceNextStep);\n }\n }\n\n return {\n ok: true,\n path: pmRoot,\n settings,\n created_dirs: createdDirs,\n warnings,\n governance_preset: settings.governance.preset,\n wizard_used: wizardUsed,\n ...(installedPackages ? { installed_packages: installedPackages } : {}),\n next_steps: nextSteps,\n agent_guidance: agentGuidanceResult.summary,\n };\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,M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AE,CAAC,EAAE,CAAC;YAC9F,MAAM,IAAI,UAAU,CAAC,4EAA4E,EAAE,SAAS,CAAC,eAAe,CAAC,CAAC;QAChI,CAAC;IACH,CAAC;IAED,MAAM,SAAS,GAAa;QAC1B,iEAAiE;QACjE,4BAA4B;QAC5B,gDAAgD;KACjD,CAAC;IACF,IAAI,CAAC,sBAAsB,EAAE,CAAC;QAC5B,SAAS,CAAC,IAAI,CACZ,6IAA6I,CAC9I,CAAC;QACF,SAAS,CAAC,IAAI,CAAC,+EAA+E,CAAC,CAAC;IAClG,CAAC;SAAM,CAAC;QACN,SAAS,CAAC,IAAI,CAAC,kEAAkE,CAAC,CAAC;IACrF,CAAC;IACD,SAAS,CAAC,IAAI,CAAC,2EAA2E,CAAC,CAAC;IAC5F,KAAK,MAAM,gBAAgB,IAAI,mBAAmB,CAAC,UAAU,EAAE,CAAC;QAC9D,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC;YAC1C,SAAS,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;IAED,OAAO;QACL,EAAE,EAAE,IAAI;QACR,IAAI,EAAE,MAAM;QACZ,QAAQ;QACR,YAAY,EAAE,WAAW;QACzB,QAAQ;QACR,iBAAiB,EAAE,QAAQ,CAAC,UAAU,CAAC,MAAM;QAC7C,WAAW,EAAE,UAAU;QACvB,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACvE,UAAU,EAAE,SAAS;QACrB,cAAc,EAAE,mBAAmB,CAAC,OAAO;KAC5C,CAAC;AACJ,CAAC","debugId":"e4370e86-cea8-5bf3-837b-de4b3c51daa1"}
1
+ {"version":3,"file":"init.js","sources":["cli/commands/init.ts"],"sourceRoot":"/","sourcesContent":["import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport readline from \"node:readline/promises\";\nimport { stdin as input, stdout as output } from \"node:process\";\nimport { getActiveExtensionRegistrations, runActiveOnWriteHooks } from \"../../core/extensions/index.js\";\nimport { pathExists, readFileIfExists, writeFileAtomic } from \"../../core/fs/fs-utils.js\";\nimport { normalizePrefix } from \"../../core/item/id.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport {\n DEFAULT_RUNTIME_SCHEMA_FILE_PATHS,\n ensureRuntimeSchemaFileScaffold,\n filePathForSchemaSection,\n normalizeRuntimeSchemaSettings,\n} from \"../../core/schema/runtime-schema.js\";\nimport {\n normalizeAddTypeInput,\n parseItemTypesFile,\n serializeItemTypesFile,\n upsertItemType,\n} from \"../../core/schema/item-types-file.js\";\nimport { EXIT_CODE, GOVERNANCE_PRESET_DEFAULTS, PM_REQUIRED_SUBDIRS, SETTINGS_DEFAULTS } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings, writeSettings } from \"../../core/store/settings.js\";\nimport type { GovernancePreset, PmSettings } from \"../../types/index.js\";\nimport { runExtension, type ExtensionCommandResult } from \"./extension.js\";\nimport {\n INIT_AGENT_GUIDANCE_MODE_VALUES,\n runInitAgentGuidance,\n type InitAgentGuidanceMode,\n type InitAgentGuidanceSummary,\n} from \"./init-agent-guidance.js\";\n\nexport interface InitInstalledPackagesSummary {\n installed_all: boolean;\n installed_count: number;\n packages: Array<{\n alias: string;\n ok: boolean;\n }>;\n}\n\nexport type InitTypePresetName = \"agile\" | \"ops\" | \"research\";\n\nexport interface InitRegisteredTypePresetSummary {\n name: InitTypePresetName;\n registered: string[];\n updated: string[];\n file: string;\n}\n\nexport interface InitResult {\n ok: boolean;\n path: string;\n settings: PmSettings;\n created_dirs: string[];\n warnings: string[];\n governance_preset: GovernancePreset;\n wizard_used: boolean;\n registered_type_preset?: InitRegisteredTypePresetSummary;\n installed_packages?: InitInstalledPackagesSummary;\n next_steps: string[];\n agent_guidance: InitAgentGuidanceSummary;\n}\n\nexport interface InitCommandOptions {\n preset?: string;\n defaults?: boolean;\n author?: string;\n withPackages?: boolean;\n agentGuidance?: string;\n typePreset?: string;\n}\n\n/**\n * Concise projection of an InitResult for the default (toon) renderer. It keeps\n * every piece of information that only init can surface — the resolved path, id\n * prefix, governance preset, telemetry capture level, created-directory count,\n * the full warnings list (including `already_exists:` markers), agent-guidance\n * summary, and next steps — but replaces the verbose full settings tree (~190\n * lines) with a compact `settings` summary. Use --verbose for the full tree.\n */\nexport interface InitConciseResult {\n ok: boolean;\n path: string;\n id_prefix: string;\n governance_preset: GovernancePreset;\n telemetry: {\n enabled: boolean;\n capture_level: string;\n };\n output_format: string;\n created_dirs_count: number;\n created_dirs: string[];\n warnings: string[];\n wizard_used: boolean;\n registered_type_preset?: InitRegisteredTypePresetSummary;\n installed_packages?: InitInstalledPackagesSummary;\n next_steps: string[];\n agent_guidance: InitAgentGuidanceSummary;\n hint: string;\n}\n\nexport function summarizeInitResult(result: InitResult): InitConciseResult {\n return {\n ok: result.ok,\n path: result.path,\n id_prefix: result.settings.id_prefix,\n governance_preset: result.governance_preset,\n telemetry: {\n enabled: result.settings.telemetry.enabled,\n capture_level: result.settings.telemetry.capture_level,\n },\n output_format: result.settings.output.default_format,\n created_dirs_count: result.created_dirs.length,\n created_dirs: result.created_dirs,\n warnings: result.warnings,\n wizard_used: result.wizard_used,\n ...(result.registered_type_preset ? { registered_type_preset: result.registered_type_preset } : {}),\n ...(result.installed_packages ? { installed_packages: result.installed_packages } : {}),\n next_steps: result.next_steps,\n agent_guidance: result.agent_guidance,\n hint: \"Re-run with --verbose for the full settings tree.\",\n };\n}\n\nfunction cloneDefaults(): PmSettings {\n return structuredClone(SETTINGS_DEFAULTS);\n}\n\ntype BuiltinGovernancePreset = Exclude<GovernancePreset, \"custom\">;\nconst BUILTIN_GOVERNANCE_PRESETS: BuiltinGovernancePreset[] = [\"minimal\", \"default\", \"strict\"];\nconst INIT_TYPE_PRESET_NAMES: InitTypePresetName[] = [\"agile\", \"ops\", \"research\"];\n\nconst INIT_TYPE_PRESET_DEFINITIONS: Record<InitTypePresetName, Array<Parameters<typeof normalizeAddTypeInput>[0]>> = {\n agile: [\n {\n name: \"Story\",\n description: \"User-facing outcome or capability slice expressed from a stakeholder perspective.\",\n defaultStatus: \"open\",\n folder: \"stories\",\n aliases: [\"user-story\"],\n },\n {\n name: \"Spike\",\n description: \"Time-boxed investigation used to reduce uncertainty before implementation.\",\n defaultStatus: \"open\",\n folder: \"spikes\",\n aliases: [\"research-spike\"],\n },\n ],\n ops: [\n {\n name: \"Incident\",\n description: \"Operational disruption, degradation, or support escalation with recovery tracking.\",\n defaultStatus: \"open\",\n folder: \"incidents\",\n aliases: [\"outage\"],\n },\n {\n name: \"Runbook\",\n description: \"Repeatable operational procedure, diagnostic path, or response playbook.\",\n defaultStatus: \"open\",\n folder: \"runbooks\",\n aliases: [\"playbook\"],\n },\n ],\n research: [\n {\n name: \"Experiment\",\n description: \"Validated-learning activity with hypothesis, method, and outcome tracking.\",\n defaultStatus: \"open\",\n folder: \"experiments\",\n aliases: [\"study\"],\n },\n {\n name: \"Hypothesis\",\n description: \"Testable claim or assumption that should be supported, rejected, or refined.\",\n defaultStatus: \"open\",\n folder: \"hypotheses\",\n aliases: [\"assumption\"],\n },\n ],\n};\n\nfunction normalizeInitGovernancePreset(rawValue: string | undefined): BuiltinGovernancePreset | undefined {\n if (rawValue === undefined) {\n return undefined;\n }\n const normalized = rawValue.trim().toLowerCase().replaceAll(\"-\", \"_\");\n if (normalized.length === 0) {\n throw new PmCliError(\"--preset must not be empty\", EXIT_CODE.USAGE);\n }\n if (normalized === \"minimal\" || normalized === \"default\" || normalized === \"strict\") {\n return normalized;\n }\n if (normalized === \"lite\" || normalized === \"minimum\") {\n return \"minimal\";\n }\n throw new PmCliError(\n `Invalid --preset value \"${rawValue}\". Allowed: ${BUILTIN_GOVERNANCE_PRESETS.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n}\n\nfunction normalizeInitTypePreset(rawValue: string | undefined): InitTypePresetName | undefined {\n if (rawValue === undefined) {\n return undefined;\n }\n const normalized = rawValue.trim().toLowerCase().replaceAll(\"-\", \"_\");\n if (normalized.length === 0) {\n throw new PmCliError(\"--type-preset must not be empty\", EXIT_CODE.USAGE);\n }\n if (normalized === \"agile\" || normalized === \"ops\" || normalized === \"research\") {\n return normalized;\n }\n throw new PmCliError(\n `Invalid --type-preset value \"${rawValue}\". Allowed: ${INIT_TYPE_PRESET_NAMES.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n}\n\nfunction normalizeOptionalInitAuthor(rawValue: string | undefined): string | undefined {\n if (rawValue === undefined) {\n return undefined;\n }\n const normalized = rawValue.trim();\n if (normalized.length === 0) {\n throw new PmCliError(\"--author must not be empty\", EXIT_CODE.USAGE);\n }\n return normalized;\n}\n\nfunction normalizeInitAgentGuidanceMode(rawValue: string | undefined): InitAgentGuidanceMode {\n if (rawValue === undefined) {\n return \"ask\";\n }\n const normalized = rawValue.trim().toLowerCase().replaceAll(\"-\", \"_\");\n if (normalized.length === 0) {\n throw new PmCliError(\"--agent-guidance must not be empty\", EXIT_CODE.USAGE);\n }\n if (normalized === \"ask\" || normalized === \"add\" || normalized === \"skip\" || normalized === \"status\") {\n return normalized;\n }\n throw new PmCliError(\n `Invalid --agent-guidance value \"${rawValue}\". Allowed: ${INIT_AGENT_GUIDANCE_MODE_VALUES.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n}\n\nfunction parseYesNoChoice(answer: string, currentDefault: boolean): boolean {\n const normalized = answer.trim().toLowerCase();\n if (normalized.length === 0) {\n return currentDefault;\n }\n if (normalized === \"y\" || normalized === \"yes\") {\n return true;\n }\n if (normalized === \"n\" || normalized === \"no\") {\n return false;\n }\n return currentDefault;\n}\n\nfunction applyGovernancePreset(settings: PmSettings, preset: BuiltinGovernancePreset): void {\n const knobs = GOVERNANCE_PRESET_DEFAULTS[preset];\n settings.governance = {\n preset,\n ...knobs,\n };\n settings.validation.parent_reference = knobs.parent_reference;\n settings.validation.metadata_profile = knobs.metadata_profile;\n}\n\nfunction summarizeInstalledPackages(result: ExtensionCommandResult): InitInstalledPackagesSummary {\n const details = result.details as {\n installed_all?: unknown;\n installed_count?: unknown;\n packages?: Array<{\n alias?: unknown;\n ok?: unknown;\n }>;\n };\n return {\n installed_all: details.installed_all === true,\n installed_count: typeof details.installed_count === \"number\" ? details.installed_count : 0,\n packages: Array.isArray(details.packages)\n ? details.packages.map((entry) => ({\n alias: typeof entry.alias === \"string\" ? entry.alias : \"\",\n ok: entry.ok === true,\n }))\n : [],\n };\n}\n\nasync function registerInitTypePreset(\n pmRoot: string,\n settings: PmSettings,\n preset: InitTypePresetName,\n): Promise<InitRegisteredTypePresetSummary> {\n const schema = normalizeRuntimeSchemaSettings(settings.schema);\n const typesPath = filePathForSchemaSection(pmRoot, schema.files.types, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types);\n const parsed = parseItemTypesFile(await readFileIfExists(typesPath));\n let nextFile = parsed;\n const registered: string[] = [];\n const updated: string[] = [];\n for (const rawDefinition of INIT_TYPE_PRESET_DEFINITIONS[preset]) {\n const normalized = normalizeAddTypeInput(rawDefinition);\n const upsert = upsertItemType(nextFile, normalized);\n nextFile = upsert.file;\n (upsert.replaced ? updated : registered).push(upsert.definition.name);\n }\n await writeFileAtomic(typesPath, serializeItemTypesFile(nextFile));\n return {\n name: preset,\n registered,\n updated,\n file: typesPath,\n };\n}\n\nasync function runInitWizard(initialPrefix: string, telemetryDefault: boolean): Promise<{\n prefix: string;\n preset: BuiltinGovernancePreset;\n telemetry_enabled: boolean;\n}> {\n const rl = readline.createInterface({ input, output });\n try {\n output.write(\"pm init setup wizard (agent-optimized)\\n\");\n output.write(\"This walkthrough is non-destructive and each choice can be changed later with pm config.\\n\\n\");\n\n output.write(\"1/3 Item ID prefix\\n\");\n output.write(\"Prefix is prepended to generated IDs (for example pm-a1b2).\\n\");\n const prefixAnswer = await rl.question(`Item ID prefix [${initialPrefix}]: `);\n const resolvedPrefix = prefixAnswer.trim().length > 0 ? normalizePrefix(prefixAnswer) : initialPrefix;\n\n output.write(\"\\n2/3 Governance preset\\n\");\n output.write(\"minimal: no ownership blocking, progressive create defaults, close validation off.\\n\");\n output.write(\"default: ownership conflict warnings, progressive create defaults, close validation warn.\\n\");\n output.write(\"strict: ownership blocking, strict create defaults, close validation strict.\\n\");\n const presetAnswer = await rl.question(\"Governance preset [minimal/default/strict] (default: minimal): \");\n const resolvedPreset = normalizeInitGovernancePreset(presetAnswer.trim().length > 0 ? presetAnswer : \"minimal\") ?? \"minimal\";\n\n output.write(\"\\n3/3 Project telemetry\\n\");\n output.write(\"Telemetry helps improve reliability and can be disabled anytime via pm config.\\n\");\n const telemetryLabel = telemetryDefault ? \"Y/n\" : \"y/N\";\n const telemetryAnswer = await rl.question(`Enable telemetry for this project? [${telemetryLabel}] `);\n const telemetryEnabled = parseYesNoChoice(telemetryAnswer, telemetryDefault);\n\n output.write(\"\\n\");\n return {\n prefix: resolvedPrefix,\n preset: resolvedPreset,\n telemetry_enabled: telemetryEnabled,\n };\n } finally {\n rl.close();\n }\n}\n\nexport async function runInit(\n prefixArg: string | undefined,\n global: GlobalOptions,\n options: InitCommandOptions = {},\n): Promise<InitResult> {\n const cwd = process.cwd();\n const pmRoot = resolvePmRoot(cwd, global.path);\n const createdDirs: string[] = [];\n const warnings: string[] = [];\n let wizardUsed = false;\n\n for (const subdir of PM_REQUIRED_SUBDIRS) {\n const target = subdir ? path.join(pmRoot, subdir) : pmRoot;\n const existed = await pathExists(target);\n await fs.mkdir(target, { recursive: true });\n if (existed) {\n warnings.push(`already_exists:${target}`);\n } else {\n createdDirs.push(target);\n }\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: target,\n scope: \"project\",\n op: \"init:ensure_dir\",\n })),\n );\n }\n\n const settingsPath = path.join(pmRoot, \"settings.json\");\n const settingsExists = await pathExists(settingsPath);\n let normalizedPrefix = normalizePrefix(prefixArg);\n const presetFromOption = normalizeInitGovernancePreset(options.preset);\n const useDefaults = options.defaults === true;\n const authorFromOption = normalizeOptionalInitAuthor(options.author);\n const installBundledPackages = options.withPackages === true;\n const agentGuidanceMode = normalizeInitAgentGuidanceMode(options.agentGuidance);\n const typePreset = normalizeInitTypePreset(options.typePreset);\n let chosenPreset = presetFromOption;\n let chosenTelemetryEnabled: boolean | undefined;\n\n let settings: PmSettings;\n if (settingsExists) {\n settings = await readSettings(pmRoot);\n warnings.push(`already_exists:${settingsPath}`);\n let changed = false;\n if (prefixArg !== undefined && settings.id_prefix !== normalizedPrefix) {\n settings.id_prefix = normalizedPrefix;\n warnings.push(`updated:id_prefix:${normalizedPrefix}`);\n changed = true;\n }\n if (presetFromOption !== undefined && settings.governance.preset !== presetFromOption) {\n applyGovernancePreset(settings, presetFromOption);\n warnings.push(`updated:governance_preset:${presetFromOption}`);\n changed = true;\n }\n if (authorFromOption !== undefined && settings.author_default !== authorFromOption) {\n settings.author_default = authorFromOption;\n warnings.push(`updated:author_default:${authorFromOption}`);\n changed = true;\n }\n if (changed) {\n await writeSettings(pmRoot, settings);\n }\n } else {\n if (presetFromOption === undefined && !useDefaults && process.stdin.isTTY === true && process.stdout.isTTY === true) {\n const wizardChoices = await runInitWizard(normalizedPrefix, SETTINGS_DEFAULTS.telemetry.enabled);\n normalizedPrefix = wizardChoices.prefix;\n chosenPreset = wizardChoices.preset;\n chosenTelemetryEnabled = wizardChoices.telemetry_enabled;\n wizardUsed = true;\n }\n const effectivePreset = chosenPreset ?? \"minimal\";\n settings = cloneDefaults();\n settings.id_prefix = normalizedPrefix;\n applyGovernancePreset(settings, effectivePreset);\n if (authorFromOption !== undefined) {\n settings.author_default = authorFromOption;\n }\n if (chosenTelemetryEnabled !== undefined) {\n settings.telemetry.enabled = chosenTelemetryEnabled;\n settings.telemetry.first_run_prompt_completed = true;\n }\n await writeSettings(pmRoot, settings);\n }\n\n const agentGuidanceResult = await runInitAgentGuidance({\n pm_root: pmRoot,\n cwd,\n mode: agentGuidanceMode,\n interactive: process.stdin.isTTY === true && process.stdout.isTTY === true,\n settings,\n });\n warnings.push(...agentGuidanceResult.warnings);\n if (agentGuidanceResult.settings_changed) {\n await writeSettings(pmRoot, settings);\n }\n\n const runtimeSchemaScaffold = await ensureRuntimeSchemaFileScaffold(pmRoot, settings.schema);\n for (const createdPath of runtimeSchemaScaffold.created_paths) {\n createdDirs.push(createdPath);\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: createdPath,\n scope: \"project\",\n op: \"init:runtime_schema_file\",\n })),\n );\n }\n\n let registeredTypePreset: InitRegisteredTypePresetSummary | undefined;\n if (typePreset !== undefined) {\n registeredTypePreset = await registerInitTypePreset(pmRoot, settings, typePreset);\n warnings.push(`registered_type_preset:${typePreset}`);\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: registeredTypePreset.file,\n scope: \"project\",\n op: \"init:type_preset\",\n })),\n );\n settings = await readSettings(pmRoot);\n }\n\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n for (const typeFolder of typeRegistry.folders) {\n if ((PM_REQUIRED_SUBDIRS as readonly string[]).includes(typeFolder)) {\n continue;\n }\n const target = path.join(pmRoot, typeFolder);\n const existed = await pathExists(target);\n await fs.mkdir(target, { recursive: true });\n if (existed) {\n warnings.push(`already_exists:${target}`);\n } else {\n createdDirs.push(target);\n }\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: target,\n scope: \"project\",\n op: \"init:ensure_dir\",\n })),\n );\n }\n\n let installedPackages: InitInstalledPackagesSummary | undefined;\n if (installBundledPackages) {\n const packageInstallResult = await runExtension(\"all\", { install: true, project: true }, global);\n warnings.push(...packageInstallResult.warnings);\n installedPackages = summarizeInstalledPackages(packageInstallResult);\n if (!installedPackages.installed_all || installedPackages.packages.some((entry) => !entry.ok)) {\n throw new PmCliError(\"pm init --with-packages did not install all bundled packages successfully.\", EXIT_CODE.GENERIC_FAILURE);\n }\n }\n\n const nextSteps: string[] = [\n 'Create your first item: pm create --type Task --title \"<title>\"',\n 'List active items: pm list',\n 'Get agent-friendly project context: pm context',\n ];\n if (!installBundledPackages) {\n nextSteps.push(\n \"Add optional packages for richer workflows: pm install calendar --project, pm install templates --project, pm install guide-shell --project\",\n );\n nextSteps.push(\"Or install everything bundled: pm init --with-packages (idempotent on re-run)\");\n } else {\n nextSteps.push(\"Explore newly-available commands: pm cal, pm templates, pm guide\");\n }\n if (registeredTypePreset) {\n nextSteps.push(`Inspect registered preset types: pm schema list, pm schema show ${registeredTypePreset.registered[0] ?? registeredTypePreset.updated[0]}`);\n }\n nextSteps.push(\"Set PM_AUTHOR=<your-agent-id> so mutations attribute to the right caller.\");\n for (const guidanceNextStep of agentGuidanceResult.next_steps) {\n if (!nextSteps.includes(guidanceNextStep)) {\n nextSteps.push(guidanceNextStep);\n }\n }\n\n return {\n ok: true,\n path: pmRoot,\n settings,\n created_dirs: createdDirs,\n warnings,\n governance_preset: settings.governance.preset,\n wizard_used: wizardUsed,\n ...(registeredTypePreset ? { registered_type_preset: registeredTypePreset } : {}),\n ...(installedPackages ? { installed_packages: installedPackages } : {}),\n next_steps: nextSteps,\n agent_guidance: agentGuidanceResult.summary,\n };\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,KAAK,IAAI,KAAK,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,+BAA+B,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACxG,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC1F,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,uBAAuB,E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,CAAC,CAAC,CAAC,IAAI,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAC7J,CAAC;IACD,SAAS,CAAC,IAAI,CAAC,2EAA2E,CAAC,CAAC;IAC5F,KAAK,MAAM,gBAAgB,IAAI,mBAAmB,CAAC,UAAU,EAAE,CAAC;QAC9D,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC;YAC1C,SAAS,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;IAED,OAAO;QACL,EAAE,EAAE,IAAI;QACR,IAAI,EAAE,MAAM;QACZ,QAAQ;QACR,YAAY,EAAE,WAAW;QACzB,QAAQ;QACR,iBAAiB,EAAE,QAAQ,CAAC,UAAU,CAAC,MAAM;QAC7C,WAAW,EAAE,UAAU;QACvB,GAAG,CAAC,oBAAoB,CAAC,CAAC,CAAC,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjF,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACvE,UAAU,EAAE,SAAS;QACrB,cAAc,EAAE,mBAAmB,CAAC,OAAO;KAC5C,CAAC;AACJ,CAAC","debugId":"9395c248-0605-5d4c-bc9a-ce5b433a4fb0"}
@@ -7,6 +7,11 @@ export interface ListOptions {
7
7
  priority?: string;
8
8
  deadlineBefore?: string;
9
9
  deadlineAfter?: string;
10
+ updatedAfter?: string;
11
+ updatedBefore?: string;
12
+ createdAfter?: string;
13
+ createdBefore?: string;
14
+ ids?: string;
10
15
  assignee?: string;
11
16
  assigneeFilter?: string;
12
17
  parent?: string;