@unbrained/pm-cli 2026.5.30 → 2026.6.5

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 (578) hide show
  1. package/CHANGELOG.md +152 -0
  2. package/dist/cli/argv-utils.js +7 -3
  3. package/dist/cli/argv-utils.js.map +1 -1
  4. package/dist/cli/bootstrap-args.d.ts +1 -0
  5. package/dist/cli/bootstrap-args.js +23 -3
  6. package/dist/cli/bootstrap-args.js.map +1 -1
  7. package/dist/cli/commands/calendar.js +96 -10
  8. package/dist/cli/commands/calendar.js.map +1 -1
  9. package/dist/cli/commands/close-many.d.ts +63 -0
  10. package/dist/cli/commands/close-many.js +302 -0
  11. package/dist/cli/commands/close-many.js.map +1 -0
  12. package/dist/cli/commands/completion.d.ts +1 -0
  13. package/dist/cli/commands/completion.js +241 -27
  14. package/dist/cli/commands/completion.js.map +1 -1
  15. package/dist/cli/commands/config.d.ts +4 -4
  16. package/dist/cli/commands/config.js +115 -3
  17. package/dist/cli/commands/config.js.map +1 -1
  18. package/dist/cli/commands/contracts.js +191 -162
  19. package/dist/cli/commands/contracts.js.map +1 -1
  20. package/dist/cli/commands/create.d.ts +1 -0
  21. package/dist/cli/commands/create.js +109 -116
  22. package/dist/cli/commands/create.js.map +1 -1
  23. package/dist/cli/commands/extension/doctor.d.ts +12 -0
  24. package/dist/cli/commands/extension/doctor.js +97 -2
  25. package/dist/cli/commands/extension/doctor.js.map +1 -1
  26. package/dist/cli/commands/extension/install-sources.d.ts +2 -0
  27. package/dist/cli/commands/extension/install-sources.js +11 -4
  28. package/dist/cli/commands/extension/install-sources.js.map +1 -1
  29. package/dist/cli/commands/extension/scaffold.js +49 -48
  30. package/dist/cli/commands/extension/scaffold.js.map +1 -1
  31. package/dist/cli/commands/extension.js +51 -23
  32. package/dist/cli/commands/extension.js.map +1 -1
  33. package/dist/cli/commands/get.js +7 -7
  34. package/dist/cli/commands/get.js.map +1 -1
  35. package/dist/cli/commands/health.js +38 -3
  36. package/dist/cli/commands/health.js.map +1 -1
  37. package/dist/cli/commands/index.d.ts +2 -1
  38. package/dist/cli/commands/index.js +4 -3
  39. package/dist/cli/commands/index.js.map +1 -1
  40. package/dist/cli/commands/init.d.ts +10 -0
  41. package/dist/cli/commands/init.js +107 -4
  42. package/dist/cli/commands/init.js.map +1 -1
  43. package/dist/cli/commands/list.d.ts +5 -0
  44. package/dist/cli/commands/list.js +58 -26
  45. package/dist/cli/commands/list.js.map +1 -1
  46. package/dist/cli/commands/reindex.js +164 -48
  47. package/dist/cli/commands/reindex.js.map +1 -1
  48. package/dist/cli/commands/repeatable-metadata-parsers.d.ts +15 -0
  49. package/dist/cli/commands/repeatable-metadata-parsers.js +120 -0
  50. package/dist/cli/commands/repeatable-metadata-parsers.js.map +1 -0
  51. package/dist/cli/commands/restore.js +25 -4
  52. package/dist/cli/commands/restore.js.map +1 -1
  53. package/dist/cli/commands/schema.d.ts +122 -1
  54. package/dist/cli/commands/schema.js +536 -6
  55. package/dist/cli/commands/schema.js.map +1 -1
  56. package/dist/cli/commands/search.d.ts +18 -0
  57. package/dist/cli/commands/search.js +56 -12
  58. package/dist/cli/commands/search.js.map +1 -1
  59. package/dist/cli/commands/test.js +4 -3
  60. package/dist/cli/commands/test.js.map +1 -1
  61. package/dist/cli/commands/update-many.js +69 -140
  62. package/dist/cli/commands/update-many.js.map +1 -1
  63. package/dist/cli/commands/update.d.ts +2 -0
  64. package/dist/cli/commands/update.js +138 -119
  65. package/dist/cli/commands/update.js.map +1 -1
  66. package/dist/cli/commands/validate.d.ts +1 -0
  67. package/dist/cli/commands/validate.js +63 -33
  68. package/dist/cli/commands/validate.js.map +1 -1
  69. package/dist/cli/error-guidance.js +26 -3
  70. package/dist/cli/error-guidance.js.map +1 -1
  71. package/dist/cli/help-content.js +82 -3
  72. package/dist/cli/help-content.js.map +1 -1
  73. package/dist/cli/main.js +377 -23
  74. package/dist/cli/main.js.map +1 -1
  75. package/dist/cli/register-list-query.js +16 -12
  76. package/dist/cli/register-list-query.js.map +1 -1
  77. package/dist/cli/register-mutation.js +217 -47
  78. package/dist/cli/register-mutation.js.map +1 -1
  79. package/dist/cli/register-operations.js +34 -25
  80. package/dist/cli/register-operations.js.map +1 -1
  81. package/dist/cli/register-setup.js +8 -8
  82. package/dist/cli/register-setup.js.map +1 -1
  83. package/dist/cli/registration-helpers.js +35 -5
  84. package/dist/cli/registration-helpers.js.map +1 -1
  85. package/dist/cli/search-refresh.d.ts +2 -0
  86. package/dist/cli/search-refresh.js +13 -0
  87. package/dist/cli/search-refresh.js.map +1 -0
  88. package/dist/cli-bundle/chunks/activity-3RWRRNOW.js +20 -0
  89. package/dist/cli-bundle/chunks/activity-3RWRRNOW.js.map +1 -0
  90. package/dist/cli-bundle/chunks/activity-P5BUMWP3.js +16 -0
  91. package/dist/cli-bundle/chunks/activity-P5BUMWP3.js.map +7 -0
  92. package/dist/cli-bundle/chunks/aggregate-J35K7WZB.js +206 -0
  93. package/dist/cli-bundle/chunks/aggregate-J35K7WZB.js.map +1 -0
  94. package/dist/cli-bundle/chunks/aggregate-OOAGKWRG.js +209 -0
  95. package/dist/cli-bundle/chunks/aggregate-OOAGKWRG.js.map +7 -0
  96. package/dist/cli-bundle/chunks/append-5JE3YGXU.js +72 -0
  97. package/dist/cli-bundle/chunks/append-5JE3YGXU.js.map +7 -0
  98. package/dist/cli-bundle/chunks/append-PNN6UIBZ.js +69 -0
  99. package/dist/cli-bundle/chunks/append-PNN6UIBZ.js.map +1 -0
  100. package/dist/cli-bundle/chunks/chunk-26KTVXJW.js +218 -0
  101. package/dist/cli-bundle/chunks/chunk-26KTVXJW.js.map +1 -0
  102. package/dist/cli-bundle/chunks/chunk-3HUE7XOF.js +27 -0
  103. package/dist/cli-bundle/chunks/chunk-3HUE7XOF.js.map +7 -0
  104. package/dist/cli-bundle/chunks/chunk-3OH4DAEB.js +761 -0
  105. package/dist/cli-bundle/chunks/chunk-3OH4DAEB.js.map +7 -0
  106. package/dist/cli-bundle/chunks/chunk-4LTBNUYT.js +5553 -0
  107. package/dist/cli-bundle/chunks/chunk-4LTBNUYT.js.map +1 -0
  108. package/dist/cli-bundle/chunks/chunk-4PJQSECJ.js +634 -0
  109. package/dist/cli-bundle/chunks/chunk-4PJQSECJ.js.map +7 -0
  110. package/dist/cli-bundle/chunks/chunk-4QCR4QW3.js +1832 -0
  111. package/dist/cli-bundle/chunks/chunk-4QCR4QW3.js.map +1 -0
  112. package/dist/cli-bundle/chunks/chunk-5IRA6IYD.js +1891 -0
  113. package/dist/cli-bundle/chunks/chunk-5IRA6IYD.js.map +7 -0
  114. package/dist/cli-bundle/chunks/chunk-5KB4X7YY.js +412 -0
  115. package/dist/cli-bundle/chunks/chunk-5KB4X7YY.js.map +1 -0
  116. package/dist/cli-bundle/chunks/chunk-5PAOPUZX.js +182 -0
  117. package/dist/cli-bundle/chunks/chunk-5PAOPUZX.js.map +1 -0
  118. package/dist/cli-bundle/chunks/chunk-7K24QB23.js +698 -0
  119. package/dist/cli-bundle/chunks/chunk-7K24QB23.js.map +1 -0
  120. package/dist/cli-bundle/chunks/chunk-A6PEXMYN.js +380 -0
  121. package/dist/cli-bundle/chunks/chunk-A6PEXMYN.js.map +1 -0
  122. package/dist/cli-bundle/chunks/chunk-ASQM3IF5.js +230 -0
  123. package/dist/cli-bundle/chunks/chunk-ASQM3IF5.js.map +1 -0
  124. package/dist/cli-bundle/chunks/chunk-ATBVS6WW.js +185 -0
  125. package/dist/cli-bundle/chunks/chunk-ATBVS6WW.js.map +7 -0
  126. package/dist/cli-bundle/chunks/chunk-AXXKLVTW.js +332 -0
  127. package/dist/cli-bundle/chunks/chunk-AXXKLVTW.js.map +1 -0
  128. package/dist/cli-bundle/chunks/chunk-B3N4TKNL.js +1681 -0
  129. package/dist/cli-bundle/chunks/chunk-B3N4TKNL.js.map +7 -0
  130. package/dist/cli-bundle/chunks/{chunk-PB2YU2E3.js → chunk-BNL6S7QH.js} +28 -70
  131. package/dist/cli-bundle/chunks/chunk-BNL6S7QH.js.map +7 -0
  132. package/dist/cli-bundle/chunks/chunk-CCUFLH4J.js +154 -0
  133. package/dist/cli-bundle/chunks/chunk-CCUFLH4J.js.map +1 -0
  134. package/dist/cli-bundle/chunks/chunk-CJDQB2ED.js +341 -0
  135. package/dist/cli-bundle/chunks/chunk-CJDQB2ED.js.map +7 -0
  136. package/dist/cli-bundle/chunks/chunk-CWT53EYT.js +1340 -0
  137. package/dist/cli-bundle/chunks/chunk-CWT53EYT.js.map +1 -0
  138. package/dist/cli-bundle/chunks/chunk-D3WUNETC.js +349 -0
  139. package/dist/cli-bundle/chunks/chunk-D3WUNETC.js.map +7 -0
  140. package/dist/cli-bundle/chunks/chunk-D5X7N6FI.js +1714 -0
  141. package/dist/cli-bundle/chunks/chunk-D5X7N6FI.js.map +7 -0
  142. package/dist/cli-bundle/chunks/chunk-DFIZGAI5.js +550 -0
  143. package/dist/cli-bundle/chunks/chunk-DFIZGAI5.js.map +7 -0
  144. package/dist/cli-bundle/chunks/chunk-DFUSXJDE.js +1704 -0
  145. package/dist/cli-bundle/chunks/chunk-DFUSXJDE.js.map +1 -0
  146. package/dist/cli-bundle/chunks/chunk-EAOG77HM.js +56 -0
  147. package/dist/cli-bundle/chunks/chunk-EAOG77HM.js.map +7 -0
  148. package/dist/cli-bundle/chunks/chunk-EHXPIKKP.js +2988 -0
  149. package/dist/cli-bundle/chunks/chunk-EHXPIKKP.js.map +1 -0
  150. package/dist/cli-bundle/chunks/chunk-FVXM3GKS.js +128 -0
  151. package/dist/cli-bundle/chunks/chunk-FVXM3GKS.js.map +1 -0
  152. package/dist/cli-bundle/chunks/chunk-G5BACLYH.js +454 -0
  153. package/dist/cli-bundle/chunks/chunk-G5BACLYH.js.map +1 -0
  154. package/dist/cli-bundle/chunks/chunk-GCAVRLGE.js +383 -0
  155. package/dist/cli-bundle/chunks/chunk-GCAVRLGE.js.map +7 -0
  156. package/dist/cli-bundle/chunks/chunk-GFWHHMVV.js +57 -0
  157. package/dist/cli-bundle/chunks/chunk-GFWHHMVV.js.map +1 -0
  158. package/dist/cli-bundle/chunks/chunk-GNHVV4SY.js +3860 -0
  159. package/dist/cli-bundle/chunks/chunk-GNHVV4SY.js.map +1 -0
  160. package/dist/cli-bundle/chunks/chunk-GPGAYASV.js +346 -0
  161. package/dist/cli-bundle/chunks/chunk-GPGAYASV.js.map +1 -0
  162. package/dist/cli-bundle/chunks/chunk-HPH6X4ZZ.js +1356 -0
  163. package/dist/cli-bundle/chunks/chunk-HPH6X4ZZ.js.map +7 -0
  164. package/dist/cli-bundle/chunks/chunk-HZOS2UG5.js +342 -0
  165. package/dist/cli-bundle/chunks/chunk-HZOS2UG5.js.map +7 -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-JB4RGL4V.js +185 -0
  171. package/dist/cli-bundle/chunks/chunk-JB4RGL4V.js.map +7 -0
  172. package/dist/cli-bundle/chunks/chunk-JQI2HE55.js +130 -0
  173. package/dist/cli-bundle/chunks/chunk-JQI2HE55.js.map +1 -0
  174. package/dist/cli-bundle/chunks/chunk-K47WAYQV.js +60 -0
  175. package/dist/cli-bundle/chunks/chunk-K47WAYQV.js.map +7 -0
  176. package/dist/cli-bundle/chunks/chunk-KA24HME7.js +79 -0
  177. package/dist/cli-bundle/chunks/chunk-KA24HME7.js.map +7 -0
  178. package/dist/cli-bundle/chunks/chunk-KBG47ZOY.js +1325 -0
  179. package/dist/cli-bundle/chunks/chunk-KBG47ZOY.js.map +1 -0
  180. package/dist/cli-bundle/chunks/chunk-KCMIYKTA.js +242 -0
  181. package/dist/cli-bundle/chunks/chunk-KCMIYKTA.js.map +1 -0
  182. package/dist/cli-bundle/chunks/chunk-KK6YPGH3.js +221 -0
  183. package/dist/cli-bundle/chunks/chunk-KK6YPGH3.js.map +7 -0
  184. package/dist/cli-bundle/chunks/chunk-LDJK7SHN.js +157 -0
  185. package/dist/cli-bundle/chunks/chunk-LDJK7SHN.js.map +7 -0
  186. package/dist/cli-bundle/chunks/chunk-LXYVKYMQ.js +24 -0
  187. package/dist/cli-bundle/chunks/chunk-LXYVKYMQ.js.map +1 -0
  188. package/dist/cli-bundle/chunks/chunk-MISYRLEP.js +80 -0
  189. package/dist/cli-bundle/chunks/chunk-MISYRLEP.js.map +1 -0
  190. package/dist/cli-bundle/chunks/chunk-N5YF3VFN.js +457 -0
  191. package/dist/cli-bundle/chunks/chunk-N5YF3VFN.js.map +7 -0
  192. package/dist/cli-bundle/chunks/chunk-NQP3ECKF.js +173 -0
  193. package/dist/cli-bundle/chunks/chunk-NQP3ECKF.js.map +1 -0
  194. package/dist/cli-bundle/chunks/chunk-O5IBJE6S.js +338 -0
  195. package/dist/cli-bundle/chunks/chunk-O5IBJE6S.js.map +1 -0
  196. package/dist/cli-bundle/chunks/chunk-O7IWB35H.js +18 -0
  197. package/dist/cli-bundle/chunks/chunk-O7IWB35H.js.map +7 -0
  198. package/dist/cli-bundle/chunks/chunk-OIQIXTNB.js +3040 -0
  199. package/dist/cli-bundle/chunks/chunk-OIQIXTNB.js.map +7 -0
  200. package/dist/cli-bundle/chunks/chunk-ORTLYVA4.js +751 -0
  201. package/dist/cli-bundle/chunks/chunk-ORTLYVA4.js.map +1 -0
  202. package/dist/cli-bundle/chunks/chunk-OUF3ARDX.js +1861 -0
  203. package/dist/cli-bundle/chunks/chunk-OUF3ARDX.js.map +7 -0
  204. package/dist/cli-bundle/chunks/chunk-QAJBIGRA.js +20 -0
  205. package/dist/cli-bundle/chunks/chunk-QAJBIGRA.js.map +7 -0
  206. package/dist/cli-bundle/chunks/chunk-RANZIID5.js +176 -0
  207. package/dist/cli-bundle/chunks/chunk-RANZIID5.js.map +7 -0
  208. package/dist/cli-bundle/chunks/chunk-RQAWLSUU.js +140 -0
  209. package/dist/cli-bundle/chunks/chunk-RQAWLSUU.js.map +7 -0
  210. package/dist/cli-bundle/chunks/chunk-S3CV7JGJ.js +233 -0
  211. package/dist/cli-bundle/chunks/chunk-S3CV7JGJ.js.map +7 -0
  212. package/dist/cli-bundle/chunks/chunk-SRVKTWPR.js +5705 -0
  213. package/dist/cli-bundle/chunks/chunk-SRVKTWPR.js.map +7 -0
  214. package/dist/cli-bundle/chunks/chunk-SSFMJCPF.js +76 -0
  215. package/dist/cli-bundle/chunks/chunk-SSFMJCPF.js.map +1 -0
  216. package/dist/cli-bundle/chunks/chunk-SZQCER6S.js +631 -0
  217. package/dist/cli-bundle/chunks/chunk-SZQCER6S.js.map +1 -0
  218. package/dist/cli-bundle/chunks/chunk-T2ORWB6D.js +540 -0
  219. package/dist/cli-bundle/chunks/chunk-T2ORWB6D.js.map +1 -0
  220. package/dist/cli-bundle/chunks/chunk-TBQVUNVH.js +422 -0
  221. package/dist/cli-bundle/chunks/chunk-TBQVUNVH.js.map +7 -0
  222. package/dist/cli-bundle/chunks/{chunk-RJONRNXN.js → chunk-TK633IVD.js} +51 -32
  223. package/dist/cli-bundle/chunks/chunk-TK633IVD.js.map +7 -0
  224. package/dist/cli-bundle/chunks/chunk-TQ3ZK6VD.js +131 -0
  225. package/dist/cli-bundle/chunks/chunk-TQ3ZK6VD.js.map +7 -0
  226. package/dist/cli-bundle/chunks/chunk-UFCG3SWR.js +119 -0
  227. package/dist/cli-bundle/chunks/chunk-UFCG3SWR.js.map +1 -0
  228. package/dist/cli-bundle/chunks/chunk-UOVLWB47.js +1664 -0
  229. package/dist/cli-bundle/chunks/chunk-UOVLWB47.js.map +1 -0
  230. package/dist/cli-bundle/chunks/chunk-V3JQ4IPL.js +186 -0
  231. package/dist/cli-bundle/chunks/chunk-V3JQ4IPL.js.map +1 -0
  232. package/dist/cli-bundle/chunks/chunk-VGO2T3TY.js +182 -0
  233. package/dist/cli-bundle/chunks/chunk-VGO2T3TY.js.map +1 -0
  234. package/dist/cli-bundle/chunks/chunk-WIKR7KFL.js +189 -0
  235. package/dist/cli-bundle/chunks/chunk-WIKR7KFL.js.map +7 -0
  236. package/dist/cli-bundle/chunks/chunk-XG7RJYHV.js +1385 -0
  237. package/dist/cli-bundle/chunks/chunk-XG7RJYHV.js.map +7 -0
  238. package/dist/cli-bundle/chunks/chunk-XSLQSXAH.js +53 -0
  239. package/dist/cli-bundle/chunks/chunk-XSLQSXAH.js.map +1 -0
  240. package/dist/cli-bundle/chunks/chunk-XX5LRINW.js +90 -0
  241. package/dist/cli-bundle/chunks/chunk-XX5LRINW.js.map +7 -0
  242. package/dist/cli-bundle/chunks/chunk-Y2AKE2HS.js +252 -0
  243. package/dist/cli-bundle/chunks/chunk-Y2AKE2HS.js.map +7 -0
  244. package/dist/cli-bundle/chunks/chunk-ZQ4F6EC4.js +3898 -0
  245. package/dist/cli-bundle/chunks/chunk-ZQ4F6EC4.js.map +7 -0
  246. package/dist/cli-bundle/chunks/chunk-ZRVSMOMR.js +1809 -0
  247. package/dist/cli-bundle/chunks/chunk-ZRVSMOMR.js.map +1 -0
  248. package/dist/cli-bundle/chunks/claim-AZLP7YFO.js +132 -0
  249. package/dist/cli-bundle/chunks/claim-AZLP7YFO.js.map +7 -0
  250. package/dist/cli-bundle/chunks/claim-ZFA7HKU4.js +129 -0
  251. package/dist/cli-bundle/chunks/claim-ZFA7HKU4.js.map +1 -0
  252. package/dist/cli-bundle/chunks/close-65DFYAVS.js +17 -0
  253. package/dist/cli-bundle/chunks/close-65DFYAVS.js.map +1 -0
  254. package/dist/cli-bundle/chunks/close-RMHQ3KWH.js +13 -0
  255. package/dist/cli-bundle/chunks/close-RMHQ3KWH.js.map +7 -0
  256. package/dist/cli-bundle/chunks/close-many-AKPZNSGI.js +311 -0
  257. package/dist/cli-bundle/chunks/close-many-AKPZNSGI.js.map +1 -0
  258. package/dist/cli-bundle/chunks/close-many-UKZSQGM7.js +314 -0
  259. package/dist/cli-bundle/chunks/close-many-UKZSQGM7.js.map +7 -0
  260. package/dist/cli-bundle/chunks/comments-AGBNSJJH.js +103 -0
  261. package/dist/cli-bundle/chunks/comments-AGBNSJJH.js.map +7 -0
  262. package/dist/cli-bundle/chunks/comments-CJWXQI7X.js +100 -0
  263. package/dist/cli-bundle/chunks/comments-CJWXQI7X.js.map +1 -0
  264. package/dist/cli-bundle/chunks/config-5ON3ADRH.js +1688 -0
  265. package/dist/cli-bundle/chunks/config-5ON3ADRH.js.map +7 -0
  266. package/dist/cli-bundle/chunks/config-DDPYIA6J.js +1671 -0
  267. package/dist/cli-bundle/chunks/config-DDPYIA6J.js.map +1 -0
  268. package/dist/cli-bundle/chunks/context-E6U3DWVM.js +1471 -0
  269. package/dist/cli-bundle/chunks/context-E6U3DWVM.js.map +7 -0
  270. package/dist/cli-bundle/chunks/context-ZOJEN5VT.js +1461 -0
  271. package/dist/cli-bundle/chunks/context-ZOJEN5VT.js.map +1 -0
  272. package/dist/cli-bundle/chunks/contracts-CXSFM45B.js +1277 -0
  273. package/dist/cli-bundle/chunks/contracts-CXSFM45B.js.map +7 -0
  274. package/dist/cli-bundle/chunks/contracts-LCSX5R53.js +1274 -0
  275. package/dist/cli-bundle/chunks/contracts-LCSX5R53.js.map +1 -0
  276. package/dist/cli-bundle/chunks/create-ATONSAZW.js +27 -0
  277. package/dist/cli-bundle/chunks/create-ATONSAZW.js.map +7 -0
  278. package/dist/cli-bundle/chunks/create-WYFKN2U4.js +31 -0
  279. package/dist/cli-bundle/chunks/create-WYFKN2U4.js.map +1 -0
  280. package/dist/cli-bundle/chunks/delete-RONNH4F4.js +58 -0
  281. package/dist/cli-bundle/chunks/delete-RONNH4F4.js.map +7 -0
  282. package/dist/cli-bundle/chunks/delete-ZXWC56WO.js +55 -0
  283. package/dist/cli-bundle/chunks/delete-ZXWC56WO.js.map +1 -0
  284. package/dist/cli-bundle/chunks/deps-EHXIFOZR.js +225 -0
  285. package/dist/cli-bundle/chunks/deps-EHXIFOZR.js.map +1 -0
  286. package/dist/cli-bundle/chunks/deps-WII3O4HB.js +228 -0
  287. package/dist/cli-bundle/chunks/deps-WII3O4HB.js.map +7 -0
  288. package/dist/cli-bundle/chunks/docs-JMVCFNHH.js +34 -0
  289. package/dist/cli-bundle/chunks/docs-JMVCFNHH.js.map +7 -0
  290. package/dist/cli-bundle/chunks/docs-PDREIMLS.js +31 -0
  291. package/dist/cli-bundle/chunks/docs-PDREIMLS.js.map +1 -0
  292. package/dist/cli-bundle/chunks/extension-B4ROVWJD.js +28 -0
  293. package/dist/cli-bundle/chunks/extension-B4ROVWJD.js.map +1 -0
  294. package/dist/cli-bundle/chunks/extension-G6UXSM5S.js +24 -0
  295. package/dist/cli-bundle/chunks/extension-G6UXSM5S.js.map +7 -0
  296. package/dist/cli-bundle/chunks/files-2PN7UM2D.js +282 -0
  297. package/dist/cli-bundle/chunks/files-2PN7UM2D.js.map +1 -0
  298. package/dist/cli-bundle/chunks/files-MXYS5W4M.js +285 -0
  299. package/dist/cli-bundle/chunks/files-MXYS5W4M.js.map +7 -0
  300. package/dist/cli-bundle/chunks/gc-GT552UJH.js +178 -0
  301. package/dist/cli-bundle/chunks/gc-GT552UJH.js.map +1 -0
  302. package/dist/cli-bundle/chunks/gc-QNBRJG6H.js +181 -0
  303. package/dist/cli-bundle/chunks/gc-QNBRJG6H.js.map +7 -0
  304. package/dist/cli-bundle/chunks/get-CINFEUIY.js +197 -0
  305. package/dist/cli-bundle/chunks/get-CINFEUIY.js.map +7 -0
  306. package/dist/cli-bundle/chunks/get-WXMLRG7M.js +194 -0
  307. package/dist/cli-bundle/chunks/get-WXMLRG7M.js.map +1 -0
  308. package/dist/cli-bundle/chunks/health-5VPOJQ53.js +1258 -0
  309. package/dist/cli-bundle/chunks/health-5VPOJQ53.js.map +1 -0
  310. package/dist/cli-bundle/chunks/health-IT5DBPRJ.js +1261 -0
  311. package/dist/cli-bundle/chunks/health-IT5DBPRJ.js.map +7 -0
  312. package/dist/cli-bundle/chunks/history-6FC4H6HI.js +20 -0
  313. package/dist/cli-bundle/chunks/history-6FC4H6HI.js.map +7 -0
  314. package/dist/cli-bundle/chunks/history-FLZIP7PM.js +24 -0
  315. package/dist/cli-bundle/chunks/history-FLZIP7PM.js.map +1 -0
  316. package/dist/cli-bundle/chunks/history-redact-SSZBAD76.js +23 -0
  317. package/dist/cli-bundle/chunks/history-redact-SSZBAD76.js.map +1 -0
  318. package/dist/cli-bundle/chunks/history-redact-XKYEZDBL.js +19 -0
  319. package/dist/cli-bundle/chunks/history-redact-XKYEZDBL.js.map +7 -0
  320. package/dist/cli-bundle/chunks/history-repair-KC5ZOJRZ.js +196 -0
  321. package/dist/cli-bundle/chunks/history-repair-KC5ZOJRZ.js.map +7 -0
  322. package/dist/cli-bundle/chunks/history-repair-X7CO5JJZ.js +193 -0
  323. package/dist/cli-bundle/chunks/history-repair-X7CO5JJZ.js.map +1 -0
  324. package/dist/cli-bundle/chunks/init-6MRFVOLH.js +20 -0
  325. package/dist/cli-bundle/chunks/init-6MRFVOLH.js.map +1 -0
  326. package/dist/cli-bundle/chunks/init-KHX3FEEM.js +16 -0
  327. package/dist/cli-bundle/chunks/init-KHX3FEEM.js.map +7 -0
  328. package/dist/cli-bundle/chunks/learnings-A3CLB5CO.js +47 -0
  329. package/dist/cli-bundle/chunks/learnings-A3CLB5CO.js.map +7 -0
  330. package/dist/cli-bundle/chunks/learnings-DCX55BNX.js +44 -0
  331. package/dist/cli-bundle/chunks/learnings-DCX55BNX.js.map +1 -0
  332. package/dist/cli-bundle/chunks/list-53LZ2AEO.js +20 -0
  333. package/dist/cli-bundle/chunks/list-53LZ2AEO.js.map +7 -0
  334. package/dist/cli-bundle/chunks/list-DBRECOG4.js +24 -0
  335. package/dist/cli-bundle/chunks/list-DBRECOG4.js.map +1 -0
  336. package/dist/cli-bundle/chunks/notes-42LIC3UE.js +47 -0
  337. package/dist/cli-bundle/chunks/notes-42LIC3UE.js.map +7 -0
  338. package/dist/cli-bundle/chunks/notes-P5O3VMQ3.js +44 -0
  339. package/dist/cli-bundle/chunks/notes-P5O3VMQ3.js.map +1 -0
  340. package/dist/cli-bundle/chunks/plan-HDQXEUKD.js +1174 -0
  341. package/dist/cli-bundle/chunks/plan-HDQXEUKD.js.map +7 -0
  342. package/dist/cli-bundle/chunks/plan-IGTE3WOJ.js +1171 -0
  343. package/dist/cli-bundle/chunks/plan-IGTE3WOJ.js.map +1 -0
  344. package/dist/cli-bundle/chunks/{register-list-query-EIVQ5FMR.js → register-list-query-AG3XKXWL.js} +25 -18
  345. package/dist/cli-bundle/chunks/register-list-query-AG3XKXWL.js.map +7 -0
  346. package/dist/cli-bundle/chunks/register-list-query-EMNSIUO4.js +227 -0
  347. package/dist/cli-bundle/chunks/register-list-query-EMNSIUO4.js.map +1 -0
  348. package/dist/cli-bundle/chunks/register-mutation-M3YS6XDO.js +813 -0
  349. package/dist/cli-bundle/chunks/register-mutation-M3YS6XDO.js.map +1 -0
  350. package/dist/cli-bundle/chunks/{register-mutation-RSZNPSGI.js → register-mutation-RSMT6DPK.js} +160 -39
  351. package/dist/cli-bundle/chunks/register-mutation-RSMT6DPK.js.map +7 -0
  352. package/dist/cli-bundle/chunks/register-operations-KYUOOOOD.js +370 -0
  353. package/dist/cli-bundle/chunks/register-operations-KYUOOOOD.js.map +1 -0
  354. package/dist/cli-bundle/chunks/{register-operations-APUSYDMR.js → register-operations-Q54JQZUN.js} +50 -32
  355. package/dist/cli-bundle/chunks/register-operations-Q54JQZUN.js.map +7 -0
  356. package/dist/cli-bundle/chunks/register-setup-DI6P7X75.js +242 -0
  357. package/dist/cli-bundle/chunks/register-setup-DI6P7X75.js.map +1 -0
  358. package/dist/cli-bundle/chunks/{register-setup-OZOKSMPJ.js → register-setup-YJKIQRKA.js} +21 -13
  359. package/dist/cli-bundle/chunks/register-setup-YJKIQRKA.js.map +7 -0
  360. package/dist/cli-bundle/chunks/restore-2XVTBLKQ.js +21 -0
  361. package/dist/cli-bundle/chunks/restore-2XVTBLKQ.js.map +1 -0
  362. package/dist/cli-bundle/chunks/restore-JL5QIH7H.js +17 -0
  363. package/dist/cli-bundle/chunks/restore-JL5QIH7H.js.map +7 -0
  364. package/dist/cli-bundle/chunks/schema-LVXZWFGY.js +770 -0
  365. package/dist/cli-bundle/chunks/schema-LVXZWFGY.js.map +1 -0
  366. package/dist/cli-bundle/chunks/schema-V6BX65Q2.js +780 -0
  367. package/dist/cli-bundle/chunks/schema-V6BX65Q2.js.map +7 -0
  368. package/dist/cli-bundle/chunks/search-5A3BMFA7.js +1144 -0
  369. package/dist/cli-bundle/chunks/search-5A3BMFA7.js.map +7 -0
  370. package/dist/cli-bundle/chunks/search-C7NPB7G7.js +1127 -0
  371. package/dist/cli-bundle/chunks/search-C7NPB7G7.js.map +1 -0
  372. package/dist/cli-bundle/chunks/stats-FNLYVXTB.js +120 -0
  373. package/dist/cli-bundle/chunks/stats-FNLYVXTB.js.map +1 -0
  374. package/dist/cli-bundle/chunks/stats-Y2CBTZSL.js +123 -0
  375. package/dist/cli-bundle/chunks/stats-Y2CBTZSL.js.map +7 -0
  376. package/dist/cli-bundle/chunks/test-OFYONO3C.js +35 -0
  377. package/dist/cli-bundle/chunks/test-OFYONO3C.js.map +1 -0
  378. package/dist/cli-bundle/chunks/test-RJ4ZF35X.js +31 -0
  379. package/dist/cli-bundle/chunks/test-RJ4ZF35X.js.map +7 -0
  380. package/dist/cli-bundle/chunks/test-all-EEMKNTGU.js +331 -0
  381. package/dist/cli-bundle/chunks/test-all-EEMKNTGU.js.map +7 -0
  382. package/dist/cli-bundle/chunks/test-all-OJE6CIO7.js +328 -0
  383. package/dist/cli-bundle/chunks/test-all-OJE6CIO7.js.map +1 -0
  384. package/dist/cli-bundle/chunks/test-runs-IPOPFOAF.js +929 -0
  385. package/dist/cli-bundle/chunks/test-runs-IPOPFOAF.js.map +1 -0
  386. package/dist/cli-bundle/chunks/test-runs-L2M7WKH7.js +939 -0
  387. package/dist/cli-bundle/chunks/test-runs-L2M7WKH7.js.map +7 -0
  388. package/dist/cli-bundle/chunks/update-6YEHPVXH.js +25 -0
  389. package/dist/cli-bundle/chunks/update-6YEHPVXH.js.map +1 -0
  390. package/dist/cli-bundle/chunks/update-PYLVHMRD.js +21 -0
  391. package/dist/cli-bundle/chunks/update-PYLVHMRD.js.map +7 -0
  392. package/dist/cli-bundle/chunks/update-many-322CCH2L.js +608 -0
  393. package/dist/cli-bundle/chunks/update-many-322CCH2L.js.map +7 -0
  394. package/dist/cli-bundle/chunks/update-many-DYWGW57M.js +605 -0
  395. package/dist/cli-bundle/chunks/update-many-DYWGW57M.js.map +1 -0
  396. package/dist/cli-bundle/chunks/upgrade-2U727SAM.js +269 -0
  397. package/dist/cli-bundle/chunks/upgrade-2U727SAM.js.map +7 -0
  398. package/dist/cli-bundle/chunks/upgrade-3W3RVSNM.js +266 -0
  399. package/dist/cli-bundle/chunks/upgrade-3W3RVSNM.js.map +1 -0
  400. package/dist/cli-bundle/chunks/validate-GZ24NYHO.js +1120 -0
  401. package/dist/cli-bundle/chunks/validate-GZ24NYHO.js.map +1 -0
  402. package/dist/cli-bundle/chunks/validate-ZFVWPEEN.js +1123 -0
  403. package/dist/cli-bundle/chunks/validate-ZFVWPEEN.js.map +7 -0
  404. package/dist/cli-bundle/main.js +615 -121
  405. package/dist/cli-bundle/main.js.map +4 -4
  406. package/dist/core/checkpoint/mutation-checkpoint.d.ts +44 -0
  407. package/dist/core/checkpoint/mutation-checkpoint.js +119 -0
  408. package/dist/core/checkpoint/mutation-checkpoint.js.map +1 -0
  409. package/dist/core/config/positional-value.js +4 -2
  410. package/dist/core/config/positional-value.js.map +1 -1
  411. package/dist/core/diagnostics/remediation.d.ts +73 -0
  412. package/dist/core/diagnostics/remediation.js +328 -0
  413. package/dist/core/diagnostics/remediation.js.map +1 -0
  414. package/dist/core/extensions/extension-hook-runtime.js +9 -2
  415. package/dist/core/extensions/extension-hook-runtime.js.map +1 -1
  416. package/dist/core/extensions/extension-types.d.ts +60 -4
  417. package/dist/core/extensions/extension-types.js +2 -2
  418. package/dist/core/extensions/extension-types.js.map +1 -1
  419. package/dist/core/extensions/index.d.ts +5 -1
  420. package/dist/core/extensions/index.js +61 -2
  421. package/dist/core/extensions/index.js.map +1 -1
  422. package/dist/core/extensions/item-fields.d.ts +5 -1
  423. package/dist/core/extensions/item-fields.js +126 -4
  424. package/dist/core/extensions/item-fields.js.map +1 -1
  425. package/dist/core/extensions/loader.js +283 -8
  426. package/dist/core/extensions/loader.js.map +1 -1
  427. package/dist/core/item/item-format.d.ts +3 -2
  428. package/dist/core/item/item-format.js +15 -10
  429. package/dist/core/item/item-format.js.map +1 -1
  430. package/dist/core/item/item-type-definition.js +6 -2
  431. package/dist/core/item/item-type-definition.js.map +1 -1
  432. package/dist/core/item/status-filter.d.ts +29 -0
  433. package/dist/core/item/status-filter.js +97 -0
  434. package/dist/core/item/status-filter.js.map +1 -0
  435. package/dist/core/item/type-registry.d.ts +4 -0
  436. package/dist/core/item/type-registry.js +12 -2
  437. package/dist/core/item/type-registry.js.map +1 -1
  438. package/dist/core/output/output.js +17 -5
  439. package/dist/core/output/output.js.map +1 -1
  440. package/dist/core/schema/item-types-file.d.ts +15 -0
  441. package/dist/core/schema/item-types-file.js +27 -2
  442. package/dist/core/schema/item-types-file.js.map +1 -1
  443. package/dist/core/schema/runtime-field-filters.js +4 -3
  444. package/dist/core/schema/runtime-field-filters.js.map +1 -1
  445. package/dist/core/schema/runtime-field-values.d.ts +1 -1
  446. package/dist/core/schema/runtime-field-values.js +10 -4
  447. package/dist/core/schema/runtime-field-values.js.map +1 -1
  448. package/dist/core/schema/runtime-schema.js +75 -2
  449. package/dist/core/schema/runtime-schema.js.map +1 -1
  450. package/dist/core/schema/status-defs-file.d.ts +113 -0
  451. package/dist/core/schema/status-defs-file.js +260 -0
  452. package/dist/core/schema/status-defs-file.js.map +1 -0
  453. package/dist/core/schema/type-workflows.d.ts +64 -0
  454. package/dist/core/schema/type-workflows.js +98 -0
  455. package/dist/core/schema/type-workflows.js.map +1 -0
  456. package/dist/core/search/background-refresh.d.ts +53 -0
  457. package/dist/core/search/background-refresh.js +286 -0
  458. package/dist/core/search/background-refresh.js.map +1 -0
  459. package/dist/core/search/cache.d.ts +23 -2
  460. package/dist/core/search/cache.js +135 -30
  461. package/dist/core/search/cache.js.map +1 -1
  462. package/dist/core/search/http-client.d.ts +2 -2
  463. package/dist/core/search/http-client.js +2 -2
  464. package/dist/core/search/http-client.js.map +1 -1
  465. package/dist/core/search/vector-stores.d.ts +1 -0
  466. package/dist/core/search/vector-stores.js +69 -15
  467. package/dist/core/search/vector-stores.js.map +1 -1
  468. package/dist/core/search/vectorization-metadata.d.ts +13 -0
  469. package/dist/core/search/vectorization-metadata.js +65 -0
  470. package/dist/core/search/vectorization-metadata.js.map +1 -0
  471. package/dist/core/shared/constants.d.ts +2 -2
  472. package/dist/core/shared/constants.js +2 -3
  473. package/dist/core/shared/constants.js.map +1 -1
  474. package/dist/core/shared/serialization.d.ts +1 -0
  475. package/dist/core/shared/serialization.js +86 -2
  476. package/dist/core/shared/serialization.js.map +1 -1
  477. package/dist/core/store/front-matter-cache.js +14 -5
  478. package/dist/core/store/front-matter-cache.js.map +1 -1
  479. package/dist/core/store/item-format-migration.js +25 -15
  480. package/dist/core/store/item-format-migration.js.map +1 -1
  481. package/dist/core/store/item-store.d.ts +2 -0
  482. package/dist/core/store/item-store.js +61 -6
  483. package/dist/core/store/item-store.js.map +1 -1
  484. package/dist/core/store/settings-validator.js +22 -2
  485. package/dist/core/store/settings-validator.js.map +1 -1
  486. package/dist/core/store/settings.js +40 -5
  487. package/dist/core/store/settings.js.map +1 -1
  488. package/dist/core/telemetry/consent.js +3 -3
  489. package/dist/core/telemetry/consent.js.map +1 -1
  490. package/dist/core/telemetry/observability.js +4 -3
  491. package/dist/core/telemetry/observability.js.map +1 -1
  492. package/dist/core/telemetry/runtime.d.ts +10 -0
  493. package/dist/core/telemetry/runtime.js +86 -2
  494. package/dist/core/telemetry/runtime.js.map +1 -1
  495. package/dist/mcp/server.js +221 -12
  496. package/dist/mcp/server.js.map +1 -1
  497. package/dist/sdk/cli-contracts/commander-mutation-options.js +16 -2
  498. package/dist/sdk/cli-contracts/commander-mutation-options.js.map +1 -1
  499. package/dist/sdk/cli-contracts/commander-types.js +7 -2
  500. package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
  501. package/dist/sdk/cli-contracts/enum-contracts.d.ts +2 -2
  502. package/dist/sdk/cli-contracts/enum-contracts.js +4 -2
  503. package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
  504. package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +1 -0
  505. package/dist/sdk/cli-contracts/tool-option-contracts.js +53 -3
  506. package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
  507. package/dist/sdk/cli-contracts/tool-parameter-tables.js +37 -8
  508. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  509. package/dist/sdk/cli-contracts.d.ts +19 -1
  510. package/dist/sdk/cli-contracts.js +211 -18
  511. package/dist/sdk/cli-contracts.js.map +1 -1
  512. package/dist/sdk/errors.d.ts +22 -0
  513. package/dist/sdk/errors.js +46 -0
  514. package/dist/sdk/errors.js.map +1 -0
  515. package/dist/sdk/index.d.ts +2 -1
  516. package/dist/sdk/index.js +3 -2
  517. package/dist/sdk/index.js.map +1 -1
  518. package/dist/sdk/package-import-adapters.js +14 -3
  519. package/dist/sdk/package-import-adapters.js.map +1 -1
  520. package/dist/sdk/runtime.d.ts +1 -0
  521. package/dist/sdk/runtime.js +3 -2
  522. package/dist/sdk/runtime.js.map +1 -1
  523. package/dist/sdk/testing.d.ts +77 -0
  524. package/dist/sdk/testing.js +239 -0
  525. package/dist/sdk/testing.js.map +1 -0
  526. package/dist/types.d.ts +26 -1
  527. package/dist/types.js +3 -2
  528. package/dist/types.js.map +1 -1
  529. package/docs/AGENT_GUIDE.md +21 -2
  530. package/docs/COMMANDS.md +85 -5
  531. package/docs/CONFIGURATION.md +49 -2
  532. package/docs/EXTENSIONS.md +118 -6
  533. package/docs/QUICKSTART.md +2 -0
  534. package/docs/RELEASING.md +3 -3
  535. package/docs/SDK.md +273 -1
  536. package/docs/TESTING.md +17 -0
  537. package/docs/examples/policy-restricted-extension/manifest.json +1 -0
  538. package/docs/examples/starter-extension/index.js +9 -1
  539. package/docs/examples/starter-extension/manifest.json +1 -0
  540. package/package.json +12 -7
  541. package/packages/pm-beads/extensions/beads/index.js +2 -4
  542. package/packages/pm-beads/extensions/beads/index.ts +43 -33
  543. package/packages/pm-beads/extensions/beads/manifest.json +12 -1
  544. package/packages/pm-calendar/README.md +6 -0
  545. package/packages/pm-calendar/extensions/calendar/index.js +6 -1
  546. package/packages/pm-calendar/extensions/calendar/index.ts +6 -1
  547. package/packages/pm-calendar/extensions/calendar/manifest.json +6 -1
  548. package/packages/pm-governance-audit/extensions/governance-audit/manifest.json +6 -1
  549. package/packages/pm-guide-shell/README.md +4 -0
  550. package/packages/pm-guide-shell/extensions/guide-shell/index.js +22 -0
  551. package/packages/pm-guide-shell/extensions/guide-shell/index.ts +22 -0
  552. package/packages/pm-guide-shell/extensions/guide-shell/manifest.json +6 -1
  553. package/packages/pm-guide-shell/extensions/guide-shell/runtime.js +74 -3
  554. package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +84 -4
  555. package/packages/pm-lifecycle-hooks/README.md +29 -0
  556. package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/index.js +18 -0
  557. package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/index.ts +20 -0
  558. package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/manifest.json +9 -0
  559. package/packages/pm-lifecycle-hooks/package.json +52 -0
  560. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/manifest.json +13 -1
  561. package/packages/pm-search-advanced/extensions/search-advanced/index.js +69 -1
  562. package/packages/pm-search-advanced/extensions/search-advanced/index.ts +91 -2
  563. package/packages/pm-search-advanced/extensions/search-advanced/manifest.json +13 -1
  564. package/packages/pm-templates/extensions/templates/manifest.json +6 -1
  565. package/packages/pm-todos/extensions/todos/index.js +3 -7
  566. package/packages/pm-todos/extensions/todos/index.ts +55 -42
  567. package/packages/pm-todos/extensions/todos/manifest.json +13 -1
  568. package/scripts/bundle-cli.mjs +121 -17
  569. package/dist/cli-bundle/chunks/chunk-PB2YU2E3.js.map +0 -7
  570. package/dist/cli-bundle/chunks/chunk-RJONRNXN.js.map +0 -7
  571. package/dist/cli-bundle/chunks/chunk-SW5BMMCU.js +0 -13864
  572. package/dist/cli-bundle/chunks/chunk-SW5BMMCU.js.map +0 -7
  573. package/dist/cli-bundle/chunks/commands-XJ4TJ5UN.js +0 -24225
  574. package/dist/cli-bundle/chunks/commands-XJ4TJ5UN.js.map +0 -7
  575. package/dist/cli-bundle/chunks/register-list-query-EIVQ5FMR.js.map +0 -7
  576. package/dist/cli-bundle/chunks/register-mutation-RSZNPSGI.js.map +0 -7
  577. package/dist/cli-bundle/chunks/register-operations-APUSYDMR.js.map +0 -7
  578. package/dist/cli-bundle/chunks/register-setup-OZOKSMPJ.js.map +0 -7
@@ -3,29 +3,36 @@ import {
3
3
  CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,
4
4
  CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,
5
5
  CREATE_COMMANDER_STRING_OPTION_CONTRACTS,
6
- EXIT_CODE,
7
6
  LIST_COMMANDER_STRING_OPTION_CONTRACTS,
8
- PmCliError,
9
7
  SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,
10
8
  UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,
11
9
  UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,
10
+ readFirstStringFromCommanderOptions,
11
+ readStringArrayFromCommanderOptions
12
+ } from "./chunk-ZQ4F6EC4.js";
13
+ import {
14
+ refreshSearchArtifactsForMutation,
15
+ shouldRunSearchRefreshInForeground
16
+ } from "./chunk-5IRA6IYD.js";
17
+ import {
18
+ printError,
19
+ writeStdout
20
+ } from "./chunk-HZOS2UG5.js";
21
+ import {
22
+ EXIT_CODE,
23
+ PmCliError,
12
24
  getSettingsPath,
13
25
  pathExists,
14
- printError,
15
- readFirstStringFromCommanderOptions,
16
26
  readSettings,
17
- readStringArrayFromCommanderOptions,
18
- refreshSearchArtifactsForMutation,
19
27
  resolvePmRoot,
20
- setActiveCommandResult,
21
- writeStdout
22
- } from "./chunk-SW5BMMCU.js";
28
+ setActiveCommandResult
29
+ } from "./chunk-SRVKTWPR.js";
23
30
 
24
31
  // dist/cli/registration-helpers.js
25
32
  !(function() {
26
33
  try {
27
34
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
28
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "6490100a-ca86-5c9c-98cf-32495555c543");
35
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "58403ed0-02bb-559e-8844-e05ec58f9a9d");
29
36
  } catch (e2) {
30
37
  }
31
38
  })();
@@ -228,6 +235,7 @@ function normalizeCreateOptions(commandOptions, options = {}) {
228
235
  reminder: readCreateList("reminder"),
229
236
  event: readCreateList("event"),
230
237
  typeOption: readCreateList("typeOption"),
238
+ field: readCreateList("field"),
231
239
  unset: readCreateList("unset"),
232
240
  clearDeps: commandOptions.clearDeps === true ? true : void 0,
233
241
  clearComments: commandOptions.clearComments === true ? true : void 0,
@@ -320,6 +328,7 @@ function normalizeUpdateOptions(commandOptions) {
320
328
  reminder: readUpdateList("reminder"),
321
329
  event: readUpdateList("event"),
322
330
  typeOption: readUpdateList("typeOption"),
331
+ field: readUpdateList("field"),
323
332
  unset: readUpdateList("unset"),
324
333
  clearDeps: commandOptions.clearDeps === true ? true : void 0,
325
334
  clearComments: commandOptions.clearComments === true ? true : void 0,
@@ -347,12 +356,17 @@ var UPDATE_MANY_CONTROL_OPTION_KEYS = /* @__PURE__ */ new Set([
347
356
  "filterPriority",
348
357
  "filterDeadlineBefore",
349
358
  "filterDeadlineAfter",
359
+ "filterUpdatedAfter",
360
+ "filterUpdatedBefore",
361
+ "filterCreatedAfter",
362
+ "filterCreatedBefore",
350
363
  "filterAssignee",
351
364
  "filterAssigneeFilter",
352
365
  "filterAssignee_filter",
353
366
  "filterParent",
354
367
  "filterSprint",
355
368
  "filterRelease",
369
+ "ids",
356
370
  "limit",
357
371
  "offset",
358
372
  "dryRun",
@@ -370,10 +384,24 @@ function extractUpdateManyMutationOptionSource(commandOptions) {
370
384
  return mutationOptions;
371
385
  }
372
386
  function readListOptionString(options, target) {
373
- return readFirstStringFromCommanderOptions(options, LIST_COMMANDER_STRING_OPTION_CONTRACTS.find((entry) => entry.target === target) ?? {
387
+ const contract = LIST_COMMANDER_STRING_OPTION_CONTRACTS.find((entry) => entry.target === target) ?? {
374
388
  target,
375
389
  keys: [target]
376
- });
390
+ };
391
+ const stringValue = readFirstStringFromCommanderOptions(options, contract);
392
+ if (stringValue !== void 0) {
393
+ return stringValue;
394
+ }
395
+ for (const key of contract.keys) {
396
+ const value = options[key];
397
+ if (target === "ids" && typeof value === "string") {
398
+ return value;
399
+ }
400
+ if (typeof value === "number" && Number.isFinite(value)) {
401
+ return String(value);
402
+ }
403
+ }
404
+ return void 0;
377
405
  }
378
406
  function normalizeListOptions(options) {
379
407
  const normalized = {
@@ -383,6 +411,11 @@ function normalizeListOptions(options) {
383
411
  priority: readListOptionString(options, "priority"),
384
412
  deadlineBefore: readListOptionString(options, "deadlineBefore"),
385
413
  deadlineAfter: readListOptionString(options, "deadlineAfter"),
414
+ updatedAfter: readListOptionString(options, "updatedAfter"),
415
+ updatedBefore: readListOptionString(options, "updatedBefore"),
416
+ createdAfter: readListOptionString(options, "createdAfter"),
417
+ createdBefore: readListOptionString(options, "createdBefore"),
418
+ ids: readListOptionString(options, "ids"),
386
419
  assignee: readListOptionString(options, "assignee"),
387
420
  assigneeFilter: readListOptionString(options, "assigneeFilter"),
388
421
  parent: readListOptionString(options, "parent"),
@@ -500,6 +533,7 @@ function normalizeSearchOptions(options) {
500
533
  includeLinked: options.includeLinked === true ? true : void 0,
501
534
  titleExact: options.titleExact === true ? true : void 0,
502
535
  phraseExact: options.phraseExact === true ? true : void 0,
536
+ status: readSearchString("status"),
503
537
  type: readSearchString("type"),
504
538
  tag: readSearchString("tag"),
505
539
  priority: readSearchString("priority"),
@@ -632,28 +666,14 @@ function collectMutationItemIds(result) {
632
666
  }
633
667
  async function invalidateSearchCachesForMutation(globalOptions, result) {
634
668
  const pmRoot = resolvePmRoot(process.cwd(), globalOptions.path);
635
- const refreshResult = await refreshSearchArtifactsForMutation(pmRoot, collectMutationItemIds(result));
669
+ const refreshResult = await refreshSearchArtifactsForMutation(pmRoot, collectMutationItemIds(result), {
670
+ background: !shouldRunSearchRefreshInForeground()
671
+ });
636
672
  if (globalOptions.profile && refreshResult.warnings.length > 0) {
637
673
  printError(`profile:search_refresh_warnings=${formatHookWarnings(refreshResult.warnings)}`);
638
674
  }
639
675
  }
640
676
 
641
- // dist/core/shared/lazy-module.js
642
- !(function() {
643
- try {
644
- var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
645
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "8a197e16-769b-582e-833f-997a66d98407");
646
- } catch (e2) {
647
- }
648
- })();
649
- function createLazyModule(importer) {
650
- let promise = null;
651
- return () => {
652
- promise ??= importer();
653
- return promise;
654
- };
655
- }
656
-
657
677
  export {
658
678
  setResolvedGlobalOptions,
659
679
  clearResolvedGlobalOptions,
@@ -676,7 +696,6 @@ export {
676
696
  normalizeActivityOptions,
677
697
  resolveActivityStreamMode,
678
698
  normalizeContextOptions,
679
- invalidateSearchCachesForMutation,
680
- createLazyModule
699
+ invalidateSearchCachesForMutation
681
700
  };
682
- //# sourceMappingURL=chunk-RJONRNXN.js.map
701
+ //# sourceMappingURL=chunk-TK633IVD.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../../cli/registration-helpers.ts"],
4
+ "sourcesContent": ["import type { Command } from \"commander\";\nimport { pathExists } from \"../core/fs/fs-utils.js\";\nimport { normalizeStatusInput } from \"../core/item/status.js\";\nimport { refreshSearchArtifactsForMutation } from \"../core/search/cache.js\";\nimport { shouldRunSearchRefreshInForeground } from \"../core/search/background-refresh.js\";\nimport { EXIT_CODE } from \"../core/shared/constants.js\";\nimport { PmCliError } from \"../core/shared/errors.js\";\nimport { printError, printResult, writeStdout } from \"../core/output/output.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../core/store/paths.js\";\nimport { readSettings } from \"../core/store/settings.js\";\nimport {\n setActiveCommandResult,\n} from \"../core/extensions/index.js\";\nimport type { GlobalOptions } from \"../core/shared/command-types.js\";\nimport type { ItemStatus } from \"../types/index.js\";\nimport {\n ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,\n CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,\n CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,\n CREATE_COMMANDER_STRING_OPTION_CONTRACTS,\n LIST_COMMANDER_STRING_OPTION_CONTRACTS,\n SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,\n UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,\n UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,\n readFirstStringFromCommanderOptions,\n readStringArrayFromCommanderOptions,\n} from \"../sdk/cli-contracts.js\";\nimport type {\n ContextOptions,\n CreateCommandOptions,\n AggregateOptions,\n ListOptions,\n} from \"./commands/index.js\";\nimport type { runList, runActivity } from \"./commands/index.js\";\n\nexport {\n printError,\n printResult,\n writeStdout,\n};\n\nconst RESOLVED_GLOBAL_OPTIONS = Symbol(\"pm.resolvedGlobalOptions\");\n\ntype CommandWithResolvedGlobals = Command & {\n [RESOLVED_GLOBAL_OPTIONS]?: GlobalOptions;\n};\n\ninterface CommandOptionsReader {\n optsWithGlobals?: () => Record<string, unknown>;\n opts?: () => Record<string, unknown>;\n}\n\nfunction commandOptionsReader(command: unknown): CommandOptionsReader {\n return typeof command === \"object\" && command !== null ? command as CommandOptionsReader : {};\n}\n\nexport function setResolvedGlobalOptions(command: Command, globalOptions: GlobalOptions): void {\n (command as CommandWithResolvedGlobals)[RESOLVED_GLOBAL_OPTIONS] = { ...globalOptions };\n}\n\nexport function clearResolvedGlobalOptions(command: Command): void {\n delete (command as CommandWithResolvedGlobals)[RESOLVED_GLOBAL_OPTIONS];\n}\n\nexport function getGlobalOptions(command: Command): GlobalOptions {\n const resolved = (command as CommandWithResolvedGlobals)[RESOLVED_GLOBAL_OPTIONS];\n if (resolved) {\n return { ...resolved };\n }\n const reader = commandOptionsReader(command);\n const opts = typeof reader.optsWithGlobals === \"function\"\n ? reader.optsWithGlobals()\n : typeof reader.opts === \"function\"\n ? reader.opts()\n : {};\n return {\n json: opts.json === true ? true : undefined,\n quiet: Boolean(opts.quiet),\n noChangedFields: opts.changedFields === false,\n path: typeof opts.path === \"string\" ? opts.path : undefined,\n noExtensions: opts.extensions === false,\n noPager: Boolean(opts.noPager),\n profile: Boolean(opts.profile),\n };\n}\n\nexport function getCommandPath(command: Command): string {\n const parts: string[] = [];\n let current: Command | null = command;\n while (current?.parent) {\n parts.unshift(current.name());\n current = current.parent;\n }\n return parts.join(\" \");\n}\n\nexport async function applyDefaultOutputFormat(globalOptions: GlobalOptions): Promise<GlobalOptions> {\n if (globalOptions.json === true) {\n return globalOptions;\n }\n const pmRoot = resolvePmRoot(process.cwd(), globalOptions.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n return globalOptions;\n }\n const settings = await readSettings(pmRoot);\n return {\n ...globalOptions,\n defaultOutputFormat: settings.output.default_format,\n };\n}\n\nexport function collect(value: string, previous: string[] | undefined): string[] {\n const next = previous ?? [];\n next.push(value);\n return next;\n}\n\nfunction pushOptionalValueFlag(args: string[], flag: string, value: unknown): void {\n if (typeof value !== \"string\") {\n return;\n }\n const trimmed = value.trim();\n if (trimmed.length === 0) {\n return;\n }\n args.push(flag, trimmed);\n}\n\nfunction pushOptionalBooleanFlag(args: string[], flag: string, value: unknown): void {\n if (value === true) {\n args.push(flag);\n }\n}\n\nfunction pushRepeatableValueFlag(args: string[], flag: string, values: unknown): void {\n if (!Array.isArray(values)) {\n return;\n }\n for (const value of values) {\n if (typeof value !== \"string\") {\n continue;\n }\n const trimmed = value.trim();\n if (trimmed.length === 0) {\n continue;\n }\n args.push(flag, trimmed);\n }\n}\n\nexport function buildBackgroundTestCommandArgs(id: string, options: Record<string, unknown>): string[] {\n const args: string[] = [\"test\", id, \"--run\", \"--json\", \"--progress\"];\n pushRepeatableValueFlag(args, \"--add\", options.add);\n pushRepeatableValueFlag(args, \"--remove\", options.remove);\n pushOptionalValueFlag(args, \"--timeout\", options.timeout);\n pushRepeatableValueFlag(args, \"--env-set\", options.envSet);\n pushRepeatableValueFlag(args, \"--env-clear\", options.envClear);\n pushOptionalBooleanFlag(args, \"--shared-host-safe\", options.sharedHostSafe);\n pushOptionalValueFlag(args, \"--pm-context\", options.pmContext);\n pushOptionalBooleanFlag(args, \"--override-linked-pm-context\", options.overrideLinkedPmContext);\n pushOptionalBooleanFlag(args, \"--fail-on-context-mismatch\", options.failOnContextMismatch);\n pushOptionalBooleanFlag(args, \"--fail-on-skipped\", options.failOnSkipped);\n pushOptionalBooleanFlag(args, \"--fail-on-empty-test-run\", options.failOnEmptyTestRun);\n pushOptionalBooleanFlag(args, \"--require-assertions-for-pm\", options.requireAssertionsForPm);\n pushOptionalBooleanFlag(args, \"--check-context\", options.checkContext);\n pushOptionalBooleanFlag(args, \"--auto-pm-context\", options.autoPmContext);\n pushOptionalValueFlag(args, \"--author\", options.author);\n pushOptionalValueFlag(args, \"--message\", options.message);\n pushOptionalBooleanFlag(args, \"--force\", options.force);\n return args;\n}\n\nexport function buildBackgroundTestAllCommandArgs(options: Record<string, unknown>): string[] {\n const args: string[] = [\"test-all\", \"--json\", \"--progress\"];\n pushOptionalValueFlag(args, \"--status\", options.status);\n pushOptionalValueFlag(args, \"--limit\", options.limit);\n pushOptionalValueFlag(args, \"--offset\", options.offset);\n pushOptionalValueFlag(args, \"--timeout\", options.timeout);\n pushRepeatableValueFlag(args, \"--env-set\", options.envSet);\n pushRepeatableValueFlag(args, \"--env-clear\", options.envClear);\n pushOptionalBooleanFlag(args, \"--shared-host-safe\", options.sharedHostSafe);\n pushOptionalValueFlag(args, \"--pm-context\", options.pmContext);\n pushOptionalBooleanFlag(args, \"--override-linked-pm-context\", options.overrideLinkedPmContext);\n pushOptionalBooleanFlag(args, \"--fail-on-context-mismatch\", options.failOnContextMismatch);\n pushOptionalBooleanFlag(args, \"--fail-on-skipped\", options.failOnSkipped);\n pushOptionalBooleanFlag(args, \"--fail-on-empty-test-run\", options.failOnEmptyTestRun);\n pushOptionalBooleanFlag(args, \"--require-assertions-for-pm\", options.requireAssertionsForPm);\n pushOptionalBooleanFlag(args, \"--check-context\", options.checkContext);\n pushOptionalBooleanFlag(args, \"--auto-pm-context\", options.autoPmContext);\n return args;\n}\n\nexport function formatHookWarnings(warnings: string[]): string {\n return warnings.join(\",\");\n}\n\nexport function normalizeCreateOptions(\n commandOptions: Record<string, unknown>,\n options: { requireType?: boolean } = {},\n): CreateCommandOptions {\n const readCreateString = (target: string): string | undefined =>\n readFirstStringFromCommanderOptions(\n commandOptions,\n CREATE_COMMANDER_STRING_OPTION_CONTRACTS.find((entry) => entry.target === target) ?? {\n target,\n keys: [target],\n },\n );\n const readCreateList = (target: string): string[] | undefined =>\n readStringArrayFromCommanderOptions(\n commandOptions,\n CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS.find((entry) => entry.target === target) ?? {\n target,\n keys: [target],\n },\n );\n\n const type = readCreateString(\"type\");\n if (options.requireType !== false && type === undefined) {\n throw new PmCliError(\n \"Missing required option --type <value>. Why required: create resolves runtime schema fields/workflow from item type. Retry: add --type <built-in or configured custom type> (example: --type Task).\",\n EXIT_CODE.USAGE,\n );\n }\n\n const normalized: Record<string, unknown> = {\n title: readCreateString(\"title\"),\n description: readCreateString(\"description\"),\n type,\n template: readCreateString(\"template\"),\n createMode: readCreateString(\"createMode\"),\n schedulePreset: readCreateString(\"schedulePreset\"),\n status: readCreateString(\"status\"),\n priority: readCreateString(\"priority\"),\n tags: readCreateString(\"tags\"),\n addTags: readCreateList(\"addTags\"),\n body: readCreateString(\"body\"),\n deadline: readCreateString(\"deadline\"),\n estimatedMinutes: readCreateString(\"estimatedMinutes\"),\n acceptanceCriteria: readCreateString(\"acceptanceCriteria\"),\n definitionOfReady: readCreateString(\"definitionOfReady\"),\n order: readCreateString(\"order\"),\n rank: readCreateString(\"rank\"),\n goal: readCreateString(\"goal\"),\n objective: readCreateString(\"objective\"),\n value: readCreateString(\"value\"),\n impact: readCreateString(\"impact\"),\n outcome: readCreateString(\"outcome\"),\n whyNow: readCreateString(\"whyNow\"),\n author: readCreateString(\"author\"),\n message: readCreateString(\"message\"),\n assignee: readCreateString(\"assignee\"),\n parent: readCreateString(\"parent\"),\n reviewer: readCreateString(\"reviewer\"),\n risk: readCreateString(\"risk\"),\n confidence: readCreateString(\"confidence\"),\n sprint: readCreateString(\"sprint\"),\n release: readCreateString(\"release\"),\n blockedBy: readCreateString(\"blockedBy\"),\n blockedReason: readCreateString(\"blockedReason\"),\n unblockNote: readCreateString(\"unblockNote\"),\n reporter: readCreateString(\"reporter\"),\n severity: readCreateString(\"severity\"),\n environment: readCreateString(\"environment\"),\n reproSteps: readCreateString(\"reproSteps\"),\n resolution: readCreateString(\"resolution\"),\n expectedResult: readCreateString(\"expectedResult\"),\n actualResult: readCreateString(\"actualResult\"),\n affectedVersion: readCreateString(\"affectedVersion\"),\n fixedVersion: readCreateString(\"fixedVersion\"),\n component: readCreateString(\"component\"),\n regression: readCreateString(\"regression\"),\n customerImpact: readCreateString(\"customerImpact\"),\n dep: readCreateList(\"dep\"),\n comment: readCreateList(\"comment\"),\n note: readCreateList(\"note\"),\n learning: readCreateList(\"learning\"),\n file: readCreateList(\"file\"),\n test: readCreateList(\"test\"),\n doc: readCreateList(\"doc\"),\n reminder: readCreateList(\"reminder\"),\n event: readCreateList(\"event\"),\n typeOption: readCreateList(\"typeOption\"),\n field: readCreateList(\"field\"),\n unset: readCreateList(\"unset\"),\n clearDeps: commandOptions.clearDeps === true ? true : undefined,\n clearComments: commandOptions.clearComments === true ? true : undefined,\n clearNotes: commandOptions.clearNotes === true ? true : undefined,\n clearLearnings: commandOptions.clearLearnings === true ? true : undefined,\n clearFiles: commandOptions.clearFiles === true ? true : undefined,\n clearTests: commandOptions.clearTests === true ? true : undefined,\n clearDocs: commandOptions.clearDocs === true ? true : undefined,\n clearReminders: commandOptions.clearReminders === true ? true : undefined,\n clearEvents: commandOptions.clearEvents === true ? true : undefined,\n clearTypeOptions: commandOptions.clearTypeOptions === true ? true : undefined,\n };\n for (const [key, value] of Object.entries(commandOptions)) {\n if (Object.hasOwn(normalized, key)) {\n continue;\n }\n normalized[key] = value;\n }\n return normalized as CreateCommandOptions;\n}\n\nexport function normalizeUpdateOptions(commandOptions: Record<string, unknown>): Record<string, unknown> {\n const readUpdateString = (target: string): string | undefined =>\n readFirstStringFromCommanderOptions(\n commandOptions,\n UPDATE_COMMANDER_STRING_OPTION_CONTRACTS.find((entry) => entry.target === target) ?? {\n target,\n keys: [target],\n },\n );\n const readUpdateList = (target: string): string[] | undefined =>\n readStringArrayFromCommanderOptions(\n commandOptions,\n UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS.find((entry) => entry.target === target) ?? {\n target,\n keys: [target],\n },\n );\n\n const normalized: Record<string, unknown> = {\n title: readUpdateString(\"title\"),\n description: readUpdateString(\"description\"),\n body: readUpdateString(\"body\"),\n status: readUpdateString(\"status\"),\n closeReason: readUpdateString(\"closeReason\"),\n priority: readUpdateString(\"priority\"),\n type: readUpdateString(\"type\"),\n tags: readUpdateString(\"tags\"),\n addTags: readUpdateList(\"addTags\"),\n removeTags: readUpdateList(\"removeTags\"),\n deadline: readUpdateString(\"deadline\"),\n estimatedMinutes: readUpdateString(\"estimatedMinutes\"),\n acceptanceCriteria: readUpdateString(\"acceptanceCriteria\"),\n definitionOfReady: readUpdateString(\"definitionOfReady\"),\n order: readUpdateString(\"order\"),\n rank: readUpdateString(\"rank\"),\n goal: readUpdateString(\"goal\"),\n objective: readUpdateString(\"objective\"),\n value: readUpdateString(\"value\"),\n impact: readUpdateString(\"impact\"),\n outcome: readUpdateString(\"outcome\"),\n whyNow: readUpdateString(\"whyNow\"),\n author: readUpdateString(\"author\"),\n message: readUpdateString(\"message\"),\n force: Boolean(commandOptions.force),\n allowAuditUpdate:\n commandOptions.allowAuditUpdate === true || commandOptions.allow_audit_update === true ? true : undefined,\n allowAuditDepUpdate:\n commandOptions.allowAuditDepUpdate === true || commandOptions.allow_audit_dep_update === true ? true : undefined,\n assignee: readUpdateString(\"assignee\"),\n parent: readUpdateString(\"parent\"),\n reviewer: readUpdateString(\"reviewer\"),\n risk: readUpdateString(\"risk\"),\n confidence: readUpdateString(\"confidence\"),\n sprint: readUpdateString(\"sprint\"),\n release: readUpdateString(\"release\"),\n blockedBy: readUpdateString(\"blockedBy\"),\n blockedReason: readUpdateString(\"blockedReason\"),\n unblockNote: readUpdateString(\"unblockNote\"),\n reporter: readUpdateString(\"reporter\"),\n severity: readUpdateString(\"severity\"),\n environment: readUpdateString(\"environment\"),\n reproSteps: readUpdateString(\"reproSteps\"),\n resolution: readUpdateString(\"resolution\"),\n expectedResult: readUpdateString(\"expectedResult\"),\n actualResult: readUpdateString(\"actualResult\"),\n affectedVersion: readUpdateString(\"affectedVersion\"),\n fixedVersion: readUpdateString(\"fixedVersion\"),\n component: readUpdateString(\"component\"),\n regression: readUpdateString(\"regression\"),\n customerImpact: readUpdateString(\"customerImpact\"),\n dep: readUpdateList(\"dep\"),\n depRemove: readUpdateList(\"depRemove\"),\n replaceDeps: commandOptions.replaceDeps === true ? true : undefined,\n replaceTests: commandOptions.replaceTests === true ? true : undefined,\n comment: readUpdateList(\"comment\"),\n note: readUpdateList(\"note\"),\n learning: readUpdateList(\"learning\"),\n file: readUpdateList(\"file\"),\n test: readUpdateList(\"test\"),\n doc: readUpdateList(\"doc\"),\n reminder: readUpdateList(\"reminder\"),\n event: readUpdateList(\"event\"),\n typeOption: readUpdateList(\"typeOption\"),\n field: readUpdateList(\"field\"),\n unset: readUpdateList(\"unset\"),\n clearDeps: commandOptions.clearDeps === true ? true : undefined,\n clearComments: commandOptions.clearComments === true ? true : undefined,\n clearNotes: commandOptions.clearNotes === true ? true : undefined,\n clearLearnings: commandOptions.clearLearnings === true ? true : undefined,\n clearFiles: commandOptions.clearFiles === true ? true : undefined,\n clearTests: commandOptions.clearTests === true ? true : undefined,\n clearDocs: commandOptions.clearDocs === true ? true : undefined,\n clearReminders: commandOptions.clearReminders === true ? true : undefined,\n clearEvents: commandOptions.clearEvents === true ? true : undefined,\n clearTypeOptions: commandOptions.clearTypeOptions === true ? true : undefined,\n };\n for (const [key, value] of Object.entries(commandOptions)) {\n if (Object.hasOwn(normalized, key)) {\n continue;\n }\n normalized[key] = value;\n }\n return normalized;\n}\n\nconst UPDATE_MANY_CONTROL_OPTION_KEYS = new Set<string>([\n \"filterStatus\",\n \"filterType\",\n \"filterTag\",\n \"filterPriority\",\n \"filterDeadlineBefore\",\n \"filterDeadlineAfter\",\n \"filterUpdatedAfter\",\n \"filterUpdatedBefore\",\n \"filterCreatedAfter\",\n \"filterCreatedBefore\",\n \"filterAssignee\",\n \"filterAssigneeFilter\",\n \"filterAssignee_filter\",\n \"filterParent\",\n \"filterSprint\",\n \"filterRelease\",\n \"ids\",\n \"limit\",\n \"offset\",\n \"dryRun\",\n \"rollback\",\n \"checkpoint\",\n]);\n\nexport function extractUpdateManyMutationOptionSource(commandOptions: Record<string, unknown>): Record<string, unknown> {\n const mutationOptions: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(commandOptions)) {\n if (UPDATE_MANY_CONTROL_OPTION_KEYS.has(key)) {\n continue;\n }\n mutationOptions[key] = value;\n }\n return mutationOptions;\n}\n\nfunction readListOptionString(options: Record<string, unknown>, target: string): string | undefined {\n const contract = LIST_COMMANDER_STRING_OPTION_CONTRACTS.find((entry) => entry.target === target) ?? {\n target,\n keys: [target],\n };\n const stringValue = readFirstStringFromCommanderOptions(options, contract);\n if (stringValue !== undefined) {\n return stringValue;\n }\n for (const key of contract.keys) {\n const value = options[key];\n if (target === \"ids\" && typeof value === \"string\") {\n return value;\n }\n if (typeof value === \"number\" && Number.isFinite(value)) {\n return String(value);\n }\n }\n return undefined;\n}\n\nexport function normalizeListOptions(options: Record<string, unknown>): ListOptions {\n const normalized: Record<string, unknown> = {\n status: readListOptionString(options, \"status\"),\n type: readListOptionString(options, \"type\"),\n tag: readListOptionString(options, \"tag\"),\n priority: readListOptionString(options, \"priority\"),\n deadlineBefore: readListOptionString(options, \"deadlineBefore\"),\n deadlineAfter: readListOptionString(options, \"deadlineAfter\"),\n updatedAfter: readListOptionString(options, \"updatedAfter\"),\n updatedBefore: readListOptionString(options, \"updatedBefore\"),\n createdAfter: readListOptionString(options, \"createdAfter\"),\n createdBefore: readListOptionString(options, \"createdBefore\"),\n ids: readListOptionString(options, \"ids\"),\n assignee: readListOptionString(options, \"assignee\"),\n assigneeFilter: readListOptionString(options, \"assigneeFilter\"),\n parent: readListOptionString(options, \"parent\"),\n sprint: readListOptionString(options, \"sprint\"),\n release: readListOptionString(options, \"release\"),\n limit: readListOptionString(options, \"limit\"),\n offset: readListOptionString(options, \"offset\"),\n includeBody: options.includeBody === true ? true : undefined,\n compact: options.compact === true ? true : undefined,\n brief: options.brief === true ? true : undefined,\n full: options.full === true ? true : undefined,\n fields: readListOptionString(options, \"fields\"),\n sort: readListOptionString(options, \"sort\"),\n order: readListOptionString(options, \"order\"),\n };\n for (const [key, value] of Object.entries(options)) {\n if (Object.hasOwn(normalized, key)) {\n continue;\n }\n normalized[key] = value;\n }\n return normalized as ListOptions;\n}\n\nexport function normalizeAggregateOptions(options: Record<string, unknown>): AggregateOptions {\n return {\n groupBy: typeof options.groupBy === \"string\" ? options.groupBy : undefined,\n count: options.count === true ? true : undefined,\n includeUnparented: options.includeUnparented === true || options.include_unparented === true,\n status: typeof options.status === \"string\" ? options.status : undefined,\n type: readListOptionString(options, \"type\"),\n tag: readListOptionString(options, \"tag\"),\n priority: readListOptionString(options, \"priority\"),\n deadlineBefore: readListOptionString(options, \"deadlineBefore\"),\n deadlineAfter: readListOptionString(options, \"deadlineAfter\"),\n assignee: readListOptionString(options, \"assignee\"),\n assigneeFilter: readListOptionString(options, \"assigneeFilter\"),\n parent: readListOptionString(options, \"parent\"),\n sprint: readListOptionString(options, \"sprint\"),\n release: readListOptionString(options, \"release\"),\n };\n}\n\ntype ListCommandResult = Awaited<ReturnType<typeof runList>>;\n\nexport function printListJsonStream(commandName: string, result: ListCommandResult, globalOptions: GlobalOptions): void {\n setActiveCommandResult(result);\n if (globalOptions.quiet) {\n return;\n }\n const warnings = Array.isArray(result.warnings) ? result.warnings : [];\n const metaPayload: Record<string, unknown> = {\n type: \"meta\",\n command: commandName,\n count: result.count,\n now: result.now,\n filters: result.filters,\n };\n if (warnings.length > 0) {\n metaPayload.warnings = warnings;\n }\n if (!writeStdout(`${JSON.stringify(metaPayload)}\\n`)) {\n return;\n }\n for (const item of result.items) {\n if (!writeStdout(`${JSON.stringify({ type: \"item\", command: commandName, item })}\\n`)) {\n return;\n }\n }\n writeStdout(`${JSON.stringify({ type: \"end\", command: commandName, count: result.count })}\\n`);\n}\n\ntype ActivityCommandResult = Awaited<ReturnType<typeof runActivity>>;\n\nexport function printActivityJsonStream(\n result: ActivityCommandResult,\n options: {\n id?: string;\n op?: string;\n author?: string;\n from?: string;\n to?: string;\n limit?: string;\n },\n globalOptions: GlobalOptions,\n): void {\n setActiveCommandResult(result);\n if (globalOptions.quiet) {\n return;\n }\n const metaPayload = {\n type: \"meta\",\n command: \"activity\",\n count: result.count,\n filters: {\n id: options.id ?? null,\n op: options.op ?? null,\n author: options.author ?? null,\n from: options.from ?? null,\n to: options.to ?? null,\n limit: options.limit ?? null,\n },\n };\n if (!writeStdout(`${JSON.stringify(metaPayload)}\\n`)) {\n return;\n }\n const entries = result.compact && result.compact_activity ? result.compact_activity : result.activity;\n for (const entry of entries) {\n if (!writeStdout(`${JSON.stringify({ type: \"entry\", command: \"activity\", entry })}\\n`)) {\n return;\n }\n }\n writeStdout(`${JSON.stringify({ type: \"end\", command: \"activity\", count: result.count })}\\n`);\n}\n\nexport function normalizeSearchOptions(options: Record<string, unknown>): Record<string, unknown> {\n const readSearchString = (target: string): string | undefined =>\n readFirstStringFromCommanderOptions(\n options,\n SEARCH_COMMANDER_STRING_OPTION_CONTRACTS.find((entry) => entry.target === target) ?? {\n target,\n keys: [target],\n },\n );\n const fields = readSearchString(\"fields\");\n const compactRequested = options.compact === true;\n const fullRequested = options.full === true;\n const defaultCompact = !compactRequested && !fullRequested && fields === undefined;\n const mode = options.semantic === true ? \"semantic\"\n : options.hybrid === true ? \"hybrid\"\n : readSearchString(\"mode\");\n const normalized: Record<string, unknown> = {\n mode,\n includeLinked: options.includeLinked === true ? true : undefined,\n titleExact: options.titleExact === true ? true : undefined,\n phraseExact: options.phraseExact === true ? true : undefined,\n status: readSearchString(\"status\"),\n type: readSearchString(\"type\"),\n tag: readSearchString(\"tag\"),\n priority: readSearchString(\"priority\"),\n deadlineBefore: readSearchString(\"deadlineBefore\"),\n deadlineAfter: readSearchString(\"deadlineAfter\"),\n limit: readSearchString(\"limit\"),\n fields,\n compact: compactRequested || defaultCompact ? true : undefined,\n full: fullRequested ? true : undefined,\n };\n for (const [key, value] of Object.entries(options)) {\n if (Object.hasOwn(normalized, key)) {\n continue;\n }\n normalized[key] = value;\n }\n return normalized;\n}\n\nexport function normalizeSearchKeywordsInput(keywords: string[]): string {\n const query = keywords\n .map((entry) => entry.trim())\n .filter((entry) => entry.length > 0)\n .join(\" \");\n if (query.length === 0) {\n throw new PmCliError(\"Search query must not be empty\", EXIT_CODE.USAGE);\n }\n return query;\n}\n\n\nexport function normalizeActivityOptions(options: Record<string, unknown>): {\n id?: string;\n op?: string;\n author?: string;\n from?: string;\n to?: string;\n limit?: string;\n compact?: boolean;\n} {\n const readActivityString = (target: string): string | undefined =>\n readFirstStringFromCommanderOptions(\n options,\n ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS.find((entry) => entry.target === target) ?? {\n target,\n keys: [target],\n },\n );\n return {\n id: readActivityString(\"id\"),\n op: readActivityString(\"op\"),\n author: readActivityString(\"author\"),\n from: readActivityString(\"from\"),\n to: readActivityString(\"to\"),\n limit: readActivityString(\"limit\"),\n compact: options.full === true ? false : options.compact === false ? false : true,\n };\n}\n\nexport function resolveActivityStreamMode(raw: unknown): boolean {\n if (raw === true) {\n return true;\n }\n if (raw === false || raw === undefined || raw === null) {\n return false;\n }\n if (typeof raw === \"string\") {\n const normalized = raw.trim().toLowerCase();\n if (\n normalized.length === 0 ||\n normalized === \"rows\" ||\n normalized === \"ndjson\" ||\n normalized === \"jsonl\" ||\n normalized === \"true\" ||\n normalized === \"1\" ||\n normalized === \"yes\" ||\n normalized === \"on\"\n ) {\n return true;\n }\n if (normalized === \"false\" || normalized === \"off\" || normalized === \"none\" || normalized === \"0\") {\n return false;\n }\n }\n throw new PmCliError(\"Activity --stream accepts rows|ndjson|jsonl (or no value)\", EXIT_CODE.USAGE);\n}\n\nexport function normalizeContextOptions(options: Record<string, unknown>): ContextOptions {\n const readContextString = (target: string): string | undefined =>\n readFirstStringFromCommanderOptions(\n options,\n CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS.find((entry) => entry.target === target) ?? {\n target,\n keys: [target],\n },\n );\n const sectionRaw = options.section;\n const section: string[] | undefined = Array.isArray(sectionRaw)\n ? (sectionRaw as string[]).filter((v) => typeof v === \"string\" && v.trim().length > 0)\n : typeof sectionRaw === \"string\" && sectionRaw.trim().length > 0\n ? [sectionRaw]\n : undefined;\n const normalized: Record<string, unknown> = {\n date: readContextString(\"date\"),\n from: readContextString(\"from\"),\n to: readContextString(\"to\"),\n past: options.past === true ? true : undefined,\n type: readContextString(\"type\"),\n tag: readContextString(\"tag\"),\n priority: readContextString(\"priority\"),\n assignee: readContextString(\"assignee\"),\n assigneeFilter: readContextString(\"assigneeFilter\"),\n sprint: readContextString(\"sprint\"),\n release: readContextString(\"release\"),\n limit: readContextString(\"limit\"),\n format: readContextString(\"format\"),\n depth: readContextString(\"depth\"),\n section: section && section.length > 0 ? section : undefined,\n activityLimit: readContextString(\"activityLimit\"),\n staleThreshold: readContextString(\"staleThreshold\"),\n };\n for (const [key, value] of Object.entries(options)) {\n if (Object.hasOwn(normalized, key)) {\n continue;\n }\n normalized[key] = value;\n }\n return normalized as ContextOptions;\n}\n\nfunction collectMutationItemIds(result: unknown): string[] {\n if (!result || typeof result !== \"object\") {\n return [];\n }\n const record = result as Record<string, unknown>;\n const ids = new Set<string>();\n const pushId = (value: unknown): void => {\n if (typeof value !== \"string\") {\n return;\n }\n const normalized = value.trim();\n if (normalized.length === 0) {\n return;\n }\n ids.add(normalized);\n };\n\n pushId(record.id);\n\n const item = record.item;\n if (item && typeof item === \"object\") {\n pushId((item as { id?: unknown }).id);\n }\n\n const explicitIds = record.ids;\n if (Array.isArray(explicitIds)) {\n for (const candidate of explicitIds) {\n pushId(candidate);\n }\n }\n\n const items = record.items;\n if (Array.isArray(items)) {\n for (const candidate of items) {\n if (!candidate || typeof candidate !== \"object\") {\n continue;\n }\n pushId((candidate as { id?: unknown }).id);\n }\n }\n\n return [...ids].sort((left, right) => left.localeCompare(right));\n}\n\nexport async function invalidateSearchCachesForMutation(globalOptions: GlobalOptions, result?: unknown): Promise<void> {\n const pmRoot = resolvePmRoot(process.cwd(), globalOptions.path);\n const refreshResult = await refreshSearchArtifactsForMutation(pmRoot, collectMutationItemIds(result), {\n background: !shouldRunSearchRefreshInForeground(),\n });\n if (globalOptions.profile && ref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oint/mutation-checkpoint.js
13
+ import { mkdir, readFile } from "node:fs/promises";
14
+ import path from "node:path";
15
+ !(function() {
16
+ try {
17
+ var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
18
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "703d6134-bb1d-5d13-8150-c611bbdf82d2");
19
+ } catch (e2) {
20
+ }
21
+ })();
22
+ function normalizeCheckpointId(raw) {
23
+ const trimmed = raw.trim();
24
+ if (!trimmed) {
25
+ throw new PmCliError("--rollback requires a non-empty checkpoint ID", EXIT_CODE.USAGE);
26
+ }
27
+ if (!/^[a-zA-Z0-9._-]+$/.test(trimmed)) {
28
+ throw new PmCliError("--rollback checkpoint ID must match [a-zA-Z0-9._-]+", EXIT_CODE.USAGE);
29
+ }
30
+ return trimmed;
31
+ }
32
+ function createCheckpointId(prefix, nowValue) {
33
+ const compactTimestamp = nowValue.replace(/[-:.TZ]/g, "").slice(0, 14);
34
+ const randomSuffix = Math.random().toString(36).slice(2, 8);
35
+ return `${prefix}-${compactTimestamp}-${randomSuffix}`;
36
+ }
37
+ function checkpointDirectoryPath(pmRoot, subdir) {
38
+ return path.join(pmRoot, "checkpoints", subdir);
39
+ }
40
+ function checkpointFilePath(pmRoot, subdir, checkpointId) {
41
+ return path.join(checkpointDirectoryPath(pmRoot, subdir), `${checkpointId}.json`);
42
+ }
43
+ async function writeMutationCheckpoint(pmRoot, subdir, checkpointId, payload) {
44
+ const checkpointDir = checkpointDirectoryPath(pmRoot, subdir);
45
+ await mkdir(checkpointDir, { recursive: true });
46
+ const filePath = checkpointFilePath(pmRoot, subdir, checkpointId);
47
+ await writeFileAtomic(filePath, `${JSON.stringify(payload, null, 2)}
48
+ `);
49
+ return filePath;
50
+ }
51
+ function parseCheckpointItems(record, checkpointId) {
52
+ if (!Array.isArray(record.items)) {
53
+ throw new PmCliError(`Checkpoint ${checkpointId} is missing items`, EXIT_CODE.GENERIC_FAILURE);
54
+ }
55
+ return record.items.map((entry) => {
56
+ if (!entry || typeof entry !== "object") {
57
+ throw new PmCliError(`Checkpoint ${checkpointId} contains an invalid item entry`, EXIT_CODE.GENERIC_FAILURE);
58
+ }
59
+ const row = entry;
60
+ if (typeof row.id !== "string" || row.id.trim().length === 0) {
61
+ throw new PmCliError(`Checkpoint ${checkpointId} contains an item entry without ID`, EXIT_CODE.GENERIC_FAILURE);
62
+ }
63
+ if (typeof row.target_updated_at !== "string" || row.target_updated_at.trim().length === 0) {
64
+ throw new PmCliError(`Checkpoint ${checkpointId} contains an item entry without target_updated_at`, EXIT_CODE.GENERIC_FAILURE);
65
+ }
66
+ return { id: row.id.trim(), target_updated_at: row.target_updated_at.trim() };
67
+ });
68
+ }
69
+ async function loadMutationCheckpoint(pmRoot, subdir, rawCheckpointId, schemaVersion) {
70
+ const normalizedId = normalizeCheckpointId(rawCheckpointId);
71
+ const filePath = checkpointFilePath(pmRoot, subdir, normalizedId);
72
+ if (!await pathExists(filePath)) {
73
+ throw new PmCliError(`Checkpoint ${normalizedId} not found`, EXIT_CODE.NOT_FOUND);
74
+ }
75
+ const raw = await readFile(filePath, "utf8");
76
+ let parsed;
77
+ try {
78
+ parsed = JSON.parse(raw);
79
+ } catch (error) {
80
+ throw new PmCliError(`Checkpoint ${normalizedId} contains invalid JSON: ${toErrorMessage(error)}`, EXIT_CODE.GENERIC_FAILURE);
81
+ }
82
+ if (!parsed || typeof parsed !== "object") {
83
+ throw new PmCliError(`Checkpoint ${normalizedId} is invalid`, EXIT_CODE.GENERIC_FAILURE);
84
+ }
85
+ const record = parsed;
86
+ if (record.schema_version !== schemaVersion) {
87
+ throw new PmCliError(`Checkpoint ${normalizedId} has unsupported schema version`, EXIT_CODE.GENERIC_FAILURE);
88
+ }
89
+ const items = parseCheckpointItems(record, normalizedId);
90
+ return {
91
+ record,
92
+ items,
93
+ path: filePath,
94
+ id: typeof record.id === "string" ? record.id : normalizedId,
95
+ // Defensive recovery for malformed checkpoint metadata; normal writes
96
+ // always include these fields, so fallbacks keep rollback inspectable.
97
+ created_at: typeof record.created_at === "string" ? record.created_at : nowIso(),
98
+ author: typeof record.author === "string" ? record.author : "unknown"
99
+ };
100
+ }
101
+ async function restoreCheckpointItems(items, restore) {
102
+ const rows = [];
103
+ const restoredIds = [];
104
+ for (const entry of items) {
105
+ try {
106
+ const restored = await restore(entry.id, entry.target_updated_at);
107
+ rows.push({
108
+ id: entry.id,
109
+ status: "restored",
110
+ changed_fields: restored.changed_fields,
111
+ warnings: restored.warnings
112
+ });
113
+ restoredIds.push(entry.id);
114
+ } catch (error) {
115
+ rows.push({ id: entry.id, status: "failed", error: toErrorMessage(error) });
116
+ }
117
+ }
118
+ return {
119
+ rows,
120
+ restored_ids: restoredIds,
121
+ failed_count: rows.filter((row) => row.status === "failed").length
122
+ };
123
+ }
124
+
125
+ export {
126
+ createCheckpointId,
127
+ writeMutationCheckpoint,
128
+ loadMutationCheckpoint,
129
+ restoreCheckpointItems
130
+ };
131
+ //# sourceMappingURL=chunk-TQ3ZK6VD.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../../core/checkpoint/mutation-checkpoint.ts"],
4
+ "sourcesContent": ["import { mkdir, readFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { pathExists, writeFileAtomic } from \"../fs/fs-utils.js\";\nimport { EXIT_CODE } from \"../shared/constants.js\";\nimport { PmCliError } from \"../shared/errors.js\";\nimport { toErrorMessage } from \"../shared/primitives.js\";\nimport { nowIso } from \"../shared/time.js\";\n\n// Shared checkpoint + rollback machinery for bulk-mutation commands\n// (`update-many`, `close-many`). Each command owns its own checkpoint payload\n// shape (the extra fields it records) but reuses the common id/path/validation\n// helpers and the restore loop so the durable rollback contract — capture each\n// matched item's pre-mutation updated_at, then restore-to-timestamp on\n// rollback — stays identical across commands and is not duplicated.\n\nexport interface MutationCheckpointItem {\n id: string;\n target_updated_at: string;\n}\n\nexport interface LoadedMutationCheckpoint {\n /** The full on-disk record so callers can read their command-specific fields. */\n record: Record<string, unknown>;\n /** Validated item list (id + target_updated_at). */\n items: MutationCheckpointItem[];\n /** Absolute path the checkpoint was read from. */\n path: string;\n id: string;\n created_at: string;\n author: string;\n}\n\nexport interface CheckpointRollbackRow {\n id: string;\n status: \"restored\" | \"failed\";\n changed_fields?: string[];\n warnings?: string[];\n error?: string;\n}\n\nexport interface CheckpointRollbackResult {\n rows: CheckpointRollbackRow[];\n restored_ids: string[];\n failed_count: number;\n}\n\n/** Restore a single item to its captured pre-mutation timestamp. */\nexport type CheckpointRestoreFn = (\n id: string,\n targetUpdatedAt: string,\n) => Promise<{ changed_fields?: string[]; warnings?: string[] }>;\n\nexport function normalizeCheckpointId(raw: string): string {\n const trimmed = raw.trim();\n if (!trimmed) {\n throw new PmCliError(\"--rollback requires a non-empty checkpoint ID\", EXIT_CODE.USAGE);\n }\n if (!/^[a-zA-Z0-9._-]+$/.test(trimmed)) {\n throw new PmCliError(\"--rollback checkpoint ID must match [a-zA-Z0-9._-]+\", EXIT_CODE.USAGE);\n }\n return trimmed;\n}\n\nexport function createCheckpointId(prefix: string, nowValue: string): string {\n const compactTimestamp = nowValue.replace(/[-:.TZ]/g, \"\").slice(0, 14);\n const randomSuffix = Math.random().toString(36).slice(2, 8);\n return `${prefix}-${compactTimestamp}-${randomSuffix}`;\n}\n\nexport function checkpointDirectoryPath(pmRoot: string, subdir: string): string {\n return path.join(pmRoot, \"checkpoints\", subdir);\n}\n\nexport function checkpointFilePath(pmRoot: string, subdir: string, checkpointId: string): string {\n return path.join(checkpointDirectoryPath(pmRoot, subdir), `${checkpointId}.json`);\n}\n\nexport async function writeMutationCheckpoint(\n pmRoot: string,\n subdir: string,\n checkpointId: string,\n payload: unknown,\n): Promise<string> {\n const checkpointDir = checkpointDirectoryPath(pmRoot, subdir);\n await mkdir(checkpointDir, { recursive: true });\n const filePath = checkpointFilePath(pmRoot, subdir, checkpointId);\n await writeFileAtomic(filePath, `${JSON.stringify(payload, null, 2)}\\n`);\n return filePath;\n}\n\nfunction parseCheckpointItems(record: Record<string, unknown>, checkpointId: string): MutationCheckpointItem[] {\n if (!Array.isArray(record.items)) {\n throw new PmCliError(`Checkpoint ${checkpointId} is missing items`, EXIT_CODE.GENERIC_FAILURE);\n }\n return record.items.map((entry) => {\n if (!entry || typeof entry !== \"object\") {\n throw new PmCliError(`Checkpoint ${checkpointId} contains an invalid item entry`, EXIT_CODE.GENERIC_FAILURE);\n }\n const row = entry as Record<string, unknown>;\n if (typeof row.id !== \"string\" || row.id.trim().length === 0) {\n throw new PmCliError(`Checkpoint ${checkpointId} contains an item entry without ID`, EXIT_CODE.GENERIC_FAILURE);\n }\n if (typeof row.target_updated_at !== \"string\" || row.target_updated_at.trim().length === 0) {\n throw new PmCliError(\n `Checkpoint ${checkpointId} contains an item entry without target_updated_at`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n return { id: row.id.trim(), target_updated_at: row.target_updated_at.trim() };\n });\n}\n\nexport async function loadMutationCheckpoint(\n pmRoot: string,\n subdir: string,\n rawCheckpointId: string,\n schemaVersion: number,\n): Promise<LoadedMutationCheckpoint> {\n const normalizedId = normalizeCheckpointId(rawCheckpointId);\n const filePath = checkpointFilePath(pmRoot, subdir, normalizedId);\n if (!(await pathExists(filePath))) {\n throw new PmCliError(`Checkpoint ${normalizedId} not found`, EXIT_CODE.NOT_FOUND);\n }\n const raw = await readFile(filePath, \"utf8\");\n let parsed: unknown;\n try {\n parsed = JSON.parse(raw) as unknown;\n } catch (error: unknown) {\n throw new PmCliError(\n `Checkpoint ${normalizedId} contains invalid JSON: ${toErrorMessage(error)}`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n if (!parsed || typeof parsed !== \"object\") {\n throw new PmCliError(`Checkpoint ${normalizedId} is invalid`, EXIT_CODE.GENERIC_FAILURE);\n }\n const record = parsed as Record<string, unknown>;\n if (record.schema_version !== schemaVersion) {\n throw new PmCliError(`Checkpoint ${normalizedId} has unsupported schema version`, EXIT_CODE.GENERIC_FAILURE);\n }\n const items = parseCheckpointItems(record, normalizedId);\n return {\n record,\n items,\n path: filePath,\n id: typeof record.id === \"string\" ? record.id : normalizedId,\n // Defensive recovery for malformed checkpoint metadata; normal writes\n // always include these fields, so fallbacks keep rollback inspectable.\n created_at: typeof record.created_at === \"string\" ? record.created_at : nowIso(),\n author: typeof record.author === \"string\" ? record.author : \"unknown\",\n };\n}\n\n/**\n * Restore every checkpointed item to its captured pre-mutation timestamp,\n * collecting per-item rows. A single item's failure is recorded and does not\n * abort the remaining restores.\n */\nexport async function restoreCheckpointItems(\n items: MutationCheckpointItem[],\n restore: CheckpointRestoreFn,\n): Promise<CheckpointRollbackResult> {\n const rows: CheckpointRollbackRow[] = [];\n const restoredIds: string[] = [];\n for (const entry of items) {\n try {\n const restored = await restore(entry.id, entry.target_updated_at);\n rows.push({\n id: entry.id,\n status: \"restored\",\n changed_fields: restored.changed_fields,\n warnings: restored.warnings,\n });\n restoredIds.push(entry.id);\n } catch (error: unknown) {\n rows.push({ id: entry.id, status: \"failed\", error: toErrorMessage(error) });\n }\n }\n return {\n rows,\n restored_ids: restoredIds,\n failed_count: rows.filter((row) => row.status === \"failed\").length,\n };\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;AAAA,SAAS,OAAO,gBAAgB;AAChC,OAAO,UAAU;;;;;;;;AAmDX,SAAU,sBAAsB,KAAW;AAC/C,QAAM,UAAU,IAAI,KAAI;AACxB,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,WAAW,iDAAiD,UAAU,KAAK;EACvF;AACA,MAAI,CAAC,oBAAoB,KAAK,OAAO,GAAG;AACtC,UAAM,IAAI,WAAW,uDAAuD,UAAU,KAAK;EAC7F;AACA,SAAO;AACT;AAEM,SAAU,mBAAmB,QAAgB,UAAgB;AACjE,QAAM,mBAAmB,SAAS,QAAQ,YAAY,EAAE,EAAE,MAAM,GAAG,EAAE;AAC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AE;IAC3B,SAAS,OAAgB;AACvB,WAAK,KAAK,EAAE,IAAI,MAAM,IAAI,QAAQ,UAAU,OAAO,eAAe,KAAK,EAAC,CAAE;IAC5E;EACF;AACA,SAAO;IACL;IACA,cAAc;IACd,cAAc,KAAK,OAAO,CAAC,QAAQ,IAAI,WAAW,QAAQ,EAAE;;AAEhE;",
6
+ "names": []
7
+ }
@@ -0,0 +1,119 @@
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]="f42179ee-4e3f-5e27-b63f-e0c34565a666")}catch(e){}}();
3
+ import {
4
+ parseItemDocument,
5
+ serializeItemDocument
6
+ } from "./chunk-KBG47ZOY.js";
7
+ import {
8
+ TYPE_TO_FOLDER,
9
+ getItemFormatFromPath,
10
+ getItemPath,
11
+ readFileIfExists,
12
+ removeFileIfExists,
13
+ runActiveOnWriteHooks,
14
+ writeFileAtomic
15
+ } from "./chunk-4LTBNUYT.js";
16
+
17
+ // dist/core/store/item-format-migration.js
18
+ import fs from "node:fs/promises";
19
+ import path from "node:path";
20
+ function alternateItemFormat(_targetFormat) {
21
+ return "json_markdown";
22
+ }
23
+ function normalizeRelativePath(pmRoot, absolutePath) {
24
+ return path.relative(pmRoot, absolutePath).replaceAll("\\", "/");
25
+ }
26
+ function errorSummary(error) {
27
+ return String(error).replaceAll(/[^a-zA-Z0-9._-]+/g, "_").slice(0, 120);
28
+ }
29
+ async function migrateItemFilesToFormat(pmRoot, targetFormat, op = "item_format:migrate", typeToFolder = TYPE_TO_FOLDER, schema) {
30
+ if (targetFormat !== "toon") {
31
+ throw new Error("Only toon item-format migration targets are supported. Markdown item files are legacy read-only input.");
32
+ }
33
+ const migratedIds = /* @__PURE__ */ new Set();
34
+ const removedPaths = /* @__PURE__ */ new Set();
35
+ const warnings = [];
36
+ let scanned = 0;
37
+ const alternateFormat = alternateItemFormat(targetFormat);
38
+ const typeEntries = Object.entries(typeToFolder);
39
+ for (const [itemType, folder] of typeEntries) {
40
+ const directoryPath = path.join(pmRoot, folder);
41
+ let files = [];
42
+ try {
43
+ files = await fs.readdir(directoryPath);
44
+ } catch {
45
+ continue;
46
+ }
47
+ const variantsById = /* @__PURE__ */ new Map();
48
+ for (const file of files) {
49
+ const absolutePath = path.join(directoryPath, file);
50
+ const itemFormat = getItemFormatFromPath(absolutePath);
51
+ if (!itemFormat) {
52
+ continue;
53
+ }
54
+ const extension = path.extname(file);
55
+ const itemId = file.slice(0, file.length - extension.length).trim();
56
+ if (itemId.length === 0) {
57
+ continue;
58
+ }
59
+ const entry = variantsById.get(itemId) ?? {};
60
+ entry[itemFormat] = absolutePath;
61
+ variantsById.set(itemId, entry);
62
+ }
63
+ const itemIds = [...variantsById.keys()].sort((left, right) => left.localeCompare(right));
64
+ for (const itemId of itemIds) {
65
+ const variants = variantsById.get(itemId);
66
+ scanned += 1;
67
+ const alternatePath = variants[alternateFormat];
68
+ if (!alternatePath) {
69
+ continue;
70
+ }
71
+ const sourcePath = variants[targetFormat] ?? alternatePath;
72
+ const sourceFormat = sourcePath === variants[targetFormat] ? targetFormat : alternateFormat;
73
+ try {
74
+ const sourceRaw = await fs.readFile(sourcePath, "utf8");
75
+ const parsedDocument = parseItemDocument(sourceRaw, {
76
+ format: sourceFormat,
77
+ schema,
78
+ onWarning: (warning) => warnings.push(`item_format_migration_parse_warning:${itemId}:${warning}`)
79
+ });
80
+ const targetPath = getItemPath(pmRoot, itemType, itemId, targetFormat, typeToFolder);
81
+ const serializedTarget = serializeItemDocument(parsedDocument, { format: targetFormat, schema });
82
+ const existingTargetRaw = await readFileIfExists(targetPath);
83
+ if (existingTargetRaw !== serializedTarget) {
84
+ await writeFileAtomic(targetPath, serializedTarget);
85
+ warnings.push(...await runActiveOnWriteHooks({
86
+ path: targetPath,
87
+ scope: "project",
88
+ op
89
+ }));
90
+ migratedIds.add(itemId);
91
+ }
92
+ await removeFileIfExists(alternatePath);
93
+ removedPaths.add(normalizeRelativePath(pmRoot, alternatePath));
94
+ warnings.push(...await runActiveOnWriteHooks({
95
+ path: alternatePath,
96
+ scope: "project",
97
+ op: `${op}:remove`
98
+ }));
99
+ migratedIds.add(itemId);
100
+ } catch (error) {
101
+ warnings.push(`item_format_migration_skipped:${normalizeRelativePath(pmRoot, sourcePath)}:${errorSummary(error)}`);
102
+ }
103
+ }
104
+ }
105
+ return {
106
+ target_format: targetFormat,
107
+ scanned,
108
+ migrated: [...migratedIds].sort((left, right) => left.localeCompare(right)),
109
+ removed: [...removedPaths].sort((left, right) => left.localeCompare(right)),
110
+ warnings
111
+ };
112
+ }
113
+
114
+ export {
115
+ migrateItemFilesToFormat
116
+ };
117
+ //# sourceMappingURL=chunk-UFCG3SWR.js.map
118
+
119
+ //# debugId=f42179ee-4e3f-5e27-b63f-e0c34565a666
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../core/store/item-format-migration.ts"],"sourcesContent":["import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { runActiveOnWriteHooks } from \"../extensions/index.js\";\nimport { readFileIfExists, removeFileIfExists, writeFileAtomic } from \"../fs/fs-utils.js\";\nimport { parseItemDocument, serializeItemDocument } from \"../item/item-format.js\";\nimport { TYPE_TO_FOLDER } from \"../shared/constants.js\";\nimport { getItemFormatFromPath, getItemPath } from \"./paths.js\";\nimport type { ItemFormat, ItemType, RuntimeSchemaSettings } from \"../../types/index.js\";\n\ninterface ItemPathVariants {\n json_markdown?: string;\n toon?: string;\n}\n\nexport interface ItemFormatMigrationResult {\n target_format: ItemFormat;\n scanned: number;\n migrated: string[];\n removed: string[];\n warnings: string[];\n}\n\nfunction alternateItemFormat(_targetFormat: ItemFormat): ItemFormat {\n return \"json_markdown\";\n}\n\nfunction normalizeRelativePath(pmRoot: string, absolutePath: string): string {\n return path.relative(pmRoot, absolutePath).replaceAll(\"\\\\\", \"/\");\n}\n\nfunction errorSummary(error: unknown): string {\n return String(error).replaceAll(/[^a-zA-Z0-9._-]+/g, \"_\").slice(0, 120);\n}\n\nexport async function migrateItemFilesToFormat(\n pmRoot: string,\n targetFormat: ItemFormat,\n op = \"item_format:migrate\",\n typeToFolder: Record<string, string> = TYPE_TO_FOLDER,\n schema?: RuntimeSchemaSettings,\n): Promise<ItemFormatMigrationResult> {\n if (targetFormat !== \"toon\") {\n throw new Error(\"Only toon item-format migration targets are supported. Markdown item files are legacy read-only input.\");\n }\n const migratedIds = new Set<string>();\n const removedPaths = new Set<string>();\n const warnings: string[] = [];\n let scanned = 0;\n const alternateFormat = alternateItemFormat(targetFormat);\n const typeEntries = Object.entries(typeToFolder) as Array<[ItemType, string]>;\n\n for (const [itemType, folder] of typeEntries) {\n const directoryPath = path.join(pmRoot, folder);\n let files: string[] = [];\n try {\n files = await fs.readdir(directoryPath);\n } catch {\n continue;\n }\n\n const variantsById = new Map<string, ItemPathVariants>();\n for (const file of files) {\n const absolutePath = path.join(directoryPath, file);\n const itemFormat = getItemFormatFromPath(absolutePath);\n if (!itemFormat) {\n continue;\n }\n const extension = path.extname(file);\n const itemId = file.slice(0, file.length - extension.length).trim();\n if (itemId.length === 0) {\n continue;\n }\n const entry = variantsById.get(itemId) ?? {};\n entry[itemFormat] = absolutePath;\n variantsById.set(itemId, entry);\n }\n\n const itemIds = [...variantsById.keys()].sort((left, right) => left.localeCompare(right));\n for (const itemId of itemIds) {\n const variants = variantsById.get(itemId) as ItemPathVariants;\n scanned += 1;\n // Items already present only in the target format need no migration: there\n // is no legacy alternate-format file to convert or remove. Skip the\n // read/parse/serialize/compare round-trip for them. This is the dominant\n // cost of the pre-mutation format sync, which runs on every mutation and\n // would otherwise re-parse the entire corpus (O(items)) each time.\n const alternatePath = variants[alternateFormat];\n if (!alternatePath) {\n continue;\n }\n const sourcePath = variants[targetFormat] ?? alternatePath;\n const sourceFormat = sourcePath === variants[targetFormat] ? targetFormat : alternateFormat;\n try {\n const sourceRaw = await fs.readFile(sourcePath, \"utf8\");\n const parsedDocument = parseItemDocument(sourceRaw, {\n format: sourceFormat,\n schema,\n onWarning: (warning) => warnings.push(`item_format_migration_parse_warning:${itemId}:${warning}`),\n });\n const targetPath = getItemPath(pmRoot, itemType, itemId, targetFormat, typeToFolder);\n const serializedTarget = serializeItemDocument(parsedDocument, { format: targetFormat, schema });\n const existingTargetRaw = await readFileIfExists(targetPath);\n if (existingTargetRaw !== serializedTarget) {\n await writeFileAtomic(targetPath, serializedTarget);\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: targetPath,\n scope: \"project\",\n op,\n })),\n );\n migratedIds.add(itemId);\n }\n\n // The legacy alternate (.md) was enumerated from disk above and is always\n // a distinct path from the .toon target, so once the parse succeeds we\n // remove it unconditionally. removeFileIfExists tolerates a concurrently\n // removed file, so no pre-check is needed.\n await removeFileIfExists(alternatePath);\n removedPaths.add(normalizeRelativePath(pmRoot, alternatePath));\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: alternatePath,\n scope: \"project\",\n op: `${op}:remove`,\n })),\n );\n migratedIds.add(itemId);\n } catch (error) {\n warnings.push(\n `item_format_migration_skipped:${normalizeRelativePath(pmRoot, sourcePath)}:${errorSummary(error)}`,\n );\n }\n }\n }\n\n return {\n target_format: targetFormat,\n scanned,\n migrated: [...migratedIds].sort((left, right) => left.localeCompare(right)),\n removed: [...removedPaths].sort((left, right) => left.localeCompare(right)),\n warnings,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AAqBjB,SAAS,oBAAoB,eAAyB;AACpD,SAAO;AACT;AAEA,SAAS,sBAAsB,QAAgB,cAAoB;AACjE,SAAO,KAAK,SAAS,QAAQ,YAAY,EAAE,WAAW,MAAM,GAAG;AACjE;AAEA,SAAS,aAAa,OAAc;AAClC,SAAO,OAAO,KAAK,EAAE,WAAW,qBAAqB,GAAG,EAAE,MAAM,GAAG,GAAG;A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