@unbrained/pm-cli 2026.6.24 → 2026.7.1

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 (744) hide show
  1. package/AGENTS.md +2 -0
  2. package/CHANGELOG.md +113 -1
  3. package/CONTRIBUTING.md +30 -0
  4. package/README.md +16 -3
  5. package/dist/cli/bootstrap-args.js +89 -79
  6. package/dist/cli/bootstrap-args.js.map +1 -1
  7. package/dist/cli/commander-usage.js +3 -3
  8. package/dist/cli/commander-usage.js.map +1 -1
  9. package/dist/cli/commands/aggregate.js +8 -7
  10. package/dist/cli/commands/aggregate.js.map +1 -1
  11. package/dist/cli/commands/calendar.js +63 -62
  12. package/dist/cli/commands/calendar.js.map +1 -1
  13. package/dist/cli/commands/close.d.ts +2 -4
  14. package/dist/cli/commands/close.js +5 -17
  15. package/dist/cli/commands/close.js.map +1 -1
  16. package/dist/cli/commands/completion.js +158 -9
  17. package/dist/cli/commands/completion.js.map +1 -1
  18. package/dist/cli/commands/config.d.ts +1 -1
  19. package/dist/cli/commands/config.js +2 -2
  20. package/dist/cli/commands/config.js.map +1 -1
  21. package/dist/cli/commands/context.d.ts +31 -4
  22. package/dist/cli/commands/context.js +33 -10
  23. package/dist/cli/commands/context.js.map +1 -1
  24. package/dist/cli/commands/contracts.js +48 -8
  25. package/dist/cli/commands/contracts.js.map +1 -1
  26. package/dist/cli/commands/create.d.ts +1 -6
  27. package/dist/cli/commands/create.js +491 -587
  28. package/dist/cli/commands/create.js.map +1 -1
  29. package/dist/cli/commands/extension/bundled-catalog.js +59 -46
  30. package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
  31. package/dist/cli/commands/extension/describe.d.ts +15 -0
  32. package/dist/cli/commands/extension/describe.js +48 -2
  33. package/dist/cli/commands/extension/describe.js.map +1 -1
  34. package/dist/cli/commands/extension/doctor.js +129 -75
  35. package/dist/cli/commands/extension/doctor.js.map +1 -1
  36. package/dist/cli/commands/extension/install-sources.js +37 -7
  37. package/dist/cli/commands/extension/install-sources.js.map +1 -1
  38. package/dist/cli/commands/extension/managed-state.js +101 -57
  39. package/dist/cli/commands/extension/managed-state.js.map +1 -1
  40. package/dist/cli/commands/extension/scaffold.d.ts +38 -8
  41. package/dist/cli/commands/extension/scaffold.js +1956 -242
  42. package/dist/cli/commands/extension/scaffold.js.map +1 -1
  43. package/dist/cli/commands/extension.d.ts +28 -3
  44. package/dist/cli/commands/extension.js +1181 -880
  45. package/dist/cli/commands/extension.js.map +1 -1
  46. package/dist/cli/commands/index.d.ts +3 -1
  47. package/dist/cli/commands/index.js +5 -3
  48. package/dist/cli/commands/index.js.map +1 -1
  49. package/dist/cli/commands/item-filter-options.d.ts +63 -0
  50. package/dist/cli/commands/item-filter-options.js +10 -0
  51. package/dist/cli/commands/item-filter-options.js.map +1 -0
  52. package/dist/cli/commands/legacy-none-tokens.d.ts +14 -0
  53. package/dist/cli/commands/legacy-none-tokens.js +31 -2
  54. package/dist/cli/commands/legacy-none-tokens.js.map +1 -1
  55. package/dist/cli/commands/linked-artifacts.d.ts +7 -0
  56. package/dist/cli/commands/linked-artifacts.js +12 -2
  57. package/dist/cli/commands/linked-artifacts.js.map +1 -1
  58. package/dist/cli/commands/list-filter-shared.js +55 -48
  59. package/dist/cli/commands/list-filter-shared.js.map +1 -1
  60. package/dist/cli/commands/list.d.ts +16 -39
  61. package/dist/cli/commands/list.js +127 -118
  62. package/dist/cli/commands/list.js.map +1 -1
  63. package/dist/cli/commands/next.d.ts +98 -0
  64. package/dist/cli/commands/next.js +304 -0
  65. package/dist/cli/commands/next.js.map +1 -0
  66. package/dist/cli/commands/profile.d.ts +208 -0
  67. package/dist/cli/commands/profile.js +418 -0
  68. package/dist/cli/commands/profile.js.map +1 -0
  69. package/dist/cli/commands/repeatable-metadata-parsers.js +12 -13
  70. package/dist/cli/commands/repeatable-metadata-parsers.js.map +1 -1
  71. package/dist/cli/commands/schema.d.ts +7 -0
  72. package/dist/cli/commands/schema.js +9 -3
  73. package/dist/cli/commands/schema.js.map +1 -1
  74. package/dist/cli/commands/search.d.ts +2 -39
  75. package/dist/cli/commands/search.js +196 -172
  76. package/dist/cli/commands/search.js.map +1 -1
  77. package/dist/cli/commands/shared-unset-fields.d.ts +30 -0
  78. package/dist/cli/commands/shared-unset-fields.js +161 -0
  79. package/dist/cli/commands/shared-unset-fields.js.map +1 -0
  80. package/dist/cli/commands/stats.js +15 -3
  81. package/dist/cli/commands/stats.js.map +1 -1
  82. package/dist/cli/commands/test.js +115 -125
  83. package/dist/cli/commands/test.js.map +1 -1
  84. package/dist/cli/commands/update.d.ts +1 -6
  85. package/dist/cli/commands/update.js +37 -232
  86. package/dist/cli/commands/update.js.map +1 -1
  87. package/dist/cli/commands/validate.js +20 -5
  88. package/dist/cli/commands/validate.js.map +1 -1
  89. package/dist/cli/extension-command-options.js +48 -21
  90. package/dist/cli/extension-command-options.js.map +1 -1
  91. package/dist/cli/help-content.js +26 -2
  92. package/dist/cli/help-content.js.map +1 -1
  93. package/dist/cli/help-json-payload.js +3 -3
  94. package/dist/cli/help-json-payload.js.map +1 -1
  95. package/dist/cli/main.js +27 -12
  96. package/dist/cli/main.js.map +1 -1
  97. package/dist/cli/register-list-query.js +42 -3
  98. package/dist/cli/register-list-query.js.map +1 -1
  99. package/dist/cli/register-mutation.js +86 -2
  100. package/dist/cli/register-mutation.js.map +1 -1
  101. package/dist/cli/register-setup.js +67 -6
  102. package/dist/cli/register-setup.js.map +1 -1
  103. package/dist/cli/registration-helpers.d.ts +9 -1
  104. package/dist/cli/registration-helpers.js +149 -123
  105. package/dist/cli/registration-helpers.js.map +1 -1
  106. package/dist/cli-bundle/chunks/activity-AW6XVFH6.js +16 -0
  107. package/dist/cli-bundle/chunks/{activity-N7RVTLBQ.js → activity-DBLQVIP6.js} +9 -11
  108. package/dist/cli-bundle/chunks/{aggregate-63NWNIBR.js → aggregate-JTEF4BP7.js} +17 -18
  109. package/dist/cli-bundle/chunks/aggregate-JTEF4BP7.js.map +1 -0
  110. package/dist/cli-bundle/chunks/{aggregate-YHCYX2EV.js → aggregate-SDF7DUOD.js} +16 -17
  111. package/dist/cli-bundle/chunks/aggregate-SDF7DUOD.js.map +7 -0
  112. package/dist/cli-bundle/chunks/{append-VLQQDHMJ.js → append-LOVPGVPT.js} +8 -10
  113. package/dist/cli-bundle/chunks/{append-VLQQDHMJ.js.map → append-LOVPGVPT.js.map} +1 -1
  114. package/dist/cli-bundle/chunks/{append-PUKREFV5.js → append-QCFJSDFL.js} +10 -12
  115. package/dist/cli-bundle/chunks/{append-PUKREFV5.js.map → append-QCFJSDFL.js.map} +1 -1
  116. package/dist/cli-bundle/chunks/{chunk-ABYCA5VX.js → chunk-22WKIL3H.js} +9 -11
  117. package/dist/cli-bundle/chunks/{chunk-ABYCA5VX.js.map → chunk-22WKIL3H.js.map} +1 -1
  118. package/dist/cli-bundle/chunks/{chunk-A66VYUOV.js → chunk-2466X6E4.js} +9 -11
  119. package/dist/cli-bundle/chunks/{chunk-A66VYUOV.js.map → chunk-2466X6E4.js.map} +1 -1
  120. package/dist/cli-bundle/chunks/{chunk-F32L4HR6.js → chunk-27BXPBAY.js} +3 -3
  121. package/dist/cli-bundle/chunks/{schema-QO5I4FBL.js → chunk-2D4HATP2.js} +136 -66
  122. package/dist/cli-bundle/chunks/chunk-2D4HATP2.js.map +1 -0
  123. package/dist/cli-bundle/chunks/{chunk-J7I4C5ZB.js → chunk-3J6JRJ3I.js} +153 -125
  124. package/dist/cli-bundle/chunks/chunk-3J6JRJ3I.js.map +7 -0
  125. package/dist/cli-bundle/chunks/{chunk-OHDQNKJB.js → chunk-3K2M5OYU.js} +106 -34
  126. package/dist/cli-bundle/chunks/chunk-3K2M5OYU.js.map +7 -0
  127. package/dist/cli-bundle/chunks/{chunk-XVYKWZNL.js → chunk-3S2KT7NG.js} +127 -127
  128. package/dist/cli-bundle/chunks/chunk-3S2KT7NG.js.map +7 -0
  129. package/dist/cli-bundle/chunks/{chunk-5BBEWX6C.js → chunk-3VGN2UWE.js} +2 -2
  130. package/dist/cli-bundle/chunks/{chunk-N5B6WZC5.js → chunk-3XZCOZ5J.js} +115 -123
  131. package/dist/cli-bundle/chunks/chunk-3XZCOZ5J.js.map +1 -0
  132. package/dist/cli-bundle/chunks/chunk-4A3BJ675.js +799 -0
  133. package/dist/cli-bundle/chunks/chunk-4A3BJ675.js.map +1 -0
  134. package/dist/cli-bundle/chunks/chunk-4BU75MF4.js +87 -0
  135. package/dist/cli-bundle/chunks/chunk-4BU75MF4.js.map +7 -0
  136. package/dist/cli-bundle/chunks/{chunk-HZF5RLKX.js → chunk-4DSGXSBL.js} +5 -7
  137. package/dist/cli-bundle/chunks/{chunk-HZF5RLKX.js.map → chunk-4DSGXSBL.js.map} +1 -1
  138. package/dist/cli-bundle/chunks/{chunk-JV27C7OZ.js → chunk-4DUVCVLZ.js} +4 -6
  139. package/dist/cli-bundle/chunks/{chunk-JV27C7OZ.js.map → chunk-4DUVCVLZ.js.map} +1 -1
  140. package/dist/cli-bundle/chunks/{chunk-IAP5KYBQ.js → chunk-4XOIEKSD.js} +563 -506
  141. package/dist/cli-bundle/chunks/chunk-4XOIEKSD.js.map +1 -0
  142. package/dist/cli-bundle/chunks/{context-5LB7UGKE.js → chunk-55SNVXRQ.js} +79 -82
  143. package/dist/cli-bundle/chunks/chunk-55SNVXRQ.js.map +7 -0
  144. package/dist/cli-bundle/chunks/{chunk-BFFO3AIB.js → chunk-5CGRF3L5.js} +128 -128
  145. package/dist/cli-bundle/chunks/chunk-5CGRF3L5.js.map +1 -0
  146. package/dist/cli-bundle/chunks/{chunk-JKL6HRMV.js → chunk-5QFDBI4F.js} +1260 -1046
  147. package/dist/cli-bundle/chunks/chunk-5QFDBI4F.js.map +7 -0
  148. package/dist/cli-bundle/chunks/{chunk-LU36E6GU.js → chunk-64HNBBFQ.js} +8 -12
  149. package/dist/cli-bundle/chunks/{chunk-LU36E6GU.js.map → chunk-64HNBBFQ.js.map} +1 -1
  150. package/dist/cli-bundle/chunks/chunk-6AQZPVHQ.js +2444 -0
  151. package/dist/cli-bundle/chunks/chunk-6AQZPVHQ.js.map +1 -0
  152. package/dist/cli-bundle/chunks/chunk-7M2HAZEB.js +17 -0
  153. package/dist/cli-bundle/chunks/chunk-7M2HAZEB.js.map +7 -0
  154. package/dist/cli-bundle/chunks/{chunk-VSAABFGQ.js → chunk-7R4QEMZZ.js} +1490 -734
  155. package/dist/cli-bundle/chunks/chunk-7R4QEMZZ.js.map +1 -0
  156. package/dist/cli-bundle/chunks/{chunk-M6TUBOGW.js → chunk-A7FPBAQS.js} +19 -12
  157. package/dist/cli-bundle/chunks/chunk-A7FPBAQS.js.map +1 -0
  158. package/dist/cli-bundle/chunks/{chunk-GQYJEEFX.js → chunk-AVEE5EHK.js} +53 -54
  159. package/dist/cli-bundle/chunks/chunk-AVEE5EHK.js.map +1 -0
  160. package/dist/cli-bundle/chunks/{chunk-FMWW2JDU.js → chunk-AXIDKKAT.js} +2 -2
  161. package/dist/cli-bundle/chunks/{chunk-TIM4OD74.js → chunk-BDTISOSD.js} +2 -2
  162. package/dist/cli-bundle/chunks/{chunk-C4C3EJCJ.js → chunk-BHO33VBQ.js} +509 -363
  163. package/dist/cli-bundle/chunks/chunk-BHO33VBQ.js.map +7 -0
  164. package/dist/cli-bundle/chunks/{chunk-6W3Y65PL.js → chunk-BZCEN4JA.js} +198 -177
  165. package/dist/cli-bundle/chunks/chunk-BZCEN4JA.js.map +7 -0
  166. package/dist/cli-bundle/chunks/{chunk-RRP6D345.js → chunk-CF7RL6FR.js} +12 -16
  167. package/dist/cli-bundle/chunks/{chunk-RRP6D345.js.map → chunk-CF7RL6FR.js.map} +1 -1
  168. package/dist/cli-bundle/chunks/{chunk-HC2S36NB.js → chunk-CWFNTKQJ.js} +154 -126
  169. package/dist/cli-bundle/chunks/chunk-CWFNTKQJ.js.map +1 -0
  170. package/dist/cli-bundle/chunks/chunk-CZVISY5A.js +87 -0
  171. package/dist/cli-bundle/chunks/chunk-CZVISY5A.js.map +7 -0
  172. package/dist/cli-bundle/chunks/{chunk-CZIFFMZI.js → chunk-DDPTYJIM.js} +2 -2
  173. package/dist/cli-bundle/chunks/{chunk-AYPQUFCX.js → chunk-EJUDVUYZ.js} +3 -3
  174. package/dist/cli-bundle/chunks/{chunk-EOGBMLCE.js → chunk-EVMTBV6V.js} +3 -3
  175. package/dist/cli-bundle/chunks/{chunk-RAWA3Y7O.js → chunk-FFMQB7WR.js} +199 -178
  176. package/dist/cli-bundle/chunks/chunk-FFMQB7WR.js.map +1 -0
  177. package/dist/cli-bundle/chunks/{chunk-CG3KP6I5.js → chunk-G7I7DEZA.js} +4 -4
  178. package/dist/cli-bundle/chunks/{chunk-MEXZ5XUM.js → chunk-GJ326ZKX.js} +53 -54
  179. package/dist/cli-bundle/chunks/chunk-GJ326ZKX.js.map +7 -0
  180. package/dist/cli-bundle/chunks/chunk-HPPFYYOV.js +119 -0
  181. package/dist/cli-bundle/chunks/chunk-HPPFYYOV.js.map +7 -0
  182. package/dist/cli-bundle/chunks/{chunk-OF7V47P3.js → chunk-HXTQJXWT.js} +2172 -2146
  183. package/dist/cli-bundle/chunks/chunk-HXTQJXWT.js.map +1 -0
  184. package/dist/cli-bundle/chunks/{chunk-F4BNR2IN.js → chunk-HYTGA6GI.js} +3 -3
  185. package/dist/cli-bundle/chunks/{chunk-2WCYE3IF.js → chunk-HZZEHPRG.js} +2 -2
  186. package/dist/cli-bundle/chunks/chunk-IBMFIKVS.js +14 -0
  187. package/dist/cli-bundle/chunks/chunk-IBMFIKVS.js.map +1 -0
  188. package/dist/cli-bundle/chunks/{chunk-YV2OSAMS.js → chunk-IJYK2T43.js} +2 -2
  189. package/dist/cli-bundle/chunks/{chunk-4XDGYFHL.js → chunk-IPYBJWTE.js} +10 -14
  190. package/dist/cli-bundle/chunks/{chunk-4XDGYFHL.js.map → chunk-IPYBJWTE.js.map} +1 -1
  191. package/dist/cli-bundle/chunks/{chunk-6EBNFQOR.js → chunk-IZBR4NRW.js} +10 -14
  192. package/dist/cli-bundle/chunks/{chunk-6EBNFQOR.js.map → chunk-IZBR4NRW.js.map} +1 -1
  193. package/dist/cli-bundle/chunks/{chunk-VFJYVXHL.js → chunk-JLM7BHI7.js} +7 -9
  194. package/dist/cli-bundle/chunks/{chunk-VFJYVXHL.js.map → chunk-JLM7BHI7.js.map} +1 -1
  195. package/dist/cli-bundle/chunks/{chunk-6EL7SW5C.js → chunk-JMP4E6D7.js} +114 -122
  196. package/dist/cli-bundle/chunks/chunk-JMP4E6D7.js.map +7 -0
  197. package/dist/cli-bundle/chunks/{chunk-QOUOMPHO.js → chunk-JPECA746.js} +2 -2
  198. package/dist/cli-bundle/chunks/{chunk-KJZOSF7J.js → chunk-JSU5P7VS.js} +100 -35
  199. package/dist/cli-bundle/chunks/chunk-JSU5P7VS.js.map +1 -0
  200. package/dist/cli-bundle/chunks/{context-55VEOYI3.js → chunk-JWXRETDF.js} +79 -82
  201. package/dist/cli-bundle/chunks/chunk-JWXRETDF.js.map +1 -0
  202. package/dist/cli-bundle/chunks/{chunk-OQ2E64FH.js → chunk-KNPEF7QG.js} +4 -4
  203. package/dist/cli-bundle/chunks/{chunk-3BKH2CL3.js → chunk-L5OEFZQG.js} +3 -3
  204. package/dist/cli-bundle/chunks/{chunk-DTABLLVE.js → chunk-LB6TP6MC.js} +5 -7
  205. package/dist/cli-bundle/chunks/{chunk-DTABLLVE.js.map → chunk-LB6TP6MC.js.map} +2 -2
  206. package/dist/cli-bundle/chunks/{chunk-TSI32UEL.js → chunk-MAUKX7JC.js} +6 -8
  207. package/dist/cli-bundle/chunks/{chunk-TSI32UEL.js.map → chunk-MAUKX7JC.js.map} +1 -1
  208. package/dist/cli-bundle/chunks/{chunk-SMXSDY7J.js → chunk-MDPEOIGN.js} +2221 -2172
  209. package/dist/cli-bundle/chunks/chunk-MDPEOIGN.js.map +7 -0
  210. package/dist/cli-bundle/chunks/{chunk-5S4ZGDB2.js → chunk-N74UMG5H.js} +2 -2
  211. package/dist/cli-bundle/chunks/{chunk-IXAZI443.js → chunk-NFDPYAIP.js} +2 -2
  212. package/dist/cli-bundle/chunks/{chunk-SKC4UTRP.js → chunk-NKZAN7BD.js} +3 -3
  213. package/dist/cli-bundle/chunks/chunk-NOLPZMSV.js +116 -0
  214. package/dist/cli-bundle/chunks/chunk-NOLPZMSV.js.map +1 -0
  215. package/dist/cli-bundle/chunks/{chunk-L7UXKP2I.js → chunk-NU2UEROZ.js} +1257 -1029
  216. package/dist/cli-bundle/chunks/chunk-NU2UEROZ.js.map +1 -0
  217. package/dist/cli-bundle/chunks/{chunk-HBAEFWX3.js → chunk-NUHHPVVS.js} +65 -335
  218. package/dist/cli-bundle/chunks/chunk-NUHHPVVS.js.map +7 -0
  219. package/dist/cli-bundle/chunks/{chunk-JPJDP4VU.js → chunk-NWMZWYYB.js} +2 -2
  220. package/dist/cli-bundle/chunks/{chunk-MWMHZOZZ.js → chunk-OGXLACHC.js} +10 -14
  221. package/dist/cli-bundle/chunks/{chunk-MWMHZOZZ.js.map → chunk-OGXLACHC.js.map} +1 -1
  222. package/dist/cli-bundle/chunks/chunk-OKQ22KTH.js +379 -0
  223. package/dist/cli-bundle/chunks/chunk-OKQ22KTH.js.map +1 -0
  224. package/dist/cli-bundle/chunks/{chunk-KKX4Z2SE.js → chunk-OTUHB4HS.js} +4 -4
  225. package/dist/cli-bundle/chunks/{chunk-ZLWRPBOW.js → chunk-QCWF6IYD.js} +510 -364
  226. package/dist/cli-bundle/chunks/chunk-QCWF6IYD.js.map +1 -0
  227. package/dist/cli-bundle/chunks/{chunk-PRVTGX64.js → chunk-RGEMWD6Q.js} +11 -23
  228. package/dist/cli-bundle/chunks/chunk-RGEMWD6Q.js.map +7 -0
  229. package/dist/cli-bundle/chunks/chunk-RH5ZBYFD.js +809 -0
  230. package/dist/cli-bundle/chunks/chunk-RH5ZBYFD.js.map +7 -0
  231. package/dist/cli-bundle/chunks/{chunk-ALQKV6U7.js → chunk-RLDHZHQS.js} +12 -16
  232. package/dist/cli-bundle/chunks/{chunk-ALQKV6U7.js.map → chunk-RLDHZHQS.js.map} +1 -1
  233. package/dist/cli-bundle/chunks/{schema-C6QA367T.js → chunk-RMMQ74TG.js} +144 -67
  234. package/dist/cli-bundle/chunks/chunk-RMMQ74TG.js.map +7 -0
  235. package/dist/cli-bundle/chunks/{chunk-EYPINTFR.js → chunk-RVUALSJF.js} +1516 -753
  236. package/dist/cli-bundle/chunks/chunk-RVUALSJF.js.map +7 -0
  237. package/dist/cli-bundle/chunks/chunk-SDR5J34Q.js +2468 -0
  238. package/dist/cli-bundle/chunks/chunk-SDR5J34Q.js.map +7 -0
  239. package/dist/cli-bundle/chunks/{chunk-WB5BYQMF.js → chunk-SLMUGTK3.js} +4 -4
  240. package/dist/cli-bundle/chunks/{chunk-SUREE24M.js → chunk-TP5Q5ZD3.js} +12 -24
  241. package/dist/cli-bundle/chunks/chunk-TP5Q5ZD3.js.map +1 -0
  242. package/dist/cli-bundle/chunks/{chunk-UACWNBL2.js → chunk-UYUYDGIB.js} +7 -9
  243. package/dist/cli-bundle/chunks/{chunk-UACWNBL2.js.map → chunk-UYUYDGIB.js.map} +1 -1
  244. package/dist/cli-bundle/chunks/{chunk-V4UYNSEM.js → chunk-UZIWVBE6.js} +6 -8
  245. package/dist/cli-bundle/chunks/{chunk-V4UYNSEM.js.map → chunk-UZIWVBE6.js.map} +1 -1
  246. package/dist/cli-bundle/chunks/{chunk-EWRSXOIZ.js → chunk-V3NOKJF2.js} +11 -13
  247. package/dist/cli-bundle/chunks/{chunk-EWRSXOIZ.js.map → chunk-V3NOKJF2.js.map} +1 -1
  248. package/dist/cli-bundle/chunks/{chunk-XXKV4UWE.js → chunk-VARHOHYV.js} +571 -507
  249. package/dist/cli-bundle/chunks/chunk-VARHOHYV.js.map +7 -0
  250. package/dist/cli-bundle/chunks/{chunk-AEACLRVH.js → chunk-VICZWYGZ.js} +18 -11
  251. package/dist/cli-bundle/chunks/chunk-VICZWYGZ.js.map +7 -0
  252. package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js +84 -0
  253. package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js.map +1 -0
  254. package/dist/cli-bundle/chunks/chunk-VZDBVEZR.js +382 -0
  255. package/dist/cli-bundle/chunks/chunk-VZDBVEZR.js.map +7 -0
  256. package/dist/cli-bundle/chunks/{chunk-GDUMGZK3.js → chunk-W4ULYO7Z.js} +11 -13
  257. package/dist/cli-bundle/chunks/{chunk-GDUMGZK3.js.map → chunk-W4ULYO7Z.js.map} +1 -1
  258. package/dist/cli-bundle/chunks/{chunk-I6QMJ2XT.js → chunk-WYDHYJPO.js} +2 -2
  259. package/dist/cli-bundle/chunks/{chunk-ALKFCIIB.js → chunk-YITK2PJ6.js} +9 -11
  260. package/dist/cli-bundle/chunks/{chunk-ALKFCIIB.js.map → chunk-YITK2PJ6.js.map} +1 -1
  261. package/dist/cli-bundle/chunks/chunk-YJIEJRZB.js +84 -0
  262. package/dist/cli-bundle/chunks/chunk-YJIEJRZB.js.map +1 -0
  263. package/dist/cli-bundle/chunks/{chunk-LNEDHJNQ.js → chunk-ZETXE4SE.js} +66 -329
  264. package/dist/cli-bundle/chunks/chunk-ZETXE4SE.js.map +1 -0
  265. package/dist/cli-bundle/chunks/{chunk-KIEAK7YE.js → chunk-ZRP4VG5U.js} +2 -2
  266. package/dist/cli-bundle/chunks/{claim-FZZZCAY6.js → claim-EMQLYPRW.js} +10 -12
  267. package/dist/cli-bundle/chunks/{claim-FZZZCAY6.js.map → claim-EMQLYPRW.js.map} +1 -1
  268. package/dist/cli-bundle/chunks/{claim-XK5QBZE3.js → claim-T3GCKV7C.js} +8 -10
  269. package/dist/cli-bundle/chunks/{claim-XK5QBZE3.js.map → claim-T3GCKV7C.js.map} +1 -1
  270. package/dist/cli-bundle/chunks/close-E6ZZGCJY.js +14 -0
  271. package/dist/cli-bundle/chunks/{close-QHMVWM7M.js → close-TQYAAFJP.js} +7 -8
  272. package/dist/cli-bundle/chunks/{close-many-OIXJE2JZ.js → close-many-BG5QQIDQ.js} +16 -18
  273. package/dist/cli-bundle/chunks/{close-many-OIXJE2JZ.js.map → close-many-BG5QQIDQ.js.map} +1 -1
  274. package/dist/cli-bundle/chunks/{close-many-SUU5BS2C.js → close-many-LDRVEQY2.js} +18 -20
  275. package/dist/cli-bundle/chunks/{close-many-SUU5BS2C.js.map → close-many-LDRVEQY2.js.map} +1 -1
  276. package/dist/cli-bundle/chunks/{comments-5YM62D75.js → comments-QCKR2YY2.js} +11 -13
  277. package/dist/cli-bundle/chunks/{comments-5YM62D75.js.map → comments-QCKR2YY2.js.map} +1 -1
  278. package/dist/cli-bundle/chunks/{comments-RH3IBIRH.js → comments-YUXJRZPQ.js} +9 -11
  279. package/dist/cli-bundle/chunks/{comments-RH3IBIRH.js.map → comments-YUXJRZPQ.js.map} +1 -1
  280. package/dist/cli-bundle/chunks/{config-NCNNWF6R.js → config-DMSU64QO.js} +18 -387
  281. package/dist/cli-bundle/chunks/config-DMSU64QO.js.map +7 -0
  282. package/dist/cli-bundle/chunks/{config-SW3U7XP2.js → config-QH2DICD6.js} +18 -380
  283. package/dist/cli-bundle/chunks/config-QH2DICD6.js.map +1 -0
  284. package/dist/cli-bundle/chunks/context-B6275WPX.js +46 -0
  285. package/dist/cli-bundle/chunks/context-OCZ3FJ4Z.js +42 -0
  286. package/dist/cli-bundle/chunks/{contracts-SY6PDFIK.js → contracts-HN7ABKLP.js} +72 -15
  287. package/dist/cli-bundle/chunks/contracts-HN7ABKLP.js.map +7 -0
  288. package/dist/cli-bundle/chunks/{contracts-JXFGBOYT.js → contracts-W4FZVVD6.js} +72 -15
  289. package/dist/cli-bundle/chunks/contracts-W4FZVVD6.js.map +1 -0
  290. package/dist/cli-bundle/chunks/{copy-N3GE6FYS.js → copy-BTJOSKKT.js} +7 -11
  291. package/dist/cli-bundle/chunks/{copy-N3GE6FYS.js.map → copy-BTJOSKKT.js.map} +1 -1
  292. package/dist/cli-bundle/chunks/{copy-IEDBJOOX.js → copy-DEM4DATS.js} +9 -13
  293. package/dist/cli-bundle/chunks/{copy-IEDBJOOX.js.map → copy-DEM4DATS.js.map} +1 -1
  294. package/dist/cli-bundle/chunks/create-OH3BDGBB.js +28 -0
  295. package/dist/cli-bundle/chunks/{create-O4VONGPG.js → create-RLRJMRTM.js} +12 -14
  296. package/dist/cli-bundle/chunks/{delete-LPEIF7RU.js → delete-BHK7VB2Z.js} +5 -7
  297. package/dist/cli-bundle/chunks/{delete-LPEIF7RU.js.map → delete-BHK7VB2Z.js.map} +1 -1
  298. package/dist/cli-bundle/chunks/{delete-724EQ6OS.js → delete-LSVHAB4Y.js} +7 -9
  299. package/dist/cli-bundle/chunks/{delete-724EQ6OS.js.map → delete-LSVHAB4Y.js.map} +1 -1
  300. package/dist/cli-bundle/chunks/{deps-RSBU4SIU.js → deps-4UDFJRUA.js} +8 -11
  301. package/dist/cli-bundle/chunks/{deps-RSBU4SIU.js.map → deps-4UDFJRUA.js.map} +1 -1
  302. package/dist/cli-bundle/chunks/{deps-T3Y6Y7RT.js → deps-XHYXWEPT.js} +6 -9
  303. package/dist/cli-bundle/chunks/{deps-T3Y6Y7RT.js.map → deps-XHYXWEPT.js.map} +1 -1
  304. package/dist/cli-bundle/chunks/{docs-IFS7HZPP.js → docs-26S44RXU.js} +8 -9
  305. package/dist/cli-bundle/chunks/{docs-IFS7HZPP.js.map → docs-26S44RXU.js.map} +1 -1
  306. package/dist/cli-bundle/chunks/{docs-75ZLCO3G.js → docs-GYZNVS26.js} +10 -11
  307. package/dist/cli-bundle/chunks/{docs-75ZLCO3G.js.map → docs-GYZNVS26.js.map} +1 -1
  308. package/dist/cli-bundle/chunks/{eval-L2KD7W3M.js → eval-PGRVIJQU.js} +12 -14
  309. package/dist/cli-bundle/chunks/{eval-L2KD7W3M.js.map → eval-PGRVIJQU.js.map} +1 -1
  310. package/dist/cli-bundle/chunks/{eval-QGR7JCQO.js → eval-UYF3ZPVO.js} +10 -12
  311. package/dist/cli-bundle/chunks/{eval-QGR7JCQO.js.map → eval-UYF3ZPVO.js.map} +1 -1
  312. package/dist/cli-bundle/chunks/{extension-YQF4CPIR.js → extension-CPSLJQVE.js} +12 -7
  313. package/dist/cli-bundle/chunks/{extension-3JYWJ5K2.js → extension-CXJ6RELI.js} +12 -7
  314. package/dist/cli-bundle/chunks/{files-EPEJMJHQ.js → files-MBNICQFM.js} +9 -11
  315. package/dist/cli-bundle/chunks/{files-EPEJMJHQ.js.map → files-MBNICQFM.js.map} +1 -1
  316. package/dist/cli-bundle/chunks/{files-5BQWDRDT.js → files-NQHEXUZD.js} +11 -13
  317. package/dist/cli-bundle/chunks/{files-5BQWDRDT.js.map → files-NQHEXUZD.js.map} +1 -1
  318. package/dist/cli-bundle/chunks/{focus-RWGKD76E.js → focus-DWYIG7GU.js} +10 -14
  319. package/dist/cli-bundle/chunks/{focus-RWGKD76E.js.map → focus-DWYIG7GU.js.map} +1 -1
  320. package/dist/cli-bundle/chunks/{focus-DQVJAPOE.js → focus-XZW5423D.js} +8 -12
  321. package/dist/cli-bundle/chunks/{focus-DQVJAPOE.js.map → focus-XZW5423D.js.map} +1 -1
  322. package/dist/cli-bundle/chunks/{gc-BEJMQT64.js → gc-7GQYOS2G.js} +3 -3
  323. package/dist/cli-bundle/chunks/{gc-JEFQDJPA.js → gc-LPVMKJQJ.js} +3 -3
  324. package/dist/cli-bundle/chunks/{get-LQG6PEVG.js → get-A7MAOHCU.js} +10 -13
  325. package/dist/cli-bundle/chunks/{get-LQG6PEVG.js.map → get-A7MAOHCU.js.map} +1 -1
  326. package/dist/cli-bundle/chunks/{get-WVN75H42.js → get-DSDEKJ3L.js} +12 -15
  327. package/dist/cli-bundle/chunks/{get-WVN75H42.js.map → get-DSDEKJ3L.js.map} +1 -1
  328. package/dist/cli-bundle/chunks/{health-JJJOY7DJ.js → health-3IPFLKXB.js} +17 -17
  329. package/dist/cli-bundle/chunks/{health-P67NZ6TT.js → health-GZXGBZ36.js} +17 -17
  330. package/dist/cli-bundle/chunks/{history-RUKPKNY7.js → history-NERDJNUB.js} +8 -10
  331. package/dist/cli-bundle/chunks/history-WSZHY3PN.js +18 -0
  332. package/dist/cli-bundle/chunks/{history-compact-NQ7VPRVT.js → history-compact-2WRZ2WK4.js} +11 -14
  333. package/dist/cli-bundle/chunks/{history-compact-NQ7VPRVT.js.map → history-compact-2WRZ2WK4.js.map} +1 -1
  334. package/dist/cli-bundle/chunks/{history-compact-ZAOWR7GD.js → history-compact-HR7BB4LR.js} +13 -16
  335. package/dist/cli-bundle/chunks/{history-compact-ZAOWR7GD.js.map → history-compact-HR7BB4LR.js.map} +1 -1
  336. package/dist/cli-bundle/chunks/history-redact-MP6CH7U5.js +19 -0
  337. package/dist/cli-bundle/chunks/{history-redact-YY4XYVEP.js → history-redact-O3NBCNWC.js} +9 -11
  338. package/dist/cli-bundle/chunks/{history-repair-EHL4ODQY.js → history-repair-LCMOS45X.js} +11 -14
  339. package/dist/cli-bundle/chunks/{history-repair-EHL4ODQY.js.map → history-repair-LCMOS45X.js.map} +1 -1
  340. package/dist/cli-bundle/chunks/{history-repair-YSQH6SY6.js → history-repair-XA3LC4GA.js} +13 -16
  341. package/dist/cli-bundle/chunks/{history-repair-YSQH6SY6.js.map → history-repair-XA3LC4GA.js.map} +1 -1
  342. package/dist/cli-bundle/chunks/{init-HBFGYS66.js → init-64XDLQJB.js} +12 -11
  343. package/dist/cli-bundle/chunks/init-PAX32BJA.js +22 -0
  344. package/dist/cli-bundle/chunks/{learnings-KFQO7GEZ.js → learnings-JR6MA5TI.js} +9 -11
  345. package/dist/cli-bundle/chunks/{learnings-KFQO7GEZ.js.map → learnings-JR6MA5TI.js.map} +1 -1
  346. package/dist/cli-bundle/chunks/{learnings-J555ZFPD.js → learnings-LPKCSJX7.js} +11 -13
  347. package/dist/cli-bundle/chunks/{learnings-J555ZFPD.js.map → learnings-LPKCSJX7.js.map} +1 -1
  348. package/dist/cli-bundle/chunks/{list-C7R33MD5.js → list-DNBJVO3E.js} +10 -10
  349. package/dist/cli-bundle/chunks/{list-DSN6UNFB.js → list-G5Y65VF6.js} +10 -10
  350. package/dist/cli-bundle/chunks/next-BCERKDUR.js +277 -0
  351. package/dist/cli-bundle/chunks/next-BCERKDUR.js.map +7 -0
  352. package/dist/cli-bundle/chunks/next-FYTQF6HG.js +274 -0
  353. package/dist/cli-bundle/chunks/next-FYTQF6HG.js.map +1 -0
  354. package/dist/cli-bundle/chunks/{notes-V4VNIQL4.js → notes-2BMU3VVQ.js} +9 -11
  355. package/dist/cli-bundle/chunks/{notes-V4VNIQL4.js.map → notes-2BMU3VVQ.js.map} +1 -1
  356. package/dist/cli-bundle/chunks/{notes-VYJFN2A3.js → notes-6KTGO2OJ.js} +11 -13
  357. package/dist/cli-bundle/chunks/{notes-VYJFN2A3.js.map → notes-6KTGO2OJ.js.map} +1 -1
  358. package/dist/cli-bundle/chunks/{plan-RBHQ5PO7.js → plan-4WXEQCTN.js} +15 -18
  359. package/dist/cli-bundle/chunks/{plan-RBHQ5PO7.js.map → plan-4WXEQCTN.js.map} +1 -1
  360. package/dist/cli-bundle/chunks/{plan-DHRSVSHR.js → plan-RKZHQVXR.js} +17 -20
  361. package/dist/cli-bundle/chunks/{plan-DHRSVSHR.js.map → plan-RKZHQVXR.js.map} +1 -1
  362. package/dist/cli-bundle/chunks/profile-4OMM32CD.js +1235 -0
  363. package/dist/cli-bundle/chunks/profile-4OMM32CD.js.map +7 -0
  364. package/dist/cli-bundle/chunks/profile-QLER5ENE.js +1197 -0
  365. package/dist/cli-bundle/chunks/profile-QLER5ENE.js.map +1 -0
  366. package/dist/cli-bundle/chunks/{register-list-query-OM3E2KMY.js → register-list-query-7LV46VAU.js} +45 -21
  367. package/dist/cli-bundle/chunks/register-list-query-7LV46VAU.js.map +1 -0
  368. package/dist/cli-bundle/chunks/{register-list-query-CCMHGZTF.js → register-list-query-SNG5PGA4.js} +44 -20
  369. package/dist/cli-bundle/chunks/register-list-query-SNG5PGA4.js.map +7 -0
  370. package/dist/cli-bundle/chunks/{register-mutation-N3CDEGZU.js → register-mutation-ENNDUAZG.js} +106 -40
  371. package/dist/cli-bundle/chunks/register-mutation-ENNDUAZG.js.map +1 -0
  372. package/dist/cli-bundle/chunks/{register-mutation-UXTTWL6N.js → register-mutation-KK7PHYYU.js} +105 -39
  373. package/dist/cli-bundle/chunks/register-mutation-KK7PHYYU.js.map +7 -0
  374. package/dist/cli-bundle/chunks/{register-operations-UDIFMQKD.js → register-operations-C6OWLDSH.js} +32 -34
  375. package/dist/cli-bundle/chunks/{register-operations-UDIFMQKD.js.map → register-operations-C6OWLDSH.js.map} +1 -1
  376. package/dist/cli-bundle/chunks/{register-operations-R2FLOCRI.js → register-operations-HZ6XERQG.js} +30 -32
  377. package/dist/cli-bundle/chunks/{register-operations-R2FLOCRI.js.map → register-operations-HZ6XERQG.js.map} +1 -1
  378. package/dist/cli-bundle/chunks/{register-setup-G5LTSFYK.js → register-setup-P67EMBDJ.js} +68 -25
  379. package/dist/cli-bundle/chunks/register-setup-P67EMBDJ.js.map +1 -0
  380. package/dist/cli-bundle/chunks/{register-setup-TWHKICM2.js → register-setup-ZKJ53RS7.js} +67 -24
  381. package/dist/cli-bundle/chunks/register-setup-ZKJ53RS7.js.map +7 -0
  382. package/dist/cli-bundle/chunks/{restore-LL2WLEDG.js → restore-4MHZFJ2E.js} +9 -11
  383. package/dist/cli-bundle/chunks/restore-YALDGTQR.js +17 -0
  384. package/dist/cli-bundle/chunks/{scheduling-shortcuts-M4H2ZI64.js → scheduling-shortcuts-LB6DOLRL.js} +14 -16
  385. package/dist/cli-bundle/chunks/{scheduling-shortcuts-M4H2ZI64.js.map → scheduling-shortcuts-LB6DOLRL.js.map} +1 -1
  386. package/dist/cli-bundle/chunks/{scheduling-shortcuts-255GI3BU.js → scheduling-shortcuts-UTOYKLXQ.js} +12 -14
  387. package/dist/cli-bundle/chunks/{scheduling-shortcuts-255GI3BU.js.map → scheduling-shortcuts-UTOYKLXQ.js.map} +1 -1
  388. package/dist/cli-bundle/chunks/schema-73HR2OJW.js +75 -0
  389. package/dist/cli-bundle/chunks/schema-U6LJKSIR.js +71 -0
  390. package/dist/cli-bundle/chunks/{search-2EI6EAXH.js → search-AXPXKZER.js} +10 -12
  391. package/dist/cli-bundle/chunks/{search-QBFBLQRO.js → search-KILGT37L.js} +10 -12
  392. package/dist/cli-bundle/chunks/{stats-TKC6CAKB.js → stats-PSYVVTNZ.js} +21 -13
  393. package/dist/cli-bundle/chunks/stats-PSYVVTNZ.js.map +1 -0
  394. package/dist/cli-bundle/chunks/{stats-TCW2SZQG.js → stats-W5KNVJWQ.js} +20 -12
  395. package/dist/cli-bundle/chunks/stats-W5KNVJWQ.js.map +7 -0
  396. package/dist/cli-bundle/chunks/{telemetry-BT2VSWU2.js → telemetry-BZUF6H7G.js} +4 -4
  397. package/dist/cli-bundle/chunks/{telemetry-LQ6FRTUT.js → telemetry-GAHHQTOS.js} +4 -4
  398. package/dist/cli-bundle/chunks/test-ACD52Z3S.js +35 -0
  399. package/dist/cli-bundle/chunks/test-ACD52Z3S.js.map +7 -0
  400. package/dist/cli-bundle/chunks/{test-NV2DRPUS.js → test-PWDIZ255.js} +15 -16
  401. package/dist/cli-bundle/chunks/test-PWDIZ255.js.map +1 -0
  402. package/dist/cli-bundle/chunks/{test-all-DZ76VTPQ.js → test-all-L2MDDUCA.js} +20 -22
  403. package/dist/cli-bundle/chunks/{test-all-DZ76VTPQ.js.map → test-all-L2MDDUCA.js.map} +1 -1
  404. package/dist/cli-bundle/chunks/{test-all-REW67LXT.js → test-all-RBZ6DLU2.js} +18 -20
  405. package/dist/cli-bundle/chunks/{test-all-REW67LXT.js.map → test-all-RBZ6DLU2.js.map} +1 -1
  406. package/dist/cli-bundle/chunks/{test-runs-PX73DMMI.js → test-runs-PLRAZEFW.js} +5 -6
  407. package/dist/cli-bundle/chunks/test-runs-PLRAZEFW.js.map +7 -0
  408. package/dist/cli-bundle/chunks/{test-runs-FQ5WNQLP.js → test-runs-UXIXPDKU.js} +6 -7
  409. package/dist/cli-bundle/chunks/test-runs-UXIXPDKU.js.map +1 -0
  410. package/dist/cli-bundle/chunks/update-AMRSOIWP.js +24 -0
  411. package/dist/cli-bundle/chunks/update-AMRSOIWP.js.map +7 -0
  412. package/dist/cli-bundle/chunks/update-KFX2SIAC.js +28 -0
  413. package/dist/cli-bundle/chunks/update-KFX2SIAC.js.map +1 -0
  414. package/dist/cli-bundle/chunks/{update-many-Q5ZEI64S.js → update-many-RNSBX2TA.js} +35 -36
  415. package/dist/cli-bundle/chunks/{update-many-Q5ZEI64S.js.map → update-many-RNSBX2TA.js.map} +1 -1
  416. package/dist/cli-bundle/chunks/{update-many-2ILP6E4Y.js → update-many-Z5GJS5LC.js} +33 -34
  417. package/dist/cli-bundle/chunks/{update-many-2ILP6E4Y.js.map → update-many-Z5GJS5LC.js.map} +1 -1
  418. package/dist/cli-bundle/chunks/{upgrade-FOZKQTQF.js → upgrade-BRL6KCOJ.js} +13 -8
  419. package/dist/cli-bundle/chunks/{upgrade-FOZKQTQF.js.map → upgrade-BRL6KCOJ.js.map} +1 -1
  420. package/dist/cli-bundle/chunks/{upgrade-DHL74PQH.js → upgrade-HAK6JG2O.js} +11 -6
  421. package/dist/cli-bundle/chunks/{upgrade-DHL74PQH.js.map → upgrade-HAK6JG2O.js.map} +1 -1
  422. package/dist/cli-bundle/chunks/{validate-HYZNIB6W.js → validate-MTUVL5VC.js} +38 -28
  423. package/dist/cli-bundle/chunks/validate-MTUVL5VC.js.map +7 -0
  424. package/dist/cli-bundle/chunks/{validate-54SYJ7QW.js → validate-X5W76YJL.js} +39 -29
  425. package/dist/cli-bundle/chunks/validate-X5W76YJL.js.map +1 -0
  426. package/dist/cli-bundle/main.js +95 -724
  427. package/dist/cli-bundle/main.js.map +4 -4
  428. package/dist/core/config/positional-value.d.ts +2 -0
  429. package/dist/core/config/positional-value.js +2 -2
  430. package/dist/core/config/positional-value.js.map +1 -1
  431. package/dist/core/extensions/activation-summary-markdown.d.ts +71 -0
  432. package/dist/core/extensions/activation-summary-markdown.js +151 -0
  433. package/dist/core/extensions/activation-summary-markdown.js.map +1 -0
  434. package/dist/core/extensions/activation-summary.d.ts +2 -0
  435. package/dist/core/extensions/activation-summary.js +3 -2
  436. package/dist/core/extensions/activation-summary.js.map +1 -1
  437. package/dist/core/extensions/capability-usage.d.ts +1 -1
  438. package/dist/core/extensions/capability-usage.js +4 -3
  439. package/dist/core/extensions/capability-usage.js.map +1 -1
  440. package/dist/core/extensions/extension-policy.d.ts +18 -3
  441. package/dist/core/extensions/extension-policy.js +116 -106
  442. package/dist/core/extensions/extension-policy.js.map +1 -1
  443. package/dist/core/extensions/extension-registries.js +3 -2
  444. package/dist/core/extensions/extension-registries.js.map +1 -1
  445. package/dist/core/extensions/extension-types.d.ts +21 -1
  446. package/dist/core/extensions/extension-types.js +3 -2
  447. package/dist/core/extensions/extension-types.js.map +1 -1
  448. package/dist/core/extensions/loader.js +439 -232
  449. package/dist/core/extensions/loader.js.map +1 -1
  450. package/dist/core/fs/fs-utils.js +27 -2
  451. package/dist/core/fs/fs-utils.js.map +1 -1
  452. package/dist/core/item/actionability.d.ts +57 -0
  453. package/dist/core/item/actionability.js +178 -0
  454. package/dist/core/item/actionability.js.map +1 -0
  455. package/dist/core/item/item-format.js +523 -410
  456. package/dist/core/item/item-format.js.map +1 -1
  457. package/dist/core/item/type-registry.js +18 -45
  458. package/dist/core/item/type-registry.js.map +1 -1
  459. package/dist/core/profile/profile-describe.d.ts +64 -0
  460. package/dist/core/profile/profile-describe.js +83 -0
  461. package/dist/core/profile/profile-describe.js.map +1 -0
  462. package/dist/core/profile/profile-lint.d.ts +53 -0
  463. package/dist/core/profile/profile-lint.js +422 -0
  464. package/dist/core/profile/profile-lint.js.map +1 -0
  465. package/dist/core/profile/profile-plan.d.ts +145 -0
  466. package/dist/core/profile/profile-plan.js +0 -0
  467. package/dist/core/profile/profile-plan.js.map +1 -0
  468. package/dist/core/profile/profile-presets.d.ts +218 -0
  469. package/dist/core/profile/profile-presets.js +325 -0
  470. package/dist/core/profile/profile-presets.js.map +1 -0
  471. package/dist/core/schema/fields-file.js +25 -25
  472. package/dist/core/schema/fields-file.js.map +1 -1
  473. package/dist/core/schema/item-types-file.js +3 -3
  474. package/dist/core/schema/item-types-file.js.map +1 -1
  475. package/dist/core/schema/runtime-schema.js +4 -4
  476. package/dist/core/schema/runtime-schema.js.map +1 -1
  477. package/dist/core/schema/status-defs-file.js +3 -3
  478. package/dist/core/schema/status-defs-file.js.map +1 -1
  479. package/dist/core/shared/serialization.js +83 -62
  480. package/dist/core/shared/serialization.js.map +1 -1
  481. package/dist/core/store/item-store.d.ts +1 -0
  482. package/dist/core/store/item-store.js +16 -8
  483. package/dist/core/store/item-store.js.map +1 -1
  484. package/dist/core/store/paths.js +4 -32
  485. package/dist/core/store/paths.js.map +1 -1
  486. package/dist/core/store/settings.js +14 -14
  487. package/dist/core/store/settings.js.map +1 -1
  488. package/dist/core/telemetry/observability.js +50 -54
  489. package/dist/core/telemetry/observability.js.map +1 -1
  490. package/dist/core/telemetry/runtime.js +11 -2
  491. package/dist/core/telemetry/runtime.js.map +1 -1
  492. package/dist/core/test/background-runs.js +3 -2
  493. package/dist/core/test/background-runs.js.map +1 -1
  494. package/dist/core/validate/linked-artifact-reference.d.ts +24 -0
  495. package/dist/core/validate/linked-artifact-reference.js +41 -0
  496. package/dist/core/validate/linked-artifact-reference.js.map +1 -0
  497. package/dist/mcp/server.js +540 -420
  498. package/dist/mcp/server.js.map +1 -1
  499. package/dist/mcp/tool-definitions.js +33 -2
  500. package/dist/mcp/tool-definitions.js.map +1 -1
  501. package/dist/sdk/cli-contracts/commander-types.d.ts +1 -0
  502. package/dist/sdk/cli-contracts/commander-types.js +15 -2
  503. package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
  504. package/dist/sdk/cli-contracts/enum-contracts.d.ts +3 -3
  505. package/dist/sdk/cli-contracts/enum-contracts.js +6 -2
  506. package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
  507. package/dist/sdk/cli-contracts/flag-contracts.d.ts +149 -0
  508. package/dist/sdk/cli-contracts/flag-contracts.js +1514 -0
  509. package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -0
  510. package/dist/sdk/cli-contracts/string-lists.d.ts +14 -0
  511. package/dist/sdk/cli-contracts/string-lists.js +20 -0
  512. package/dist/sdk/cli-contracts/string-lists.js.map +1 -0
  513. package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +1 -1
  514. package/dist/sdk/cli-contracts/tool-option-contracts.js +51 -109
  515. package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
  516. package/dist/sdk/cli-contracts/tool-parameter-tables.d.ts +17 -0
  517. package/dist/sdk/cli-contracts/tool-parameter-tables.js +54 -5
  518. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  519. package/dist/sdk/cli-contracts/tool-schema.d.ts +74 -0
  520. package/dist/sdk/cli-contracts/tool-schema.js +871 -0
  521. package/dist/sdk/cli-contracts/tool-schema.js.map +1 -0
  522. package/dist/sdk/cli-contracts.d.ts +13 -193
  523. package/dist/sdk/cli-contracts.js +5 -2277
  524. package/dist/sdk/cli-contracts.js.map +1 -1
  525. package/dist/sdk/compose.d.ts +11 -5
  526. package/dist/sdk/compose.js +240 -124
  527. package/dist/sdk/compose.js.map +1 -1
  528. package/dist/sdk/define.d.ts +14 -0
  529. package/dist/sdk/define.js +17 -2
  530. package/dist/sdk/define.js.map +1 -1
  531. package/dist/sdk/index.d.ts +14 -3
  532. package/dist/sdk/index.js +14 -3
  533. package/dist/sdk/index.js.map +1 -1
  534. package/dist/sdk/testing.d.ts +82 -2
  535. package/dist/sdk/testing.js +74 -3
  536. package/dist/sdk/testing.js.map +1 -1
  537. package/docs/AGENT_GUIDE.md +2 -0
  538. package/docs/CLAUDE_CODE_PLUGIN.md +2 -2
  539. package/docs/COMMANDS.md +37 -0
  540. package/docs/EXTENSIONS.md +12 -13
  541. package/docs/RELEASING.md +8 -4
  542. package/docs/SDK.md +184 -17
  543. package/docs/TESTING.md +12 -0
  544. package/docs/examples/policy-restricted-extension/README.md +6 -0
  545. package/docs/examples/policy-restricted-extension/index.ts +40 -0
  546. package/docs/examples/policy-restricted-extension/manifest.json +2 -2
  547. package/docs/examples/starter-extension/README.md +14 -2
  548. package/docs/examples/starter-extension/{index.js → index.ts} +51 -6
  549. package/docs/examples/starter-extension/manifest.json +2 -2
  550. package/package.json +20 -7
  551. package/packages/pm-beads/extensions/beads/index.ts +3 -3
  552. package/packages/pm-beads/extensions/beads/manifest.json +2 -2
  553. package/packages/pm-beads/extensions/beads/runtime-loader.ts +19 -7
  554. package/packages/pm-beads/extensions/beads/runtime.ts +155 -37
  555. package/packages/pm-calendar/extensions/calendar/index.ts +3 -3
  556. package/packages/pm-calendar/extensions/calendar/manifest.json +2 -2
  557. package/packages/pm-calendar/extensions/calendar/runtime.ts +2 -2
  558. package/packages/pm-command-kit/extensions/command-kit/index.ts +1 -1
  559. package/packages/pm-command-kit/extensions/command-kit/manifest.json +2 -2
  560. package/packages/pm-governance-audit/extensions/governance-audit/index.ts +2 -2
  561. package/packages/pm-governance-audit/extensions/governance-audit/manifest.json +2 -2
  562. package/packages/pm-governance-audit/extensions/governance-audit/runtime.ts +1 -1
  563. package/packages/pm-guide-shell/extensions/guide-shell/index.ts +2 -2
  564. package/packages/pm-guide-shell/extensions/guide-shell/manifest.json +2 -2
  565. package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +1 -1
  566. package/packages/pm-kanban/README.md +97 -0
  567. package/packages/pm-kanban/extensions/kanban/index.ts +191 -0
  568. package/packages/pm-kanban/extensions/kanban/manifest.json +19 -0
  569. package/packages/pm-kanban/package.json +57 -0
  570. package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/index.ts +1 -1
  571. package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/manifest.json +2 -2
  572. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/index.ts +2 -2
  573. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/manifest.json +2 -2
  574. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/runtime.ts +1 -1
  575. package/packages/pm-search-advanced/extensions/search-advanced/index.ts +2 -2
  576. package/packages/pm-search-advanced/extensions/search-advanced/manifest.json +2 -2
  577. package/packages/pm-search-advanced/extensions/search-advanced/runtime.ts +1 -1
  578. package/packages/pm-templates/extensions/templates/index.ts +2 -2
  579. package/packages/pm-templates/extensions/templates/manifest.json +2 -2
  580. package/packages/pm-templates/extensions/templates/runtime.ts +1 -1
  581. package/packages/pm-todos/extensions/todos/index.ts +3 -3
  582. package/packages/pm-todos/extensions/todos/manifest.json +2 -2
  583. package/packages/pm-todos/extensions/todos/runtime-loader.ts +19 -7
  584. package/packages/pm-todos/extensions/todos/runtime.ts +177 -43
  585. package/plugins/pm-claude/scripts/pm-mcp-server.mjs +2 -2
  586. package/plugins/pm-codex/scripts/pm-mcp-server.mjs +2 -2
  587. package/scripts/bundle-cli.mjs +1 -1
  588. package/dist/cli-bundle/chunks/activity-54TXGJ2T.js +0 -18
  589. package/dist/cli-bundle/chunks/aggregate-63NWNIBR.js.map +0 -1
  590. package/dist/cli-bundle/chunks/aggregate-YHCYX2EV.js.map +0 -7
  591. package/dist/cli-bundle/chunks/chunk-6EL7SW5C.js.map +0 -7
  592. package/dist/cli-bundle/chunks/chunk-6W3Y65PL.js.map +0 -7
  593. package/dist/cli-bundle/chunks/chunk-AEACLRVH.js.map +0 -7
  594. package/dist/cli-bundle/chunks/chunk-B74BP6IS.js +0 -78
  595. package/dist/cli-bundle/chunks/chunk-B74BP6IS.js.map +0 -7
  596. package/dist/cli-bundle/chunks/chunk-BFFO3AIB.js.map +0 -1
  597. package/dist/cli-bundle/chunks/chunk-C4C3EJCJ.js.map +0 -7
  598. package/dist/cli-bundle/chunks/chunk-EYPINTFR.js.map +0 -7
  599. package/dist/cli-bundle/chunks/chunk-FBLT6WGK.js +0 -75
  600. package/dist/cli-bundle/chunks/chunk-FBLT6WGK.js.map +0 -1
  601. package/dist/cli-bundle/chunks/chunk-GQYJEEFX.js.map +0 -1
  602. package/dist/cli-bundle/chunks/chunk-HBAEFWX3.js.map +0 -7
  603. package/dist/cli-bundle/chunks/chunk-HC2S36NB.js.map +0 -1
  604. package/dist/cli-bundle/chunks/chunk-IAP5KYBQ.js.map +0 -1
  605. package/dist/cli-bundle/chunks/chunk-INPHFO33.js +0 -764
  606. package/dist/cli-bundle/chunks/chunk-INPHFO33.js.map +0 -7
  607. package/dist/cli-bundle/chunks/chunk-IOT6WRL5.js +0 -86
  608. package/dist/cli-bundle/chunks/chunk-IOT6WRL5.js.map +0 -7
  609. package/dist/cli-bundle/chunks/chunk-ISEKN64V.js +0 -35
  610. package/dist/cli-bundle/chunks/chunk-ISEKN64V.js.map +0 -7
  611. package/dist/cli-bundle/chunks/chunk-J3NMWFIN.js +0 -115
  612. package/dist/cli-bundle/chunks/chunk-J3NMWFIN.js.map +0 -1
  613. package/dist/cli-bundle/chunks/chunk-J7I4C5ZB.js.map +0 -7
  614. package/dist/cli-bundle/chunks/chunk-JKL6HRMV.js.map +0 -7
  615. package/dist/cli-bundle/chunks/chunk-KJZOSF7J.js.map +0 -1
  616. package/dist/cli-bundle/chunks/chunk-L7UXKP2I.js.map +0 -1
  617. package/dist/cli-bundle/chunks/chunk-LNEDHJNQ.js.map +0 -1
  618. package/dist/cli-bundle/chunks/chunk-M6TUBOGW.js.map +0 -1
  619. package/dist/cli-bundle/chunks/chunk-MEXZ5XUM.js.map +0 -7
  620. package/dist/cli-bundle/chunks/chunk-N5B6WZC5.js.map +0 -1
  621. package/dist/cli-bundle/chunks/chunk-NJ73ALW2.js +0 -761
  622. package/dist/cli-bundle/chunks/chunk-NJ73ALW2.js.map +0 -1
  623. package/dist/cli-bundle/chunks/chunk-NVXGVEFD.js +0 -83
  624. package/dist/cli-bundle/chunks/chunk-NVXGVEFD.js.map +0 -1
  625. package/dist/cli-bundle/chunks/chunk-OF7V47P3.js.map +0 -1
  626. package/dist/cli-bundle/chunks/chunk-OHDQNKJB.js.map +0 -7
  627. package/dist/cli-bundle/chunks/chunk-PEL2NLQE.js +0 -118
  628. package/dist/cli-bundle/chunks/chunk-PEL2NLQE.js.map +0 -7
  629. package/dist/cli-bundle/chunks/chunk-PRVTGX64.js.map +0 -7
  630. package/dist/cli-bundle/chunks/chunk-RAWA3Y7O.js.map +0 -1
  631. package/dist/cli-bundle/chunks/chunk-SMXSDY7J.js.map +0 -7
  632. package/dist/cli-bundle/chunks/chunk-SUREE24M.js.map +0 -1
  633. package/dist/cli-bundle/chunks/chunk-TKPP4GOO.js +0 -654
  634. package/dist/cli-bundle/chunks/chunk-TKPP4GOO.js.map +0 -1
  635. package/dist/cli-bundle/chunks/chunk-VSAABFGQ.js.map +0 -1
  636. package/dist/cli-bundle/chunks/chunk-W2VMLL5S.js +0 -32
  637. package/dist/cli-bundle/chunks/chunk-W2VMLL5S.js.map +0 -1
  638. package/dist/cli-bundle/chunks/chunk-XVYKWZNL.js.map +0 -7
  639. package/dist/cli-bundle/chunks/chunk-XXKV4UWE.js.map +0 -7
  640. package/dist/cli-bundle/chunks/chunk-ZLWRPBOW.js.map +0 -1
  641. package/dist/cli-bundle/chunks/chunk-ZV7IQ23N.js +0 -657
  642. package/dist/cli-bundle/chunks/chunk-ZV7IQ23N.js.map +0 -7
  643. package/dist/cli-bundle/chunks/close-JEBZXONN.js +0 -15
  644. package/dist/cli-bundle/chunks/config-NCNNWF6R.js.map +0 -7
  645. package/dist/cli-bundle/chunks/config-SW3U7XP2.js.map +0 -1
  646. package/dist/cli-bundle/chunks/context-55VEOYI3.js.map +0 -1
  647. package/dist/cli-bundle/chunks/context-5LB7UGKE.js.map +0 -7
  648. package/dist/cli-bundle/chunks/contracts-JXFGBOYT.js.map +0 -1
  649. package/dist/cli-bundle/chunks/contracts-SY6PDFIK.js.map +0 -7
  650. package/dist/cli-bundle/chunks/create-CLSCHGJJ.js +0 -30
  651. package/dist/cli-bundle/chunks/history-ALTM2RRP.js +0 -20
  652. package/dist/cli-bundle/chunks/history-redact-5YGLWUDH.js +0 -21
  653. package/dist/cli-bundle/chunks/init-C4CRHW22.js +0 -21
  654. package/dist/cli-bundle/chunks/register-list-query-CCMHGZTF.js.map +0 -7
  655. package/dist/cli-bundle/chunks/register-list-query-OM3E2KMY.js.map +0 -1
  656. package/dist/cli-bundle/chunks/register-mutation-N3CDEGZU.js.map +0 -1
  657. package/dist/cli-bundle/chunks/register-mutation-UXTTWL6N.js.map +0 -7
  658. package/dist/cli-bundle/chunks/register-setup-G5LTSFYK.js.map +0 -1
  659. package/dist/cli-bundle/chunks/register-setup-TWHKICM2.js.map +0 -7
  660. package/dist/cli-bundle/chunks/restore-LQHXBAY5.js +0 -19
  661. package/dist/cli-bundle/chunks/schema-C6QA367T.js.map +0 -7
  662. package/dist/cli-bundle/chunks/schema-QO5I4FBL.js.map +0 -1
  663. package/dist/cli-bundle/chunks/stats-TCW2SZQG.js.map +0 -7
  664. package/dist/cli-bundle/chunks/stats-TKC6CAKB.js.map +0 -1
  665. package/dist/cli-bundle/chunks/test-WA6RZGM2.js +0 -36
  666. package/dist/cli-bundle/chunks/test-runs-FQ5WNQLP.js.map +0 -1
  667. package/dist/cli-bundle/chunks/test-runs-PX73DMMI.js.map +0 -7
  668. package/dist/cli-bundle/chunks/update-BSKMQOYH.js +0 -28
  669. package/dist/cli-bundle/chunks/update-FIGYNQ2I.js +0 -24
  670. package/dist/cli-bundle/chunks/validate-54SYJ7QW.js.map +0 -1
  671. package/dist/cli-bundle/chunks/validate-HYZNIB6W.js.map +0 -7
  672. package/docs/examples/policy-restricted-extension/index.js +0 -21
  673. package/packages/pm-beads/extensions/beads/index.js +0 -64
  674. package/packages/pm-beads/extensions/beads/runtime-loader.js +0 -86
  675. package/packages/pm-beads/extensions/beads/runtime.js +0 -482
  676. package/packages/pm-calendar/extensions/calendar/index.js +0 -150
  677. package/packages/pm-calendar/extensions/calendar/runtime.js +0 -126
  678. package/packages/pm-command-kit/extensions/command-kit/index.js +0 -181
  679. package/packages/pm-governance-audit/extensions/governance-audit/index.js +0 -177
  680. package/packages/pm-governance-audit/extensions/governance-audit/runtime.js +0 -153
  681. package/packages/pm-guide-shell/extensions/guide-shell/index.js +0 -98
  682. package/packages/pm-guide-shell/extensions/guide-shell/runtime.js +0 -294
  683. package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/index.js +0 -18
  684. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/index.js +0 -124
  685. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/runtime.js +0 -110
  686. package/packages/pm-search-advanced/extensions/search-advanced/index.js +0 -258
  687. package/packages/pm-search-advanced/extensions/search-advanced/runtime.js +0 -361
  688. package/packages/pm-templates/extensions/templates/index.js +0 -132
  689. package/packages/pm-templates/extensions/templates/runtime.js +0 -35
  690. package/packages/pm-todos/extensions/todos/index.js +0 -81
  691. package/packages/pm-todos/extensions/todos/runtime-loader.js +0 -86
  692. package/packages/pm-todos/extensions/todos/runtime.js +0 -545
  693. /package/dist/cli-bundle/chunks/{activity-54TXGJ2T.js.map → activity-AW6XVFH6.js.map} +0 -0
  694. /package/dist/cli-bundle/chunks/{activity-N7RVTLBQ.js.map → activity-DBLQVIP6.js.map} +0 -0
  695. /package/dist/cli-bundle/chunks/{chunk-F32L4HR6.js.map → chunk-27BXPBAY.js.map} +0 -0
  696. /package/dist/cli-bundle/chunks/{chunk-5BBEWX6C.js.map → chunk-3VGN2UWE.js.map} +0 -0
  697. /package/dist/cli-bundle/chunks/{chunk-FMWW2JDU.js.map → chunk-AXIDKKAT.js.map} +0 -0
  698. /package/dist/cli-bundle/chunks/{chunk-TIM4OD74.js.map → chunk-BDTISOSD.js.map} +0 -0
  699. /package/dist/cli-bundle/chunks/{chunk-CZIFFMZI.js.map → chunk-DDPTYJIM.js.map} +0 -0
  700. /package/dist/cli-bundle/chunks/{chunk-AYPQUFCX.js.map → chunk-EJUDVUYZ.js.map} +0 -0
  701. /package/dist/cli-bundle/chunks/{chunk-EOGBMLCE.js.map → chunk-EVMTBV6V.js.map} +0 -0
  702. /package/dist/cli-bundle/chunks/{chunk-CG3KP6I5.js.map → chunk-G7I7DEZA.js.map} +0 -0
  703. /package/dist/cli-bundle/chunks/{chunk-F4BNR2IN.js.map → chunk-HYTGA6GI.js.map} +0 -0
  704. /package/dist/cli-bundle/chunks/{chunk-2WCYE3IF.js.map → chunk-HZZEHPRG.js.map} +0 -0
  705. /package/dist/cli-bundle/chunks/{chunk-YV2OSAMS.js.map → chunk-IJYK2T43.js.map} +0 -0
  706. /package/dist/cli-bundle/chunks/{chunk-QOUOMPHO.js.map → chunk-JPECA746.js.map} +0 -0
  707. /package/dist/cli-bundle/chunks/{chunk-OQ2E64FH.js.map → chunk-KNPEF7QG.js.map} +0 -0
  708. /package/dist/cli-bundle/chunks/{chunk-3BKH2CL3.js.map → chunk-L5OEFZQG.js.map} +0 -0
  709. /package/dist/cli-bundle/chunks/{chunk-5S4ZGDB2.js.map → chunk-N74UMG5H.js.map} +0 -0
  710. /package/dist/cli-bundle/chunks/{chunk-IXAZI443.js.map → chunk-NFDPYAIP.js.map} +0 -0
  711. /package/dist/cli-bundle/chunks/{chunk-SKC4UTRP.js.map → chunk-NKZAN7BD.js.map} +0 -0
  712. /package/dist/cli-bundle/chunks/{chunk-JPJDP4VU.js.map → chunk-NWMZWYYB.js.map} +0 -0
  713. /package/dist/cli-bundle/chunks/{chunk-KKX4Z2SE.js.map → chunk-OTUHB4HS.js.map} +0 -0
  714. /package/dist/cli-bundle/chunks/{chunk-WB5BYQMF.js.map → chunk-SLMUGTK3.js.map} +0 -0
  715. /package/dist/cli-bundle/chunks/{chunk-I6QMJ2XT.js.map → chunk-WYDHYJPO.js.map} +0 -0
  716. /package/dist/cli-bundle/chunks/{chunk-KIEAK7YE.js.map → chunk-ZRP4VG5U.js.map} +0 -0
  717. /package/dist/cli-bundle/chunks/{close-JEBZXONN.js.map → close-E6ZZGCJY.js.map} +0 -0
  718. /package/dist/cli-bundle/chunks/{close-QHMVWM7M.js.map → close-TQYAAFJP.js.map} +0 -0
  719. /package/dist/cli-bundle/chunks/{create-O4VONGPG.js.map → context-B6275WPX.js.map} +0 -0
  720. /package/dist/cli-bundle/chunks/{create-CLSCHGJJ.js.map → context-OCZ3FJ4Z.js.map} +0 -0
  721. /package/dist/cli-bundle/chunks/{extension-YQF4CPIR.js.map → create-OH3BDGBB.js.map} +0 -0
  722. /package/dist/cli-bundle/chunks/{extension-3JYWJ5K2.js.map → create-RLRJMRTM.js.map} +0 -0
  723. /package/dist/cli-bundle/chunks/{history-ALTM2RRP.js.map → extension-CPSLJQVE.js.map} +0 -0
  724. /package/dist/cli-bundle/chunks/{history-RUKPKNY7.js.map → extension-CXJ6RELI.js.map} +0 -0
  725. /package/dist/cli-bundle/chunks/{gc-BEJMQT64.js.map → gc-7GQYOS2G.js.map} +0 -0
  726. /package/dist/cli-bundle/chunks/{gc-JEFQDJPA.js.map → gc-LPVMKJQJ.js.map} +0 -0
  727. /package/dist/cli-bundle/chunks/{health-JJJOY7DJ.js.map → health-3IPFLKXB.js.map} +0 -0
  728. /package/dist/cli-bundle/chunks/{health-P67NZ6TT.js.map → health-GZXGBZ36.js.map} +0 -0
  729. /package/dist/cli-bundle/chunks/{history-redact-YY4XYVEP.js.map → history-NERDJNUB.js.map} +0 -0
  730. /package/dist/cli-bundle/chunks/{history-redact-5YGLWUDH.js.map → history-WSZHY3PN.js.map} +0 -0
  731. /package/dist/cli-bundle/chunks/{init-C4CRHW22.js.map → history-redact-MP6CH7U5.js.map} +0 -0
  732. /package/dist/cli-bundle/chunks/{init-HBFGYS66.js.map → history-redact-O3NBCNWC.js.map} +0 -0
  733. /package/dist/cli-bundle/chunks/{list-C7R33MD5.js.map → init-64XDLQJB.js.map} +0 -0
  734. /package/dist/cli-bundle/chunks/{list-DSN6UNFB.js.map → init-PAX32BJA.js.map} +0 -0
  735. /package/dist/cli-bundle/chunks/{restore-LL2WLEDG.js.map → list-DNBJVO3E.js.map} +0 -0
  736. /package/dist/cli-bundle/chunks/{restore-LQHXBAY5.js.map → list-G5Y65VF6.js.map} +0 -0
  737. /package/dist/cli-bundle/chunks/{search-2EI6EAXH.js.map → restore-4MHZFJ2E.js.map} +0 -0
  738. /package/dist/cli-bundle/chunks/{search-QBFBLQRO.js.map → restore-YALDGTQR.js.map} +0 -0
  739. /package/dist/cli-bundle/chunks/{test-NV2DRPUS.js.map → schema-73HR2OJW.js.map} +0 -0
  740. /package/dist/cli-bundle/chunks/{test-WA6RZGM2.js.map → schema-U6LJKSIR.js.map} +0 -0
  741. /package/dist/cli-bundle/chunks/{update-BSKMQOYH.js.map → search-AXPXKZER.js.map} +0 -0
  742. /package/dist/cli-bundle/chunks/{update-FIGYNQ2I.js.map → search-KILGT37L.js.map} +0 -0
  743. /package/dist/cli-bundle/chunks/{telemetry-BT2VSWU2.js.map → telemetry-BZUF6H7G.js.map} +0 -0
  744. /package/dist/cli-bundle/chunks/{telemetry-LQ6FRTUT.js.map → telemetry-GAHHQTOS.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../cli/commands/test-runs.ts","../../../../../../../../core/test/background-runs.ts"],"sourcesContent":["/**\n * @module cli/commands/test-runs\n *\n * Implements the pm test runs command surface and its agent-facing runtime behavior.\n */\nimport os from \"node:os\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport {\n type BackgroundLogStream,\n type BackgroundTestRunKind,\n type BackgroundTestRunStatus,\n getBackgroundTestRunStatus,\n listBackgroundTestRuns,\n readBackgroundTestRunLogs,\n resumeBackgroundTestRun,\n runBackgroundTestRunWorker,\n spawnBackgroundTestRunWorker,\n startBackgroundTestRun,\n stopBackgroundTestRun,\n} from \"../../core/test/background-runs.js\";\nimport { getSettingsPath, resolveGlobalPmRoot, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport { parseLimit } from \"../shared-parsers.js\";\n\nconst BACKGROUND_STATUS_VALUES: readonly BackgroundTestRunStatus[] = [\"queued\", \"running\", \"passed\", \"failed\", \"stopped\", \"canceled\"];\nconst BACKGROUND_STREAM_VALUES: readonly BackgroundLogStream[] = [\"stdout\", \"stderr\", \"both\"];\n\nfunction normalizeStatus(value: string | undefined): BackgroundTestRunStatus | undefined {\n if (value === undefined) {\n return undefined;\n }\n const normalized = value.trim().toLowerCase();\n if ((BACKGROUND_STATUS_VALUES as readonly string[]).includes(normalized)) {\n return normalized as BackgroundTestRunStatus;\n }\n throw new PmCliError(`Invalid --status value \"${value}\"`, EXIT_CODE.USAGE);\n}\n\nfunction normalizeStream(value: string | undefined): BackgroundLogStream {\n if (value === undefined || value.trim().length === 0) {\n return \"stderr\";\n }\n const normalized = value.trim().toLowerCase();\n if ((BACKGROUND_STREAM_VALUES as readonly string[]).includes(normalized)) {\n return normalized as BackgroundLogStream;\n }\n throw new PmCliError(`Invalid --stream value \"${value}\"`, EXIT_CODE.USAGE);\n}\n\nfunction resolveWhoamiFallback(): string | undefined {\n try {\n const username = os.userInfo().username.trim();\n if (username.length > 0) {\n return username;\n }\n } catch {\n // Fall back to environment-derived attribution.\n }\n return undefined;\n}\n\nfunction resolveRequestedBy(author: string | undefined, fallback: string): string {\n const candidates = [\n author,\n process.env.PM_AUTHOR,\n fallback,\n process.env.USER,\n process.env.LOGNAME,\n process.env.USERNAME,\n resolveWhoamiFallback(),\n ];\n for (const candidate of candidates) {\n if (typeof candidate !== \"string\") {\n continue;\n }\n const trimmed = candidate.trim();\n if (trimmed.length > 0) {\n return trimmed;\n }\n }\n return \"unknown\";\n}\n\nasync function ensureInitialized(pmRoot: string): Promise<void> {\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n}\n\n/**\n * Documents the start background run command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface StartBackgroundRunCommandOptions {\n kind: BackgroundTestRunKind;\n commandArgs: string[];\n targetId?: string;\n statusFilter?: string;\n author?: string;\n noExtensions?: boolean;\n}\n\n/**\n * Documents the start background run result payload exchanged by command, SDK, and package integrations.\n */\nexport interface StartBackgroundRunResult {\n started: boolean;\n duplicate_of?: string;\n run: unknown;\n}\n\n/**\n * Implements run start background run for the public runtime surface of this module.\n */\nexport async function runStartBackgroundRun(\n options: StartBackgroundRunCommandOptions,\n global: GlobalOptions,\n): Promise<StartBackgroundRunResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n const globalPmRoot = resolveGlobalPmRoot(process.cwd());\n await ensureInitialized(pmRoot);\n const settings = await readSettings(pmRoot);\n const requestedBy = resolveRequestedBy(options.author, settings.author_default);\n const started = await startBackgroundTestRun({\n pmRoot,\n globalPmRoot,\n kind: options.kind,\n commandArgs: options.commandArgs,\n requestedBy,\n targetId: options.targetId,\n statusFilter: options.statusFilter,\n });\n if (!started.started) {\n return {\n started: false,\n duplicate_of: started.duplicate_of,\n run: started.run,\n };\n }\n const spawned = await spawnBackgroundTestRunWorker({\n pmRoot,\n runId: started.run.id,\n noExtensions: options.noExtensions === true,\n });\n return {\n started: true,\n run: spawned,\n };\n}\n\n/**\n * Documents the test runs list command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface TestRunsListCommandOptions {\n status?: string;\n limit?: string;\n}\n\n/**\n * Implements run test runs list for the public runtime surface of this module.\n */\nexport async function runTestRunsList(options: TestRunsListCommandOptions, global: GlobalOptions): Promise<{\n runs: unknown[];\n count: number;\n filters: {\n status?: BackgroundTestRunStatus;\n limit?: number;\n };\n}> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureInitialized(pmRoot);\n const status = normalizeStatus(options.status);\n const limit = parseLimit(options.limit, \"limit\");\n const runs = await listBackgroundTestRuns(pmRoot, { status, limit });\n return {\n runs,\n count: runs.length,\n filters: {\n status,\n limit,\n },\n };\n}\n\n/**\n * Implements run test runs status for the public runtime surface of this module.\n */\nexport async function runTestRunsStatus(runId: string, global: GlobalOptions): Promise<{\n run: unknown;\n health: unknown;\n}> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureInitialized(pmRoot);\n const status = await getBackgroundTestRunStatus(pmRoot, runId);\n return {\n run: status.run,\n health: status.health,\n };\n}\n\n/**\n * Documents the test runs logs command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface TestRunsLogsCommandOptions {\n stream?: string;\n tail?: string;\n}\n\n/**\n * Implements run test runs logs for the public runtime surface of this module.\n */\nexport async function runTestRunsLogs(\n runId: string,\n options: TestRunsLogsCommandOptions,\n global: GlobalOptions,\n): Promise<{\n run: unknown;\n stream: BackgroundLogStream;\n tail: number;\n stdout: string[];\n stderr: string[];\n}> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureInitialized(pmRoot);\n const stream = normalizeStream(options.stream);\n const tail = parseLimit(options.tail, \"tail\");\n const logs = await readBackgroundTestRunLogs(pmRoot, runId, stream, tail);\n return {\n run: logs.run,\n stream: logs.stream,\n tail: logs.tail,\n stdout: logs.stdout,\n stderr: logs.stderr,\n };\n}\n\n/**\n * Documents the test runs stop command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface TestRunsStopCommandOptions {\n force?: boolean;\n}\n\n/**\n * Implements run test runs stop for the public runtime surface of this module.\n */\nexport async function runTestRunsStop(\n runId: string,\n options: TestRunsStopCommandOptions,\n global: GlobalOptions,\n): Promise<{\n run: unknown;\n signal_sent: \"SIGTERM\" | \"SIGKILL\" | \"none\";\n}> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureInitialized(pmRoot);\n const stopped = await stopBackgroundTestRun(pmRoot, runId, options.force === true);\n return {\n run: stopped.run,\n signal_sent: stopped.signal_sent,\n };\n}\n\n/**\n * Documents the test runs resume command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface TestRunsResumeCommandOptions {\n author?: string;\n noExtensions?: boolean;\n}\n\n/**\n * Implements run test runs resume for the public runtime surface of this module.\n */\nexport async function runTestRunsResume(\n runId: string,\n options: TestRunsResumeCommandOptions,\n global: GlobalOptions,\n): Promise<{\n resumed_from: string;\n run: unknown;\n}> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureInitialized(pmRoot);\n const settings = await readSettings(pmRoot);\n const requestedBy = resolveRequestedBy(options.author, settings.author_default);\n const resumed = await resumeBackgroundTestRun(pmRoot, runId, requestedBy, options.noExtensions === true);\n return {\n resumed_from: runId,\n run: resumed,\n };\n}\n\n/**\n * Implements run test runs worker for the public runtime surface of this module.\n */\nexport async function runTestRunsWorker(runId: string, global: GlobalOptions): Promise<{\n id: string;\n status: BackgroundTestRunStatus;\n exit_code?: number;\n}> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureInitialized(pmRoot);\n const finished = await runBackgroundTestRunWorker(pmRoot, runId, global.noExtensions === true);\n return {\n id: finished.id,\n status: finished.status,\n exit_code: finished.exit_code,\n };\n}\n","/**\n * @module core/test/background-runs\n *\n * Runs and records linked-test orchestration for Background Runs.\n */\nimport fs from \"node:fs/promises\";\nimport { spawn } from \"node:child_process\";\nimport { createHash, randomBytes } from \"node:crypto\";\nimport path from \"node:path\";\nimport { ensureDir, pathExists, readFileIfExists, writeFileAtomic } from \"../fs/fs-utils.js\";\nimport { PmCliError } from \"../shared/errors.js\";\nimport { EXIT_CODE } from \"../shared/constants.js\";\nimport { nowIso } from \"../shared/time.js\";\nimport {\n getTestRunRecordPath,\n getTestRunResultPath,\n getTestRunStderrPath,\n getTestRunStdoutPath,\n getTestRunsPath,\n getTestRunsRecordsPath,\n getTestRunsResultsPath,\n getTestRunsStderrPath,\n getTestRunsStdoutPath,\n} from \"../store/paths.js\";\n\nconst BACKGROUND_RUN_ACTIVE_STATUSES = new Set<BackgroundTestRunStatus>([\"queued\", \"running\"]);\nconst BACKGROUND_RUN_TERMINAL_STATUSES = new Set<BackgroundTestRunStatus>([\"passed\", \"failed\", \"stopped\", \"canceled\"]);\nconst DEFAULT_BACKGROUND_RUN_RESOURCE_SNAPSHOT_INTERVAL_MS = 3000;\nconst DEFAULT_BACKGROUND_RUN_FORCE_KILL_DELAY_MS = 3000;\nconst DEFAULT_BACKGROUND_RUN_HEARTBEAT_STALE_MS = 30000;\nconst DEFAULT_BACKGROUND_RUN_LOG_TAIL_LINES = 100;\nconst PROC_STAT_TICKS_PER_SECOND = 100;\n\n/**\n * Restricts background test run kind values accepted by command, SDK, and storage contracts.\n */\nexport type BackgroundTestRunKind = \"test\" | \"test-all\";\n\n/**\n * Restricts background test run status values accepted by command, SDK, and storage contracts.\n */\nexport type BackgroundTestRunStatus = \"queued\" | \"running\" | \"passed\" | \"failed\" | \"stopped\" | \"canceled\";\n\n/**\n * Restricts background log stream values accepted by command, SDK, and storage contracts.\n */\nexport type BackgroundLogStream = \"stdout\" | \"stderr\" | \"both\";\n\n/**\n * Documents the background run progress payload exchanged by command, SDK, and package integrations.\n */\nexport interface BackgroundRunProgress {\n phase: \"queued\" | \"running\" | \"stopping\" | \"finished\";\n message?: string;\n item_index?: number;\n item_total?: number;\n item_id?: string;\n linked_test_index?: number;\n linked_test_total?: number;\n current_command?: string;\n elapsed_ms?: number;\n heartbeat_at?: string;\n}\n\n/**\n * Documents the background run resource snapshot payload exchanged by command, SDK, and package integrations.\n */\nexport interface BackgroundRunResourceSnapshot {\n recorded_at: string;\n rss_bytes?: number;\n cpu_user_seconds?: number;\n cpu_system_seconds?: number;\n uptime_seconds?: number;\n}\n\n/**\n * Documents the background run summary payload exchanged by command, SDK, and package integrations.\n */\nexport interface BackgroundRunSummary {\n items?: number;\n linked_tests?: number;\n passed: number;\n failed: number;\n skipped: number;\n fail_on_skipped_triggered?: boolean;\n}\n\n/**\n * Documents the background test run record payload exchanged by command, SDK, and package integrations.\n */\nexport interface BackgroundTestRunRecord {\n id: string;\n kind: BackgroundTestRunKind;\n status: BackgroundTestRunStatus;\n created_at: string;\n started_at?: string;\n finished_at?: string;\n updated_at: string;\n requested_by: string;\n fingerprint: string;\n command_args: string[];\n command_label: string;\n pm_root: string;\n global_pm_root: string;\n target_id?: string;\n status_filter?: string;\n attempt: number;\n resumed_from?: string;\n resumed_by?: string;\n worker_pid?: number;\n child_pid?: number;\n exit_code?: number;\n signal?: string;\n stdout_path: string;\n stderr_path: string;\n result_path: string;\n progress?: BackgroundRunProgress;\n resource?: BackgroundRunResourceSnapshot;\n summary?: BackgroundRunSummary;\n stop_requested_at?: string;\n duplicate_of?: string;\n error?: string;\n}\n\n/**\n * Documents the start background test run options payload exchanged by command, SDK, and package integrations.\n */\nexport interface StartBackgroundTestRunOptions {\n pmRoot: string;\n globalPmRoot: string;\n kind: BackgroundTestRunKind;\n commandArgs: string[];\n requestedBy: string;\n targetId?: string;\n statusFilter?: string;\n resumedFrom?: string;\n resumedBy?: string;\n attempt?: number;\n}\n\n/**\n * Documents the start background test run result payload exchanged by command, SDK, and package integrations.\n */\nexport interface StartBackgroundTestRunResult {\n started: boolean;\n run: BackgroundTestRunRecord;\n duplicate_of?: string;\n}\n\n/**\n * Documents the spawn background test run worker options payload exchanged by command, SDK, and package integrations.\n */\nexport interface SpawnBackgroundTestRunWorkerOptions {\n pmRoot: string;\n runId: string;\n noExtensions?: boolean;\n}\n\n/**\n * Documents the stop background test run result payload exchanged by command, SDK, and package integrations.\n */\nexport interface StopBackgroundTestRunResult {\n run: BackgroundTestRunRecord;\n signal_sent: \"SIGTERM\" | \"SIGKILL\" | \"none\";\n}\n\n/**\n * Documents the list background test run options payload exchanged by command, SDK, and package integrations.\n */\nexport interface ListBackgroundTestRunOptions {\n status?: BackgroundTestRunStatus;\n limit?: number;\n}\n\n/**\n * Documents the background run health payload exchanged by command, SDK, and package integrations.\n */\nexport interface BackgroundRunHealth {\n state: \"healthy\" | \"stale\" | \"inactive\";\n last_heartbeat_at?: string;\n heartbeat_lag_ms?: number;\n worker_alive: boolean;\n child_alive: boolean;\n}\n\n/**\n * Documents the background run status view payload exchanged by command, SDK, and package integrations.\n */\nexport interface BackgroundRunStatusView {\n run: BackgroundTestRunRecord;\n health: BackgroundRunHealth;\n}\n\n/**\n * Documents the background run logs result payload exchanged by command, SDK, and package integrations.\n */\nexport interface BackgroundRunLogsResult {\n run: BackgroundTestRunRecord;\n stream: BackgroundLogStream;\n tail: number;\n stdout: string[];\n stderr: string[];\n}\n\ninterface WorkerEvaluationResult {\n summary: BackgroundRunSummary;\n parsedResult: unknown | null;\n}\n\nfunction nowMs(): number {\n return Date.now();\n}\n\nfunction normalizeCommandArgs(args: string[]): string[] {\n return args.map((entry) => entry.trim()).filter((entry) => entry.length > 0);\n}\n\nfunction summarizeCommandLabel(args: string[]): string {\n const joined = args.join(\" \").replaceAll(/\\s+/g, \" \").trim();\n if (joined.length <= 180) {\n return joined;\n }\n return `${joined.slice(0, 177)}...`;\n}\n\nfunction buildRunId(): string {\n const timePart = Date.now().toString(36);\n const randomPart = randomBytes(3).toString(\"hex\");\n return `tr-${timePart}-${randomPart}`;\n}\n\n/**\n * Implements build background test run fingerprint for the public runtime surface of this module.\n */\nexport function buildBackgroundTestRunFingerprint(kind: BackgroundTestRunKind, commandArgs: string[], pmRoot: string): string {\n const payload = {\n kind,\n command: normalizeCommandArgs(commandArgs),\n pm_root: path.resolve(pmRoot),\n };\n return createHash(\"sha256\").update(JSON.stringify(payload)).digest(\"hex\");\n}\n\nfunction isPidRunning(pid: number | undefined): boolean {\n if (!Number.isInteger(pid) || !pid || pid <= 0) {\n return false;\n }\n try {\n process.kill(pid, 0);\n return true;\n } catch (error: unknown) {\n const code = typeof error === \"object\" && error !== null && \"code\" in error ? (error as { code?: string }).code : undefined;\n return code === \"EPERM\";\n }\n}\n\nasync function ensureBackgroundRunStorage(pmRoot: string): Promise<void> {\n await ensureDir(getTestRunsPath(pmRoot));\n await ensureDir(getTestRunsRecordsPath(pmRoot));\n await ensureDir(getTestRunsStdoutPath(pmRoot));\n await ensureDir(getTestRunsStderrPath(pmRoot));\n await ensureDir(getTestRunsResultsPath(pmRoot));\n}\n\nasync function parseBackgroundRunRecord(raw: string, recordPath: string): Promise<BackgroundTestRunRecord> {\n try {\n const parsed = JSON.parse(raw) as BackgroundTestRunRecord;\n if (!parsed || typeof parsed !== \"object\" || typeof parsed.id !== \"string\") {\n throw new Error(\"invalid run record payload\");\n }\n return parsed;\n } catch (error: unknown) {\n throw new PmCliError(\n `Failed to parse background test run record at ${recordPath}: ${error instanceof Error ? error.message : String(error)}`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n}\n\nasync function writeBackgroundRunRecord(pmRoot: string, record: BackgroundTestRunRecord): Promise<void> {\n const next: BackgroundTestRunRecord = {\n ...record,\n updated_at: nowIso(),\n };\n await writeFileAtomic(getTestRunRecordPath(pmRoot, record.id), `${JSON.stringify(next, null, 2)}\\n`);\n}\n\n/**\n * Implements read background test run record for the public runtime surface of this module.\n */\nexport async function readBackgroundTestRunRecord(pmRoot: string, runId: string): Promise<BackgroundTestRunRecord | null> {\n const recordPath = getTestRunRecordPath(pmRoot, runId);\n const raw = await readFileIfExists(recordPath);\n if (!raw) {\n return null;\n }\n return parseBackgroundRunRecord(raw, recordPath);\n}\n\nasync function listBackgroundRunRecordPaths(pmRoot: string): Promise<string[]> {\n const recordsRoot = getTestRunsRecordsPath(pmRoot);\n if (!(await pathExists(recordsRoot))) {\n return [];\n }\n const entries = await fs.readdir(recordsRoot, { withFileTypes: true });\n return entries\n .filter((entry) => entry.isFile() && entry.name.endsWith(\".json\"))\n .map((entry) => path.join(recordsRoot, entry.name))\n .sort((left, right) => right.localeCompare(left));\n}\n\nfunction parseLinuxRssStatus(raw: string): number | undefined {\n const match = raw.match(/^VmRSS:\\s+(\\d+)\\s+kB$/m);\n if (!match) {\n return undefined;\n }\n return Number.parseInt(match[1], 10) * 1024;\n}\n\nasync function readLinuxRssBytes(pid: number): Promise<number | undefined> {\n if (process.platform !== \"linux\") {\n return undefined;\n }\n try {\n const raw = await fs.readFile(`/proc/${pid}/status`, \"utf8\");\n return parseLinuxRssStatus(raw);\n } catch {\n return undefined;\n }\n}\n\nfunction parseLinuxCpuStat(raw: string): { cpu_user_seconds?: number; cpu_system_seconds?: number } {\n const closeParenIndex = raw.lastIndexOf(\")\");\n if (closeParenIndex < 0) {\n return {};\n }\n const remainder = raw.slice(closeParenIndex + 2).trim();\n const parts = remainder.split(/\\s+/);\n const utimeTicks = Number.parseInt(parts[11], 10);\n const stimeTicks = Number.parseInt(parts[12], 10);\n if (!Number.isFinite(utimeTicks) || !Number.isFinite(stimeTicks)) {\n return {};\n }\n return {\n cpu_user_seconds: utimeTicks / PROC_STAT_TICKS_PER_SECOND,\n cpu_system_seconds: stimeTicks / PROC_STAT_TICKS_PER_SECOND,\n };\n}\n\nasync function readLinuxCpuSeconds(\n pid: number,\n): Promise<{ cpu_user_seconds?: number; cpu_system_seconds?: number }> {\n if (process.platform !== \"linux\") {\n return {};\n }\n try {\n const raw = await fs.readFile(`/proc/${pid}/stat`, \"utf8\");\n return parseLinuxCpuStat(raw);\n } catch {\n /* c8 ignore next -- /proc entries can disappear between liveness and stat reads. */\n return {};\n }\n}\n\nasync function buildResourceSnapshot(record: BackgroundTestRunRecord): Promise<BackgroundRunResourceSnapshot | undefined> {\n const pid = record.child_pid ?? record.worker_pid;\n if (!isPidRunning(pid)) {\n return undefined;\n }\n const rssBytes = await readLinuxRssBytes(pid as number);\n const cpu = await readLinuxCpuSeconds(pid as number);\n const startedAtMs = record.started_at ? Date.parse(record.started_at) : Number.NaN;\n const uptimeSeconds = Number.isFinite(startedAtMs) ? Math.max(0, (nowMs() - startedAtMs) / 1000) : undefined;\n return {\n recorded_at: nowIso(),\n rss_bytes: rssBytes,\n cpu_user_seconds: cpu.cpu_user_seconds,\n cpu_system_seconds: cpu.cpu_system_seconds,\n uptime_seconds: uptimeSeconds,\n };\n}\n\nfunction readCount(value: unknown): number {\n return typeof value === \"number\" && Number.isFinite(value) ? value : 0;\n}\n\nfunction evaluateWorkerResult(kind: BackgroundTestRunKind, payload: unknown): WorkerEvaluationResult {\n if (!payload || typeof payload !== \"object\") {\n return {\n summary: {\n passed: 0,\n failed: 1,\n skipped: 0,\n },\n parsedResult: null,\n };\n }\n const record = payload as Record<string, unknown>;\n if (kind === \"test-all\") {\n const totals = (record.totals ?? {}) as Record<string, unknown>;\n return {\n summary: {\n items: typeof totals.items === \"number\" ? totals.items : undefined,\n linked_tests: typeof totals.linked_tests === \"number\" ? totals.linked_tests : undefined,\n passed: readCount(totals.passed),\n failed: readCount(totals.failed),\n skipped: readCount(totals.skipped),\n fail_on_skipped_triggered: record.fail_on_skipped_triggered === true ? true : undefined,\n },\n parsedResult: payload,\n };\n }\n const runResults = Array.isArray(record.run_results) ? record.run_results : [];\n let passed = 0;\n let failed = 0;\n let skipped = 0;\n for (const entry of runResults) {\n if (!entry || typeof entry !== \"object\") {\n continue;\n }\n const status = (entry as { status?: unknown }).status;\n if (status === \"passed\") {\n passed += 1;\n continue;\n }\n if (status === \"failed\") {\n failed += 1;\n continue;\n }\n skipped += 1;\n }\n return {\n summary: {\n passed,\n failed,\n skipped,\n fail_on_skipped_triggered: record.fail_on_skipped_triggered === true ? true : undefined,\n },\n parsedResult: payload,\n };\n}\n\nfunction parseProgressLine(stderrLine: string): Partial<BackgroundRunProgress> | null {\n const line = stderrLine.trim();\n if (line.length === 0) {\n return null;\n }\n const testAllMatch = line.match(/\\[pm test-all\\]\\s+item\\s+(\\d+)\\/(\\d+)\\s+(start|end)\\s+id=([^\\s]+)/i);\n if (testAllMatch) {\n const itemIndex = Number.parseInt(testAllMatch[1], 10);\n const itemTotal = Number.parseInt(testAllMatch[2], 10);\n return {\n item_index: itemIndex,\n item_total: itemTotal,\n item_id: testAllMatch[4],\n linked_test_index: undefined,\n linked_test_total: undefined,\n current_command: undefined,\n elapsed_ms: undefined,\n heartbeat_at: nowIso(),\n phase: testAllMatch[3]?.toLowerCase() === \"end\" ? \"finished\" : \"running\",\n };\n }\n const linkedTestMatch = line.match(/\\[pm test\\]\\s+linked-test\\s+(\\d+)\\/(\\d+)\\s+(start|running|end)(?:.*elapsed_ms=(\\d+))?/i);\n if (!linkedTestMatch) {\n return null;\n }\n const index = Number.parseInt(linkedTestMatch[1], 10);\n const total = Number.parseInt(linkedTestMatch[2], 10);\n const elapsed = linkedTestMatch[4] ? Number.parseInt(linkedTestMatch[4], 10) : undefined;\n const commandMatch = line.match(/\\scommand=\"((?:\\\\.|[^\"\\\\])*)\"/);\n const currentCommand = commandMatch\n ? commandMatch[1].replaceAll('\\\\\"', '\"').replaceAll(\"\\\\\\\\\", \"\\\\\")\n : undefined;\n return {\n linked_test_index: index,\n linked_test_total: total,\n current_command: currentCommand,\n elapsed_ms: Number.isFinite(elapsed) ? elapsed : undefined,\n heartbeat_at: nowIso(),\n phase: linkedTestMatch[3]?.toLowerCase() === \"end\" ? \"finished\" : \"running\",\n };\n}\n\nfunction splitLines(value: string): string[] {\n return value\n .split(/\\r?\\n/)\n .map((entry) => entry.trimEnd())\n .filter((entry) => entry.length > 0);\n}\n\nfunction tailLines(value: string, limit: number): string[] {\n if (limit <= 0) {\n return [];\n }\n const lines = splitLines(value);\n if (lines.length <= limit) {\n return lines;\n }\n return lines.slice(lines.length - limit);\n}\n\nasync function resolveBackgroundCliEntry(cwd: string): Promise<string> {\n const configured = process.env.PM_BACKGROUND_CLI_ENTRY?.trim();\n if (configured && configured.length > 0) {\n const resolvedConfigured = path.resolve(cwd, configured);\n if (await pathExists(resolvedConfigured)) {\n return resolvedConfigured;\n }\n }\n const distEntry = path.resolve(cwd, \"dist\", \"cli.js\");\n if (await pathExists(distEntry)) {\n return distEntry;\n }\n const argvEntry = process.argv[1]?.trim();\n if (argvEntry && argvEntry.length > 0) {\n const resolvedArgvEntry = path.resolve(cwd, argvEntry);\n if (await pathExists(resolvedArgvEntry)) {\n return resolvedArgvEntry;\n }\n }\n throw new PmCliError(\n \"Unable to resolve a CLI entrypoint for background test runs. Build the project or set PM_BACKGROUND_CLI_ENTRY.\",\n EXIT_CODE.GENERIC_FAILURE,\n );\n}\n\nasync function refreshRunIfStale(pmRoot: string, record: BackgroundTestRunRecord): Promise<BackgroundTestRunRecord> {\n if (!BACKGROUND_RUN_ACTIVE_STATUSES.has(record.status)) {\n return record;\n }\n const workerAlive = isPidRunning(record.worker_pid);\n if (workerAlive) {\n return record;\n }\n if (record.finished_at) {\n return record;\n }\n const next: BackgroundTestRunRecord = {\n ...record,\n status: \"failed\",\n finished_at: nowIso(),\n error: record.error ?? \"Background test run worker exited before writing terminal status.\",\n };\n await writeBackgroundRunRecord(pmRoot, next);\n return next;\n}\n\n/**\n * Implements start background test run for the public runtime surface of this module.\n */\nexport async function startBackgroundTestRun(options: StartBackgroundTestRunOptions): Promise<StartBackgroundTestRunResult> {\n await ensureBackgroundRunStorage(options.pmRoot);\n const normalizedArgs = normalizeCommandArgs(options.commandArgs);\n if (normalizedArgs.length === 0) {\n throw new PmCliError(\"Background test run requires command arguments.\", EXIT_CODE.USAGE);\n }\n const fingerprint = buildBackgroundTestRunFingerprint(options.kind, normalizedArgs, options.pmRoot);\n const existingRuns = await listBackgroundTestRuns(options.pmRoot, {});\n for (const existing of existingRuns) {\n const refreshed = await refreshRunIfStale(options.pmRoot, existing);\n if (refreshed.fingerprint !== fingerprint) {\n continue;\n }\n if (!BACKGROUND_RUN_ACTIVE_STATUSES.has(refreshed.status) || !isPidRunning(refreshed.worker_pid)) {\n continue;\n }\n return {\n started: false,\n run: {\n ...refreshed,\n duplicate_of: refreshed.id,\n },\n duplicate_of: refreshed.id,\n };\n }\n\n const runId = buildRunId();\n const createdAt = nowIso();\n const stdoutPath = getTestRunStdoutPath(options.pmRoot, runId);\n const stderrPath = getTestRunStderrPath(options.pmRoot, runId);\n const resultPath = getTestRunResultPath(options.pmRoot, runId);\n await fs.writeFile(stdoutPath, \"\", \"utf8\");\n await fs.writeFile(stderrPath, \"\", \"utf8\");\n const record: BackgroundTestRunRecord = {\n id: runId,\n kind: options.kind,\n status: \"queued\",\n created_at: createdAt,\n updated_at: createdAt,\n requested_by: options.requestedBy,\n fingerprint,\n command_args: normalizedArgs,\n command_label: summarizeCommandLabel(normalizedArgs),\n pm_root: options.pmRoot,\n global_pm_root: options.globalPmRoot,\n target_id: options.targetId,\n status_filter: options.statusFilter,\n attempt: typeof options.attempt === \"number\" && Number.isFinite(options.attempt) && options.attempt >= 1\n ? Math.floor(options.attempt)\n : 1,\n resumed_from: options.resumedFrom,\n resumed_by: options.resumedBy,\n stdout_path: stdoutPath,\n stderr_path: stderrPath,\n result_path: resultPath,\n progress: {\n phase: \"queued\",\n message: \"Queued for background execution.\",\n heartbeat_at: createdAt,\n },\n };\n await writeBackgroundRunRecord(options.pmRoot, record);\n return {\n started: true,\n run: record,\n };\n}\n\n/**\n * Implements spawn background test run worker for the public runtime surface of this module.\n */\nexport async function spawnBackgroundTestRunWorker(options: SpawnBackgroundTestRunWorkerOptions): Promise<BackgroundTestRunRecord> {\n const record = await readBackgroundTestRunRecord(options.pmRoot, options.runId);\n if (!record) {\n throw new PmCliError(`Background test run ${options.runId} not found`, EXIT_CODE.NOT_FOUND);\n }\n if (BACKGROUND_RUN_TERMINAL_STATUSES.has(record.status)) {\n throw new PmCliError(`Background test run ${record.id} is already terminal (${record.status}).`, EXIT_CODE.CONFLICT);\n }\n const cliEntry = await resolveBackgroundCliEntry(process.cwd());\n const args: string[] = [];\n if (options.noExtensions === true) {\n args.push(\"--no-extensions\");\n }\n args.push(\"--path\", record.pm_root, \"test-runs-worker\", record.id);\n const env: NodeJS.ProcessEnv = {\n ...process.env,\n PM_PATH: record.pm_root,\n PM_GLOBAL_PATH: record.global_pm_root,\n PM_BACKGROUND_TEST_RUN_ID: record.id,\n PM_BACKGROUND_TEST_RUN_ATTEMPT: String(record.attempt),\n PM_BACKGROUND_TEST_RUN_RESUMED_FROM: record.resumed_from ?? \"\",\n FORCE_COLOR: \"0\",\n };\n const child = spawn(process.execPath, [cliEntry, ...args], {\n cwd: process.cwd(),\n env,\n detached: true,\n stdio: \"ignore\",\n windowsHide: true,\n });\n child.unref();\n const next: BackgroundTestRunRecord = {\n ...record,\n status: \"queued\",\n worker_pid: child.pid as number | undefined,\n progress: {\n phase: \"queued\",\n message: \"Worker process started.\",\n heartbeat_at: nowIso(),\n },\n };\n await writeBackgroundRunRecord(options.pmRoot, next);\n return next;\n}\n\nasync function appendFileOrdered(queue: Promise<void>, filePath: string, text: string): Promise<void> {\n await queue;\n await fs.appendFile(filePath, text, \"utf8\");\n}\n\n/**\n * Implements run background test run worker for the public runtime surface of this module.\n */\nexport async function runBackgroundTestRunWorker(pmRoot: string, runId: string, noExtensions = false): Promise<BackgroundTestRunRecord> {\n const loaded = await readBackgroundTestRunRecord(pmRoot, runId);\n if (!loaded) {\n throw new PmCliError(`Background test run ${runId} not found`, EXIT_CODE.NOT_FOUND);\n }\n const record: BackgroundTestRunRecord = {\n ...loaded,\n status: \"running\",\n started_at: loaded.started_at ?? nowIso(),\n worker_pid: process.pid,\n progress: {\n phase: \"running\",\n message: \"Worker started.\",\n heartbeat_at: nowIso(),\n },\n };\n const cliEntry = await resolveBackgroundCliEntry(process.cwd());\n const env: NodeJS.ProcessEnv = {\n ...process.env,\n PM_PATH: record.pm_root,\n PM_GLOBAL_PATH: record.global_pm_root,\n FORCE_COLOR: \"0\",\n };\n await writeBackgroundRunRecord(pmRoot, record);\n\n const childArgs = noExtensions ? [\"--no-extensions\", ...record.command_args] : [...record.command_args];\n const child = spawn(process.execPath, [cliEntry, ...childArgs], {\n cwd: process.cwd(),\n env,\n detached: false,\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n windowsHide: true,\n });\n record.child_pid = child.pid as number | undefined;\n\n let writeQueue: Promise<void> = Promise.resolve();\n const scheduleRecordWrite = (): void => {\n writeQueue = writeQueue.then(async () => {\n try {\n await writeBackgroundRunRecord(pmRoot, record);\n } catch {\n // Keep worker alive even if a single metadata write fails.\n }\n });\n };\n\n let stdoutWriteQueue: Promise<void> = Promise.resolve();\n let stderrWriteQueue: Promise<void> = Promise.resolve();\n let stdoutBuffer = \"\";\n let stderrBuffer = \"\";\n let stopRequested = false;\n\n const requestStop = async (): Promise<void> => {\n if (stopRequested) {\n return;\n }\n stopRequested = true;\n record.stop_requested_at = nowIso();\n record.progress = {\n ...record.progress,\n phase: \"stopping\",\n message: \"Stop requested for background run.\",\n heartbeat_at: nowIso(),\n };\n scheduleRecordWrite();\n try {\n child.kill(\"SIGTERM\");\n } catch {\n // Child may already be gone.\n }\n const forceKillDelayMs = Number.parseInt(process.env.PM_BACKGROUND_RUN_FORCE_KILL_DELAY_MS ?? \"\", 10);\n const delay = Number.isFinite(forceKillDelayMs) && forceKillDelayMs > 0\n ? forceKillDelayMs\n : DEFAULT_BACKGROUND_RUN_FORCE_KILL_DELAY_MS;\n const forceTimer = setTimeout(() => {\n try {\n child.kill(\"SIGKILL\");\n } catch {\n // Child may already be gone.\n }\n }, delay);\n forceTimer.unref?.();\n };\n\n const onSignal = (): void => {\n void requestStop();\n };\n process.on(\"SIGTERM\", onSignal);\n process.on(\"SIGINT\", onSignal);\n\n const resourceIntervalMs = Number.parseInt(process.env.PM_BACKGROUND_RUN_RESOURCE_INTERVAL_MS ?? \"\", 10);\n const resourceInterval = Number.isFinite(resourceIntervalMs) && resourceIntervalMs > 0\n ? resourceIntervalMs\n : DEFAULT_BACKGROUND_RUN_RESOURCE_SNAPSHOT_INTERVAL_MS;\n const resourceTimer = setInterval(() => {\n void (async () => {\n record.resource = await buildResourceSnapshot(record);\n (record.progress as BackgroundRunProgress).heartbeat_at = nowIso();\n scheduleRecordWrite();\n })();\n }, resourceInterval);\n resourceTimer.unref?.();\n\n child.stdout?.on(\"data\", (chunk) => {\n const text = chunk.toString(\"utf8\");\n stdoutBuffer += text;\n stdoutWriteQueue = appendFileOrdered(stdoutWriteQueue, record.stdout_path, text);\n });\n\n const applyProgressLine = (line: string): boolean => {\n const progressPatch = parseProgressLine(line);\n if (!progressPatch) {\n return false;\n }\n if (progressPatch.item_id) {\n record.progress = {\n phase: (record.progress as BackgroundRunProgress).phase === \"stopping\" ? \"stopping\" : \"running\",\n message: line,\n heartbeat_at: nowIso(),\n item_index: progressPatch.item_index,\n item_total: progressPatch.item_total,\n item_id: progressPatch.item_id,\n linked_test_index: undefined,\n linked_test_total: undefined,\n current_command: undefined,\n elapsed_ms: undefined,\n };\n return true;\n }\n record.progress = {\n phase: (record.progress as BackgroundRunProgress).phase === \"stopping\" ? \"stopping\" : \"running\",\n message: line,\n heartbeat_at: nowIso(),\n item_index: progressPatch.item_index ?? record.progress?.item_index,\n item_total: progressPatch.item_total ?? record.progress?.item_total,\n item_id: progressPatch.item_id ?? record.progress?.item_id,\n linked_test_index: progressPatch.linked_test_index,\n linked_test_total: progressPatch.linked_test_total,\n current_command: progressPatch.current_command,\n elapsed_ms: progressPatch.elapsed_ms,\n };\n if (progressPatch.phase === \"finished\" && !stopRequested) {\n record.progress.phase = \"running\";\n }\n return true;\n };\n\n child.stderr?.on(\"data\", (chunk) => {\n const text = chunk.toString(\"utf8\");\n stderrWriteQueue = appendFileOrdered(stderrWriteQueue, record.stderr_path, text);\n stderrBuffer += text;\n const parts = stderrBuffer.split(/\\r?\\n/);\n stderrBuffer = parts.pop()!;\n let progressChanged = false;\n for (const part of parts) {\n const line = part.trimEnd();\n if (line.length > 0 && applyProgressLine(line)) {\n progressChanged = true;\n }\n }\n if (progressChanged) {\n scheduleRecordWrite();\n }\n });\n\n let exitCode: number | null = null;\n let signal: NodeJS.Signals | null = null;\n try {\n ({ code: exitCode, signal } = await new Promise<{ code: number | null; signal: NodeJS.Signals | null }>((resolve) => {\n child.on(\"close\", (code, closeSignal) => {\n resolve({ code, signal: closeSignal });\n });\n }));\n } finally {\n clearInterval(resourceTimer);\n process.off(\"SIGTERM\", onSignal);\n process.off(\"SIGINT\", onSignal);\n }\n\n await stdoutWriteQueue;\n await stderrWriteQueue;\n const trailingStderrLine = stderrBuffer.trimEnd();\n if (trailingStderrLine.length > 0 && applyProgressLine(trailingStderrLine)) {\n scheduleRecordWrite();\n }\n stderrBuffer = \"\";\n\n let parsedResult: unknown | null = null;\n if (stdoutBuffer.trim().length > 0) {\n try {\n parsedResult = JSON.parse(stdoutBuffer);\n } catch {\n parsedResult = null;\n }\n }\n const evaluated = evaluateWorkerResult(record.kind, parsedResult);\n record.summary = evaluated.summary;\n record.exit_code = typeof exitCode === \"number\" ? exitCode : undefined;\n record.signal = signal ?? undefined;\n record.finished_at = nowIso();\n record.status = stopRequested\n ? \"stopped\"\n : (record.exit_code === 0 &&\n (record.summary.failed ?? 0) === 0 &&\n record.summary.fail_on_skipped_triggered !== true)\n ? \"passed\"\n : \"failed\";\n record.progress = {\n phase: \"finished\",\n message: stopRequested ? \"Background run stopped.\" : `Background run finished with status=${record.status}.`,\n heartbeat_at: nowIso(),\n item_index: record.progress?.item_index,\n item_total: record.progress?.item_total,\n item_id: record.progress?.item_id,\n linked_test_index: record.progress?.linked_test_index,\n linked_test_total: record.progress?.linked_test_total,\n current_command: record.progress?.current_command,\n elapsed_ms: record.progress?.elapsed_ms,\n };\n record.resource = await buildResourceSnapshot(record);\n if (parsedResult !== null) {\n await writeFileAtomic(record.result_path, `${JSON.stringify(parsedResult, null, 2)}\\n`);\n } else {\n await writeFileAtomic(\n record.result_path,\n `${JSON.stringify(\n {\n parse_error: \"Background run output was not valid JSON.\",\n stdout_excerpt: tailLines(stdoutBuffer, DEFAULT_BACKGROUND_RUN_LOG_TAIL_LINES),\n },\n null,\n 2,\n )}\\n`,\n );\n }\n await writeBackgroundRunRecord(pmRoot, record);\n await writeQueue;\n return record;\n}\n\n/**\n * Implements list background test runs for the public runtime surface of this module.\n */\nexport async function listBackgroundTestRuns(\n pmRoot: string,\n options: ListBackgroundTestRunOptions,\n): Promise<BackgroundTestRunRecord[]> {\n const recordPaths = await listBackgroundRunRecordPaths(pmRoot);\n const runs: BackgroundTestRunRecord[] = [];\n for (const recordPath of recordPaths) {\n const raw = await readFileIfExists(recordPath);\n if (!raw) {\n continue;\n }\n const parsed = await parseBackgroundRunRecord(raw, recordPath);\n runs.push(parsed);\n }\n const refreshed: BackgroundTestRunRecord[] = [];\n for (const run of runs) {\n refreshed.push(await refreshRunIfStale(pmRoot, run));\n }\n const filtered = options.status ? refreshed.filter((entry) => entry.status === options.status) : refreshed;\n const sorted = filtered.sort((left, right) => {\n const byUpdated = Date.parse(right.updated_at) - Date.parse(left.updated_at);\n if (Number.isFinite(byUpdated) && byUpdated !== 0) {\n return byUpdated;\n }\n return right.id.localeCompare(left.id);\n });\n const limit = typeof options.limit === \"number\" && options.limit >= 0 ? options.limit : undefined;\n return limit === undefined ? sorted : sorted.slice(0, limit);\n}\n\n/**\n * Implements get background test run status for the public runtime surface of this module.\n */\nexport async function getBackgroundTestRunStatus(pmRoot: string, runId: string): Promise<BackgroundRunStatusView> {\n const loaded = await readBackgroundTestRunRecord(pmRoot, runId);\n if (!loaded) {\n throw new PmCliError(`Background test run ${runId} not found`, EXIT_CODE.NOT_FOUND);\n }\n const refreshed = await refreshRunIfStale(pmRoot, loaded);\n const workerAlive = isPidRunning(refreshed.worker_pid);\n const childAlive = isPidRunning(refreshed.child_pid);\n if (refreshed.status === \"running\" && !childAlive && !refreshed.finished_at && !workerAlive) {\n refreshed.status = \"failed\";\n refreshed.finished_at = nowIso();\n refreshed.error = refreshed.error ?? \"Background run process exited unexpectedly.\";\n await writeBackgroundRunRecord(pmRoot, refreshed);\n }\n if (refreshed.status === \"running\") {\n refreshed.resource = await buildResourceSnapshot(refreshed);\n await writeBackgroundRunRecord(pmRoot, refreshed);\n }\n const heartbeatAt = refreshed.progress?.heartbeat_at;\n const heartbeatAtMs = heartbeatAt ? Date.parse(heartbeatAt) : Number.NaN;\n const lagMs = Number.isFinite(heartbeatAtMs) ? Math.max(0, nowMs() - heartbeatAtMs) : undefined;\n const staleMs = Number.parseInt(process.env.PM_BACKGROUND_RUN_HEARTBEAT_STALE_MS ?? \"\", 10);\n const staleThresholdMs = Number.isFinite(staleMs) && staleMs > 0 ? staleMs : DEFAULT_BACKGROUND_RUN_HEARTBEAT_STALE_MS;\n const healthState = refreshed.status === \"running\"\n ? lagMs !== undefined && lagMs > staleThresholdMs\n ? \"stale\"\n : \"healthy\"\n : \"inactive\";\n return {\n run: refreshed,\n health: {\n state: healthState,\n last_heartbeat_at: heartbeatAt,\n heartbeat_lag_ms: lagMs,\n worker_alive: workerAlive,\n child_alive: childAlive,\n },\n };\n}\n\n/**\n * Implements stop background test run for the public runtime surface of this module.\n */\nexport async function stopBackgroundTestRun(pmRoot: string, runId: string, force = false): Promise<StopBackgroundTestRunResult> {\n const loaded = await readBackgroundTestRunRecord(pmRoot, runId);\n if (!loaded) {\n throw new PmCliError(`Background test run ${runId} not found`, EXIT_CODE.NOT_FOUND);\n }\n const refreshed = await refreshRunIfStale(pmRoot, loaded);\n if (BACKGROUND_RUN_TERMINAL_STATUSES.has(refreshed.status)) {\n return {\n run: refreshed,\n signal_sent: \"none\",\n };\n }\n let signalSent: \"SIGTERM\" | \"SIGKILL\" | \"none\" = \"none\";\n const signal: NodeJS.Signals = force ? \"SIGKILL\" : \"SIGTERM\";\n if (isPidRunning(refreshed.worker_pid) && refreshed.worker_pid) {\n try {\n process.kill(refreshed.worker_pid, signal);\n signalSent = signal;\n } catch {\n signalSent = \"none\";\n }\n }\n if (signalSent === \"none\") {\n refreshed.status = \"stopped\";\n refreshed.finished_at = refreshed.finished_at ?? nowIso();\n }\n refreshed.stop_requested_at = nowIso();\n refreshed.progress = {\n phase: \"stopping\",\n message: signalSent === \"none\" ? \"Run marked stopped.\" : `Stop requested via ${signalSent}.`,\n heartbeat_at: nowIso(),\n item_index: refreshed.progress?.item_index,\n item_total: refreshed.progress?.item_total,\n item_id: refreshed.progress?.item_id,\n linked_test_index: refreshed.progress?.linked_test_index,\n linked_test_total: refreshed.progress?.linked_test_total,\n current_command: refreshed.progress?.current_command,\n elapsed_ms: refreshed.progress?.elapsed_ms,\n };\n await writeBackgroundRunRecord(pmRoot, refreshed);\n return {\n run: refreshed,\n signal_sent: signalSent,\n };\n}\n\n/**\n * Implements resume background test run for the public runtime surface of this module.\n */\nexport async function resumeBackgroundTestRun(\n pmRoot: string,\n runId: string,\n requestedBy: string,\n noExtensions = false,\n): Promise<BackgroundTestRunRecord> {\n const loaded = await readBackgroundTestRunRecord(pmRoot, runId);\n if (!loaded) {\n throw new PmCliError(`Background test run ${runId} not found`, EXIT_CODE.NOT_FOUND);\n }\n const refreshed = await refreshRunIfStale(pmRoot, loaded);\n if (!BACKGROUND_RUN_TERMINAL_STATUSES.has(refreshed.status)) {\n throw new PmCliError(`Background test run ${runId} is not terminal and cannot be resumed.`, EXIT_CODE.CONFLICT);\n }\n const started = await startBackgroundTestRun({\n pmRoot: refreshed.pm_root,\n globalPmRoot: refreshed.global_pm_root,\n kind: refreshed.kind,\n commandArgs: refreshed.command_args,\n requestedBy,\n targetId: refreshed.target_id,\n statusFilter: refreshed.status_filter,\n resumedFrom: refreshed.id,\n resumedBy: requestedBy,\n attempt: refreshed.attempt + 1,\n });\n if (!started.started) {\n return started.run;\n }\n const spawned = await spawnBackgroundTestRunWorker({\n pmRoot,\n runId: started.run.id,\n noExtensions,\n });\n const prior: BackgroundTestRunRecord = {\n ...refreshed,\n resumed_by: spawned.id,\n };\n await writeBackgroundRunRecord(pmRoot, prior);\n return spawned;\n}\n\n/**\n * Implements read background test run logs for the public runtime surface of this module.\n */\nexport async function readBackgroundTestRunLogs(\n pmRoot: string,\n runId: string,\n stream: BackgroundLogStream,\n tail: number | undefined,\n): Promise<BackgroundRunLogsResult> {\n const loaded = await readBackgroundTestRunRecord(pmRoot, runId);\n if (!loaded) {\n throw new PmCliError(`Background test run ${runId} not found`, EXIT_CODE.NOT_FOUND);\n }\n const resolvedTail = typeof tail === \"number\" && Number.isFinite(tail) && tail >= 0 ? Math.floor(tail) : DEFAULT_BACKGROUND_RUN_LOG_TAIL_LINES;\n const stdoutRaw = stream === \"stdout\" || stream === \"both\" ? (await readFileIfExists(loaded.stdout_path)) ?? \"\" : \"\";\n const stderrRaw = stream === \"stderr\" || stream === \"both\" ? (await readFileIfExists(loaded.stderr_path)) ?? \"\" : \"\";\n return {\n run: loaded,\n stream,\n tail: resolvedTail,\n stdout: stream === \"stdout\" || stream === \"both\" ? tailLines(stdoutRaw, resolvedTail) : [],\n stderr: stream === \"stderr\" || stream === \"both\" ? tailLines(stderrRaw, resolvedTail) : [],\n };\n}\n\nexport const _testOnly = {\n buildResourceSnapshot,\n evaluateWorkerResult,\n isPidRunning,\n parseLinuxCpuStat,\n parseLinuxRssStatus,\n parseProgressLine,\n readLinuxCpuSeconds,\n readLinuxRssBytes,\n refreshRunIfStale,\n splitLines,\n tailLines,\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,OAAO,QAAQ;;;ACAf,OAAO,QAAQ;AACf,SAAS,aAAa;AACtB,SAAS,YAAY,mBAAmB;AACxC,OAAO,UAAU;AAiBjB,IAAM,iCAAiC,oBAAI,IAA6B,CAAC,UAAU,SAAS,CAAC;AAC7F,IAAM,mCAAmC,oBAAI,IAA6B,CAAC,UAAU,UAAU,WAAW,UAAU,CAAC;AACrH,IAAM,uDAAuD;AAC7D,IAAM,6CAA6C;AACnD,IAAM,4CAA4C;AAClD,IAAM,wCAAwC;AAC9C,IAAM,6BAA6B;AAkLnC,SAAS,QAAK;AACZ,SAAO,KAAK,IAAG;AACjB;AAEA,SAAS,qBAAqB,MAAc;AAC1C,SAAO,KAAK,IAAI,CAAC,UAAU,MAAM,KAAI,CAAE,EAAE,OAAO,CAAC,UAAU,MAAM,SAAS,CAAC;AAC7E;AAEA,SAAS,sBAAsB,MAAc;AAC3C,QAAM,SAAS,KAAK,KAAK,GAAG,EAAE,WAAW,QAAQ,GAAG,EAAE,KAAI;AAC1D,MAAI,OAAO,UAAU,KAAK;AACxB,WAAO;EACT;AACA,SAAO,GAAG,OAAO,MAAM,GAAG,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
+ import {
2
+ _testOnlyUpdateCommand,
3
+ runUpdate
4
+ } from "./chunk-NUHHPVVS.js";
5
+ import "./chunk-CZVISY5A.js";
6
+ import "./chunk-VARHOHYV.js";
7
+ import "./chunk-HYTGA6GI.js";
8
+ import "./chunk-DDPTYJIM.js";
9
+ import "./chunk-IJYK2T43.js";
10
+ import "./chunk-RGEMWD6Q.js";
11
+ import "./chunk-HPPFYYOV.js";
12
+ import "./chunk-JPECA746.js";
13
+ import "./chunk-5HIZDR5A.js";
14
+ import "./chunk-LB6TP6MC.js";
15
+ import "./chunk-BDTISOSD.js";
16
+ import "./chunk-3K2M5OYU.js";
17
+ import "./chunk-BHO33VBQ.js";
18
+ import "./chunk-WYDHYJPO.js";
19
+ import "./chunk-RVUALSJF.js";
20
+ export {
21
+ _testOnlyUpdateCommand,
22
+ runUpdate
23
+ };
24
+ //# sourceMappingURL=update-AMRSOIWP.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,28 @@
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]="45eac7fa-f181-5cca-93b7-cfb58909dbb3")}catch(e){}}();
3
+ import {
4
+ _testOnlyUpdateCommand,
5
+ runUpdate
6
+ } from "./chunk-ZETXE4SE.js";
7
+ import "./chunk-YJIEJRZB.js";
8
+ import "./chunk-4XOIEKSD.js";
9
+ import "./chunk-EJUDVUYZ.js";
10
+ import "./chunk-ZRP4VG5U.js";
11
+ import "./chunk-N74UMG5H.js";
12
+ import "./chunk-TP5Q5ZD3.js";
13
+ import "./chunk-NOLPZMSV.js";
14
+ import "./chunk-HZZEHPRG.js";
15
+ import "./chunk-P4SESZGT.js";
16
+ import "./chunk-MAUKX7JC.js";
17
+ import "./chunk-NWMZWYYB.js";
18
+ import "./chunk-JSU5P7VS.js";
19
+ import "./chunk-QCWF6IYD.js";
20
+ import "./chunk-AXIDKKAT.js";
21
+ import "./chunk-7R4QEMZZ.js";
22
+ export {
23
+ _testOnlyUpdateCommand,
24
+ runUpdate
25
+ };
26
+ //# sourceMappingURL=update-KFX2SIAC.js.map
27
+
28
+ //# debugId=45eac7fa-f181-5cca-93b7-cfb58909dbb3
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","debugId":"45eac7fa-f181-5cca-93b7-cfb58909dbb3"}
@@ -1,64 +1,61 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2fabaef7-aade-56d4-8f41-ca0be6201131")}catch(e){}}();
3
- import {
4
- runUpdate
5
- } from "./chunk-LNEDHJNQ.js";
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]="2b769efb-45c3-5020-94d3-a19d1504b090")}catch(e){}}();
6
3
  import {
7
4
  createCheckpointId,
8
5
  loadMutationCheckpoint,
9
6
  restoreCheckpointItems,
10
7
  writeMutationCheckpoint
11
- } from "./chunk-3BKH2CL3.js";
12
- import "./chunk-SUREE24M.js";
8
+ } from "./chunk-L5OEFZQG.js";
13
9
  import {
14
- runRestore
15
- } from "./chunk-RRP6D345.js";
16
- import {
17
- resolveAuthor
18
- } from "./chunk-T5RRNDA7.js";
19
- import "./chunk-MWMHZOZZ.js";
20
- import "./chunk-WB5BYQMF.js";
10
+ runUpdate
11
+ } from "./chunk-ZETXE4SE.js";
12
+ import "./chunk-YJIEJRZB.js";
21
13
  import {
22
14
  resolvePriority
23
- } from "./chunk-IAP5KYBQ.js";
24
- import "./chunk-AYPQUFCX.js";
15
+ } from "./chunk-4XOIEKSD.js";
16
+ import "./chunk-EJUDVUYZ.js";
25
17
  import {
26
18
  applyTagRemovals,
27
19
  mergeAdditiveTags,
28
20
  parseTags
29
- } from "./chunk-KIEAK7YE.js";
30
- import "./chunk-5S4ZGDB2.js";
31
- import "./chunk-2WCYE3IF.js";
21
+ } from "./chunk-ZRP4VG5U.js";
22
+ import "./chunk-N74UMG5H.js";
23
+ import "./chunk-TP5Q5ZD3.js";
32
24
  import {
33
- buildInvalidTypeError
34
- } from "./chunk-TSI32UEL.js";
35
- import "./chunk-JPJDP4VU.js";
25
+ runRestore
26
+ } from "./chunk-CF7RL6FR.js";
27
+ import {
28
+ resolveAuthor
29
+ } from "./chunk-T5RRNDA7.js";
36
30
  import {
37
31
  hasListFilters
38
- } from "./chunk-W2VMLL5S.js";
32
+ } from "./chunk-VY3VQ22F.js";
33
+ import "./chunk-NOLPZMSV.js";
34
+ import "./chunk-OGXLACHC.js";
35
+ import "./chunk-SLMUGTK3.js";
36
+ import "./chunk-HZZEHPRG.js";
39
37
  import "./chunk-P4SESZGT.js";
38
+ import {
39
+ buildInvalidTypeError
40
+ } from "./chunk-MAUKX7JC.js";
41
+ import "./chunk-NWMZWYYB.js";
40
42
  import {
41
43
  runList
42
- } from "./chunk-BFFO3AIB.js";
44
+ } from "./chunk-5CGRF3L5.js";
43
45
  import "./chunk-QB7XMHJW.js";
44
- import "./chunk-5BBEWX6C.js";
45
- import "./chunk-V4UYNSEM.js";
46
+ import "./chunk-3VGN2UWE.js";
47
+ import "./chunk-UZIWVBE6.js";
46
48
  import {
47
49
  toItemRecord
48
- } from "./chunk-KJZOSF7J.js";
49
- import "./chunk-FBLT6WGK.js";
50
+ } from "./chunk-JSU5P7VS.js";
50
51
  import {
51
52
  collectRuntimeUpdateFieldValues,
52
53
  normalizeStatusInput
53
- } from "./chunk-ZLWRPBOW.js";
54
- import {
55
- resolveItemTypeRegistry,
56
- resolveTypeName
57
- } from "./chunk-TKPP4GOO.js";
54
+ } from "./chunk-QCWF6IYD.js";
58
55
  import {
59
56
  nowIso,
60
57
  resolveIsoOrRelative
61
- } from "./chunk-FMWW2JDU.js";
58
+ } from "./chunk-AXIDKKAT.js";
62
59
  import {
63
60
  EXIT_CODE,
64
61
  PmCliError,
@@ -66,13 +63,15 @@ import {
66
63
  getSettingsPath,
67
64
  pathExists,
68
65
  readSettings,
66
+ resolveItemTypeRegistry,
69
67
  resolveItemTypesFilePath,
70
68
  resolvePmRoot,
71
69
  resolveRuntimeFieldRegistry,
72
70
  resolveRuntimeStatusRegistry,
71
+ resolveTypeName,
73
72
  stableValueEquals,
74
73
  toErrorMessage
75
- } from "./chunk-VSAABFGQ.js";
74
+ } from "./chunk-7R4QEMZZ.js";
76
75
 
77
76
  // dist/cli/commands/update-many.js
78
77
  var UPDATE_MANY_CHECKPOINT_SCHEMA_VERSION = 1;
@@ -646,6 +645,6 @@ export {
646
645
  _testOnlyUpdateManyCommand,
647
646
  runUpdateMany
648
647
  };
649
- //# sourceMappingURL=update-many-Q5ZEI64S.js.map
648
+ //# sourceMappingURL=update-many-RNSBX2TA.js.map
650
649
 
651
- //# debugId=2fabaef7-aade-56d4-8f41-ca0be6201131
650
+ //# debugId=2b769efb-45c3-5020-94d3-a19d1504b090
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../../cli/commands/update-many.ts"],"sourcesContent":["/**\n * @module cli/commands/update-many\n *\n * Implements the pm update many command surface and its agent-facing runtime behavior.\n */\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport {\n createCheckpointId,\n loadMutationCheckpoint,\n restoreCheckpointItems,\n writeMutationCheckpoint,\n type MutationCheckpointItem,\n} from \"../../core/checkpoint/mutation-checkpoint.js\";\nimport { toItemRecord } from \"../../core/item/item-record.js\";\nimport { applyTagRemovals, mergeAdditiveTags, parseTags } from \"../../core/item/parse.js\";\nimport { resolvePriority } from \"../../core/item/priority.js\";\nimport { normalizeStatusInput } from \"../../core/item/status.js\";\nimport { resolveItemTypeRegistry, resolveTypeName } from \"../../core/item/type-registry.js\";\nimport { collectRuntimeUpdateFieldValues } from \"../../core/schema/runtime-field-values.js\";\nimport { buildInvalidTypeError } from \"../../core/schema/item-types-file.js\";\nimport {\n resolveItemTypesFilePath,\n resolveRuntimeFieldRegistry,\n resolveRuntimeStatusRegistry,\n type RuntimeFieldRegistry,\n type RuntimeStatusRegistry,\n} from \"../../core/schema/runtime-schema.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { toErrorMessage } from \"../../core/shared/primitives.js\";\nimport { stableValueEquals } from \"../../core/shared/serialization.js\";\nimport { nowIso, resolveIsoOrRelative } from \"../../core/shared/time.js\";\nimport { getActiveExtensionRegistrations } from \"../../core/extensions/index.js\";\nimport type { PmSettings } from \"../../types/index.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport { resolveAuthor } from \"../../core/shared/author.js\";\nimport type { ItemStatus } from \"../../types/index.js\";\nimport { hasListFilters } from \"./list-filter-shared.js\";\nimport { runList, type ListOptions, type ListedItem } from \"./list.js\";\nimport { runRestore } from \"./restore.js\";\nimport { runUpdate, type UpdateCommandOptions } from \"./update.js\";\n\nconst UPDATE_MANY_CHECKPOINT_SCHEMA_VERSION = 1;\nconst UPDATE_MANY_CHECKPOINT_SUBDIR = \"update-many\";\n\nconst NON_MUTATION_UPDATE_OPTION_KEYS = new Set<keyof UpdateCommandOptions>([\n \"author\",\n \"message\",\n \"force\",\n \"allowAuditUpdate\",\n \"allowAuditDepUpdate\",\n]);\n\nconst UPDATE_MANY_MUTATION_FLAG_GUIDANCE = [\n \"--status\",\n \"--priority\",\n \"--type\",\n \"--tags\",\n \"--description\",\n \"--body\",\n \"--deadline\",\n \"--estimate\",\n \"--assignee\",\n \"--dep\",\n \"--dep-remove\",\n \"--comment\",\n \"--note\",\n \"--learning\",\n \"--file\",\n \"--test\",\n \"--doc\",\n \"--replace-deps\",\n \"--replace-tests\",\n \"--unset\",\n \"--clear-*\",\n].join(\", \");\n\nconst UPDATE_OPTION_TO_ITEM_KEY: Partial<Record<keyof UpdateCommandOptions, string>> = {\n title: \"title\",\n description: \"description\",\n body: \"body\",\n status: \"status\",\n closeReason: \"close_reason\",\n priority: \"priority\",\n type: \"type\",\n deadline: \"deadline\",\n estimatedMinutes: \"estimated_minutes\",\n acceptanceCriteria: \"acceptance_criteria\",\n definitionOfReady: \"definition_of_ready\",\n order: \"order\",\n goal: \"goal\",\n objective: \"objective\",\n value: \"value\",\n impact: \"impact\",\n outcome: \"outcome\",\n whyNow: \"why_now\",\n assignee: \"assignee\",\n parent: \"parent\",\n reviewer: \"reviewer\",\n risk: \"risk\",\n confidence: \"confidence\",\n sprint: \"sprint\",\n release: \"release\",\n blockedBy: \"blocked_by\",\n blockedReason: \"blocked_reason\",\n unblockNote: \"unblock_note\",\n reporter: \"reporter\",\n severity: \"severity\",\n environment: \"environment\",\n reproSteps: \"repro_steps\",\n resolution: \"resolution\",\n expectedResult: \"expected_result\",\n actualResult: \"actual_result\",\n affectedVersion: \"affected_version\",\n fixedVersion: \"fixed_version\",\n component: \"component\",\n regression: \"regression\",\n customerImpact: \"customer_impact\",\n};\n\ninterface CollectionMutationPlanDefinition {\n field: string;\n addKey: keyof UpdateCommandOptions;\n removeKey?: keyof UpdateCommandOptions;\n clearKey: keyof UpdateCommandOptions;\n replaceKey?: keyof UpdateCommandOptions;\n}\n\nconst COLLECTION_MUTATION_PLAN_DEFINITIONS: CollectionMutationPlanDefinition[] = [\n {\n field: \"dependencies\",\n addKey: \"dep\",\n removeKey: \"depRemove\",\n clearKey: \"clearDeps\",\n replaceKey: \"replaceDeps\",\n },\n {\n field: \"comments\",\n addKey: \"comment\",\n clearKey: \"clearComments\",\n },\n {\n field: \"notes\",\n addKey: \"note\",\n clearKey: \"clearNotes\",\n },\n {\n field: \"learnings\",\n addKey: \"learning\",\n clearKey: \"clearLearnings\",\n },\n {\n field: \"files\",\n addKey: \"file\",\n clearKey: \"clearFiles\",\n },\n {\n field: \"tests\",\n addKey: \"test\",\n clearKey: \"clearTests\",\n replaceKey: \"replaceTests\",\n },\n {\n field: \"docs\",\n addKey: \"doc\",\n clearKey: \"clearDocs\",\n },\n {\n field: \"reminders\",\n addKey: \"reminder\",\n clearKey: \"clearReminders\",\n },\n {\n field: \"events\",\n addKey: \"event\",\n clearKey: \"clearEvents\",\n },\n {\n field: \"type_options\",\n addKey: \"typeOption\",\n clearKey: \"clearTypeOptions\",\n },\n];\n\nconst UNSET_FIELD_ALIASES: Record<string, string> = {\n close_reason: \"close_reason\",\n \"close-reason\": \"close_reason\",\n deadline: \"deadline\",\n estimate: \"estimated_minutes\",\n estimated_minutes: \"estimated_minutes\",\n \"estimated-minutes\": \"estimated_minutes\",\n acceptance_criteria: \"acceptance_criteria\",\n \"acceptance-criteria\": \"acceptance_criteria\",\n ac: \"acceptance_criteria\",\n definition_of_ready: \"definition_of_ready\",\n \"definition-of-ready\": \"definition_of_ready\",\n order: \"order\",\n rank: \"order\",\n goal: \"goal\",\n objective: \"objective\",\n value: \"value\",\n impact: \"impact\",\n outcome: \"outcome\",\n why_now: \"why_now\",\n \"why-now\": \"why_now\",\n assignee: \"assignee\",\n parent: \"parent\",\n reviewer: \"reviewer\",\n risk: \"risk\",\n confidence: \"confidence\",\n sprint: \"sprint\",\n release: \"release\",\n blocked_by: \"blocked_by\",\n \"blocked-by\": \"blocked_by\",\n blocked_reason: \"blocked_reason\",\n \"blocked-reason\": \"blocked_reason\",\n unblock_note: \"unblock_note\",\n \"unblock-note\": \"unblock_note\",\n reporter: \"reporter\",\n severity: \"severity\",\n environment: \"environment\",\n repro_steps: \"repro_steps\",\n \"repro-steps\": \"repro_steps\",\n resolution: \"resolution\",\n expected_result: \"expected_result\",\n \"expected-result\": \"expected_result\",\n actual_result: \"actual_result\",\n \"actual-result\": \"actual_result\",\n affected_version: \"affected_version\",\n \"affected-version\": \"affected_version\",\n fixed_version: \"fixed_version\",\n \"fixed-version\": \"fixed_version\",\n component: \"component\",\n regression: \"regression\",\n customer_impact: \"customer_impact\",\n \"customer-impact\": \"customer_impact\",\n type_options: \"type_options\",\n \"type-options\": \"type_options\",\n tags: \"tags\",\n};\n\ninterface UpdateManyCheckpoint {\n schema_version: number;\n id: string;\n created_at: string;\n author: string;\n status_filter: string | null;\n list_filters: Record<string, unknown>;\n update_options: Record<string, unknown>;\n items: MutationCheckpointItem[];\n}\n\n/**\n * Documents the update many command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface UpdateManyCommandOptions {\n status?: string;\n list: ListOptions;\n update: UpdateCommandOptions;\n dryRun?: boolean;\n rollback?: string;\n checkpoint?: boolean;\n}\n\ninterface PlannedChange {\n field: string;\n before: unknown;\n after: unknown;\n}\n\ninterface PlannedItemDiff {\n id: string;\n changes: PlannedChange[];\n}\n\ninterface UpdateManyApplyResultRow {\n id: string;\n status: \"updated\" | \"failed\" | \"skipped\";\n changed_fields?: string[];\n warnings?: string[];\n error?: string;\n}\n\ninterface UpdateManyRollbackResultRow {\n id: string;\n status: \"restored\" | \"failed\";\n changed_fields?: string[];\n warnings?: string[];\n error?: string;\n}\n\n/**\n * Documents the update many result payload exchanged by command, SDK, and package integrations.\n */\nexport interface UpdateManyResult {\n mode: \"dry_run\" | \"apply\" | \"rollback\";\n matched_count: number;\n dry_run: boolean;\n filters?: Record<string, unknown>;\n planned_update_options?: Record<string, unknown>;\n item_plans?: PlannedItemDiff[];\n checkpoint?: {\n id: string;\n created_at: string;\n path: string;\n rollback_command: string;\n };\n updated_count?: number;\n skipped_count?: number;\n failed_count?: number;\n restored_count?: number;\n rollback_checkpoint_id?: string;\n rows?: UpdateManyApplyResultRow[] | UpdateManyRollbackResultRow[];\n ids: string[];\n}\n\nfunction sanitizeUpdateOptionsForSummary(options: UpdateCommandOptions): Record<string, unknown> {\n const summary: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(options) as Array<[keyof UpdateCommandOptions, unknown]>) {\n if (NON_MUTATION_UPDATE_OPTION_KEYS.has(key)) {\n continue;\n }\n if (value === undefined) {\n continue;\n }\n summary[key] = value;\n }\n return summary;\n}\n\nfunction hasAnyUpdateMutationInput(options: UpdateCommandOptions): boolean {\n return Object.keys(sanitizeUpdateOptionsForSummary(options)).length > 0;\n}\n\nfunction toComparablePreviewValue(optionKey: keyof UpdateCommandOptions, value: unknown): unknown {\n if (value === undefined) {\n return undefined;\n }\n if (optionKey === \"priority\") {\n const parsed = Number(String(value).trim());\n return Number.isInteger(parsed) ? parsed : String(value).trim();\n }\n if (optionKey === \"estimatedMinutes\" || optionKey === \"order\" || optionKey === \"rank\") {\n const parsed = Number(String(value).trim());\n return Number.isFinite(parsed) ? parsed : String(value).trim();\n }\n if (optionKey === \"regression\") {\n const normalized = String(value).trim().toLowerCase();\n if (normalized === \"true\" || normalized === \"1\") {\n return true;\n }\n if (normalized === \"false\" || normalized === \"0\") {\n return false;\n }\n }\n if (typeof value === \"string\") {\n return value.trim();\n }\n return value;\n}\n\nfunction normalizeUnsetField(rawField: string): string {\n const normalized = rawField.trim().toLowerCase().replaceAll(\"-\", \"_\");\n return UNSET_FIELD_ALIASES[normalized] ?? normalized;\n}\n\nfunction areValuesEqual(left: unknown, right: unknown): boolean {\n return stableValueEquals(left, right);\n}\n\nfunction normalizeCollectionBeforeValue(field: string, value: unknown): unknown {\n if (value !== undefined) {\n return value;\n }\n if (field === \"type_options\") {\n return {};\n }\n return [];\n}\n\nfunction collectionValueCount(field: string, value: unknown): number {\n if (Array.isArray(value)) {\n return value.length;\n }\n if (field === \"type_options\" && value && typeof value === \"object\") {\n return Object.keys(value as Record<string, unknown>).length;\n }\n return 0;\n}\n\nfunction buildCollectionMutationPlans(row: Record<string, unknown>, update: UpdateCommandOptions): PlannedChange[] {\n const changes: PlannedChange[] = [];\n for (const definition of COLLECTION_MUTATION_PLAN_DEFINITIONS) {\n const addValues = update[definition.addKey];\n const removeValues = definition.removeKey ? update[definition.removeKey] : undefined;\n const addCount = Array.isArray(addValues) ? addValues.length : 0;\n const removeCount = Array.isArray(removeValues) ? removeValues.length : 0;\n const clear = update[definition.clearKey] === true;\n const replace = definition.replaceKey ? update[definition.replaceKey] === true : false;\n if (!clear && !replace && addCount === 0 && removeCount === 0) {\n continue;\n }\n\n const before = normalizeCollectionBeforeValue(definition.field, row[definition.field]);\n const beforeCount = collectionValueCount(definition.field, before);\n const operation = replace ? \"replace\" : clear ? \"clear_or_reset\" : removeCount > 0 ? \"merge_remove\" : \"append\";\n changes.push({\n field: definition.field,\n before,\n after: {\n operation,\n clear,\n replace,\n add_count: addCount,\n remove_count: removeCount,\n before_count: beforeCount,\n },\n });\n }\n return changes;\n}\n\nfunction normalizeExistingTags(value: unknown): string[] {\n if (!Array.isArray(value)) {\n return [];\n }\n return value.filter((tag): tag is string => typeof tag === \"string\");\n}\n\n// Tags support three mutation modes that compose: --tags replaces, --add-tags\n// extends, --remove-tags prunes. Replicate runUpdate's resolution order so the\n// dry-run preview and the apply-mode actionable detection both account for\n// additive/subtractive tag mutations (a --add-tags-only update must NOT be\n// treated as a no-op skip).\nfunction buildTagMutationPlan(row: Record<string, unknown>, update: UpdateCommandOptions): PlannedChange | undefined {\n const hasReplace = update.tags !== undefined;\n const hasAdd = Array.isArray(update.addTags) && update.addTags.length > 0;\n const hasRemove = Array.isArray(update.removeTags) && update.removeTags.length > 0;\n if (!hasReplace && !hasAdd && !hasRemove) {\n return undefined;\n }\n const existing = normalizeExistingTags(row.tags);\n const baseTags = hasReplace ? parseTags(update.tags as string) : existing;\n const withAdditions = mergeAdditiveTags(baseTags, update.addTags);\n const after = applyTagRemovals(withAdditions, update.removeTags).slice().sort((a, b) => a.localeCompare(b));\n const before = existing.slice().sort((a, b) => a.localeCompare(b));\n if (areValuesEqual(before, after)) {\n return undefined;\n }\n return { field: \"tags\", before: existing, after };\n}\n\nfunction buildPlannedItemDiff(\n item: ListedItem,\n update: UpdateCommandOptions = {},\n runtimeFieldRegistry: RuntimeFieldRegistry,\n): PlannedItemDiff {\n const safeUpdate = update;\n const row = toItemRecord(item);\n const changes: PlannedChange[] = [];\n const tagPlan = buildTagMutationPlan(row, safeUpdate);\n if (tagPlan) {\n changes.push(tagPlan);\n }\n for (const [optionKey, itemKey] of Object.entries(UPDATE_OPTION_TO_ITEM_KEY) as Array<[keyof UpdateCommandOptions, string]>) {\n const candidate = safeUpdate[optionKey];\n if (candidate === undefined) {\n continue;\n }\n const before = row[itemKey];\n const after = toComparablePreviewValue(optionKey, candidate);\n if (areValuesEqual(before, after)) {\n continue;\n }\n changes.push({\n field: itemKey,\n before,\n after,\n });\n }\n changes.push(...buildCollectionMutationPlans(row, safeUpdate));\n\n const runtimeFieldUpdates = collectRuntimeUpdateFieldValues(\n safeUpdate as Record<string, unknown>,\n runtimeFieldRegistry,\n [\"update_many\"],\n );\n for (const [fieldKey, fieldValue] of Object.entries(runtimeFieldUpdates)) {\n const before = row[fieldKey];\n if (areValuesEqual(before, fieldValue)) {\n continue;\n }\n changes.push({\n field: fieldKey,\n before,\n after: fieldValue,\n });\n }\n\n if (safeUpdate.unset && safeUpdate.unset.length > 0) {\n for (const rawUnsetField of safeUpdate.unset) {\n const field = normalizeUnsetField(rawUnsetField);\n const before = row[field];\n if (before === undefined) {\n continue;\n }\n changes.push({\n field,\n before,\n after: null,\n });\n }\n }\n\n return {\n id: item.id,\n changes,\n };\n}\n\nfunction normalizeStatusFilter(value: string | undefined, statusRegistry: RuntimeStatusRegistry): ItemStatus | undefined {\n if (value === undefined) {\n return undefined;\n }\n const normalized = normalizeStatusInput(value, statusRegistry);\n if (!normalized) {\n const allowedStatuses = statusRegistry.definitions.map((definition) => definition.id);\n throw new PmCliError(\n `Invalid --filter-status value \"${value}\". Allowed: ${allowedStatuses.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n }\n return normalized;\n}\n\nfunction rejectBlankIdsFilter(list: ListOptions | undefined): void {\n if (list?.ids != null && String(list.ids).trim().length === 0) {\n throw new PmCliError(\"--ids requires at least one non-empty item ID\", EXIT_CODE.USAGE);\n }\n}\n\n// GH-256: validate planned scalar enum/format fields up front so a `--dry-run`\n// preview rejects globally-invalid values exactly as apply would (true\n// preview==apply parity), and so apply itself fails fast before creating an\n// orphan checkpoint. Only VALUE/ENUM/FORMAT correctness is checked here — these\n// are invalid regardless of the matched item. Per-item governance and\n// workflow-transition rules stay in the apply path (runUpdate). Each field is\n// validated only when the caller actually provided it, reusing the exact same\n// resolvers and error messages runUpdate raises so single/bulk/dry-run stay\n// consistent.\nfunction assertPlannedUpdateValuesValid(\n update: UpdateCommandOptions,\n settings: PmSettings,\n statusRegistry: RuntimeStatusRegistry,\n pmRoot: string,\n): void {\n if (update.priority !== undefined) {\n resolvePriority(update.priority);\n }\n if (update.type !== undefined) {\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n if (!resolveTypeName(update.type, typeRegistry)) {\n throw new PmCliError(\n buildInvalidTypeError(update.type, typeRegistry.types, resolveItemTypesFilePath(pmRoot, settings.schema)),\n EXIT_CODE.USAGE,\n );\n }\n }\n if (update.status !== undefined && !normalizeStatusInput(update.status, statusRegistry)) {\n const allowedStatuses = statusRegistry.definitions.map((definition) => definition.id);\n throw new PmCliError(\n `Invalid --status value \"${update.status}\". Allowed: ${allowedStatuses.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n }\n if (update.deadline !== undefined) {\n resolveIsoOrRelative(update.deadline, new Date(), \"deadline\");\n }\n}\n\n\n/**\n * Implements run update many for the public runtime surface of this module.\n */\nexport async function runUpdateMany(options: UpdateManyCommandOptions, global: GlobalOptions): Promise<UpdateManyResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n const settings = await readSettings(pmRoot);\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const runtimeFieldRegistry = resolveRuntimeFieldRegistry(settings.schema);\n\n const dryRun = options.dryRun === true;\n const rollbackId = typeof options.rollback === \"string\" ? options.rollback : undefined;\n const updateSummary = sanitizeUpdateOptionsForSummary(options.update);\n rejectBlankIdsFilter(options.list);\n\n if (rollbackId) {\n if (dryRun) {\n throw new PmCliError(\"--dry-run cannot be combined with --rollback\", EXIT_CODE.USAGE);\n }\n if (hasListFilters(options.list, options.status)) {\n throw new PmCliError(\"Rollback mode does not accept filter options\", EXIT_CODE.USAGE);\n }\n if (Object.keys(updateSummary).length > 0) {\n throw new PmCliError(\"Rollback mode does not accept update mutation flags\", EXIT_CODE.USAGE);\n }\n\n const checkpoint = await loadMutationCheckpoint(\n pmRoot,\n UPDATE_MANY_CHECKPOINT_SUBDIR,\n rollbackId,\n UPDATE_MANY_CHECKPOINT_SCHEMA_VERSION,\n );\n const restoreMessage = options.update?.message ?? `Rollback update-many checkpoint ${checkpoint.id}`;\n const rollback = await restoreCheckpointItems(checkpoint.items, (id, targetUpdatedAt) =>\n runRestore(\n id,\n targetUpdatedAt,\n {\n author: options.update?.author,\n message: restoreMessage,\n force: options.update?.force ?? true,\n },\n global,\n ),\n );\n return {\n mode: \"rollback\",\n matched_count: checkpoint.items.length,\n dry_run: false,\n rollback_checkpoint_id: checkpoint.id,\n checkpoint: {\n id: checkpoint.id,\n created_at: checkpoint.created_at,\n path: checkpoint.path,\n rollback_command: `pm update-many --rollback ${checkpoint.id}`,\n },\n restored_count: rollback.restored_ids.length,\n failed_count: rollback.failed_count,\n rows: rollback.rows,\n ids: rollback.restored_ids,\n };\n }\n\n if (!hasAnyUpdateMutationInput(options.update)) {\n throw new PmCliError(\n `No update-many mutation flags provided. Add at least one mutation flag (for example: ${UPDATE_MANY_MUTATION_FLAG_GUIDANCE}).`,\n EXIT_CODE.USAGE,\n );\n }\n\n // GH-256: validate planned scalar values before listing/checkpointing so\n // dry-run previews and apply both reject globally-invalid enum/format input.\n assertPlannedUpdateValuesValid(options.update, settings, statusRegistry, pmRoot);\n\n const statusFilter = normalizeStatusFilter(options.status, statusRegistry);\n const listed = await runList(statusFilter, { ...options.list, includeBody: true }, global);\n const planned = listed.items.map((item) => buildPlannedItemDiff(item, options.update, runtimeFieldRegistry));\n const actionable = planned.filter((row) => row.changes.length > 0);\n if (dryRun) {\n return {\n mode: \"dry_run\",\n matched_count: listed.items.length,\n dry_run: true,\n filters: listed.filters,\n planned_update_options: updateSummary,\n item_plans: planned,\n ids: [],\n };\n }\n\n if (actionable.length === 0) {\n return {\n mode: \"apply\",\n matched_count: listed.items.length,\n dry_run: false,\n filters: listed.filters,\n planned_update_options: updateSummary,\n updated_count: 0,\n skipped_count: listed.items.length,\n failed_count: 0,\n rows: planned.map((row) => ({\n id: row.id,\n status: \"skipped\" as const,\n })),\n ids: [],\n };\n }\n\n const nowValue = nowIso();\n const checkpointId = createCheckpointId(UPDATE_MANY_CHECKPOINT_SUBDIR, nowValue);\n const checkpointEnabled = options.checkpoint !== false;\n const checkpointItems: MutationCheckpointItem[] = listed.items\n .filter((item) => actionable.some((candidate) => candidate.id === item.id))\n .map((item) => ({\n id: item.id,\n target_updated_at: item.updated_at,\n }));\n\n let checkpointInfo: UpdateManyResult[\"checkpoint\"] | undefined;\n if (checkpointEnabled) {\n const checkpointPayload: UpdateManyCheckpoint = {\n schema_version: UPDATE_MANY_CHECKPOINT_SCHEMA_VERSION,\n id: checkpointId,\n created_at: nowValue,\n author: resolveAuthor(options.update.author, \"unknown\"),\n status_filter: statusFilter ?? null,\n list_filters: listed.filters,\n update_options: updateSummary,\n items: checkpointItems,\n };\n const checkpointPath = await writeMutationCheckpoint(\n pmRoot,\n UPDATE_MANY_CHECKPOINT_SUBDIR,\n checkpointId,\n checkpointPayload,\n );\n checkpointInfo = {\n id: checkpointId,\n created_at: nowValue,\n path: checkpointPath,\n rollback_command: `pm update-many --rollback ${checkpointId}`,\n };\n }\n\n const applyRows: UpdateManyApplyResultRow[] = [];\n const updatedIds: string[] = [];\n const updateMessage = options.update.message ?? `update-many apply ${checkpointId}`;\n const actionableById = new Set(actionable.map((row) => row.id));\n for (const item of listed.items) {\n if (!actionableById.has(item.id)) {\n applyRows.push({ id: item.id, status: \"skipped\" });\n continue;\n }\n try {\n const result = await runUpdate(\n item.id,\n {\n ...options.update,\n message: updateMessage,\n runtimeFieldCommands: [\"update_many\"],\n },\n global,\n );\n applyRows.push({\n id: item.id,\n status: \"updated\",\n changed_fields: result.changed_fields,\n warnings: result.warnings,\n });\n updatedIds.push(item.id);\n } catch (error: unknown) {\n applyRows.push({\n id: item.id,\n status: \"failed\",\n error: toErrorMessage(error),\n });\n }\n }\n\n const updatedCount = applyRows.filter((row) => row.status === \"updated\").length;\n const skippedCount = applyRows.filter((row) => row.status === \"skipped\").length;\n const failedCount = applyRows.filter((row) => row.status === \"failed\").length;\n\n return {\n mode: \"apply\",\n matched_count: listed.items.length,\n dry_run: false,\n filters: listed.filters,\n planned_update_options: updateSummary,\n ...(checkpointInfo ? { checkpoint: checkpointInfo } : {}),\n updated_count: updatedCount,\n skipped_count: skippedCount,\n failed_count: failedCount,\n rows: applyRows,\n ids: updatedIds,\n };\n}\n\nexport const _testOnlyUpdateManyCommand = {\n assertPlannedUpdateValuesValid,\n buildCollectionMutationPlans,\n buildPlannedItemDiff,\n buildTagMutationPlan,\n collectionValueCount,\n hasAnyUpdateMutationInput,\n hasListFilters,\n normalizeStatusFilter,\n normalizeCollectionBeforeValue,\n normalizeExistingTags,\n normalizeUnsetField,\n rejectBlankIdsFilter,\n sanitizeUpdateOptionsForSummary,\n toComparablePreviewValue,\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,IAAM,wC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IACT,SAAS,OAAO;IAChB,wBAAwB;IACxB,GAAI,iBAAiB,EAAE,YAAY,eAAc,IAAK,CAAA;IACtD,eAAe;IACf,eAAe;IACf,cAAc;IACd,MAAM;IACN,KAAK;;AAET;AAEO,IAAM,6BAA6B;EACxC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA","debugId":"2fabaef7-aade-56d4-8f41-ca0be6201131"}
1
+ {"version":3,"sources":["../../../../../../../../cli/commands/update-many.ts"],"sourcesContent":["/**\n * @module cli/commands/update-many\n *\n * Implements the pm update many command surface and its agent-facing runtime behavior.\n */\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport {\n createCheckpointId,\n loadMutationCheckpoint,\n restoreCheckpointItems,\n writeMutationCheckpoint,\n type MutationCheckpointItem,\n} from \"../../core/checkpoint/mutation-checkpoint.js\";\nimport { toItemRecord } from \"../../core/item/item-record.js\";\nimport { applyTagRemovals, mergeAdditiveTags, parseTags } from \"../../core/item/parse.js\";\nimport { resolvePriority } from \"../../core/item/priority.js\";\nimport { normalizeStatusInput } from \"../../core/item/status.js\";\nimport { resolveItemTypeRegistry, resolveTypeName } from \"../../core/item/type-registry.js\";\nimport { collectRuntimeUpdateFieldValues } from \"../../core/schema/runtime-field-values.js\";\nimport { buildInvalidTypeError } from \"../../core/schema/item-types-file.js\";\nimport {\n resolveItemTypesFilePath,\n resolveRuntimeFieldRegistry,\n resolveRuntimeStatusRegistry,\n type RuntimeFieldRegistry,\n type RuntimeStatusRegistry,\n} from \"../../core/schema/runtime-schema.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { toErrorMessage } from \"../../core/shared/primitives.js\";\nimport { stableValueEquals } from \"../../core/shared/serialization.js\";\nimport { nowIso, resolveIsoOrRelative } from \"../../core/shared/time.js\";\nimport { getActiveExtensionRegistrations } from \"../../core/extensions/index.js\";\nimport type { PmSettings } from \"../../types/index.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport { resolveAuthor } from \"../../core/shared/author.js\";\nimport type { ItemStatus } from \"../../types/index.js\";\nimport { hasListFilters } from \"./list-filter-shared.js\";\nimport { runList, type ListOptions, type ListedItem } from \"./list.js\";\nimport { runRestore } from \"./restore.js\";\nimport { runUpdate, type UpdateCommandOptions } from \"./update.js\";\n\nconst UPDATE_MANY_CHECKPOINT_SCHEMA_VERSION = 1;\nconst UPDATE_MANY_CHECKPOINT_SUBDIR = \"update-many\";\n\nconst NON_MUTATION_UPDATE_OPTION_KEYS = new Set<keyof UpdateCommandOptions>([\n \"author\",\n \"message\",\n \"force\",\n \"allowAuditUpdate\",\n \"allowAuditDepUpdate\",\n]);\n\nconst UPDATE_MANY_MUTATION_FLAG_GUIDANCE = [\n \"--status\",\n \"--priority\",\n \"--type\",\n \"--tags\",\n \"--description\",\n \"--body\",\n \"--deadline\",\n \"--estimate\",\n \"--assignee\",\n \"--dep\",\n \"--dep-remove\",\n \"--comment\",\n \"--note\",\n \"--learning\",\n \"--file\",\n \"--test\",\n \"--doc\",\n \"--replace-deps\",\n \"--replace-tests\",\n \"--unset\",\n \"--clear-*\",\n].join(\", \");\n\nconst UPDATE_OPTION_TO_ITEM_KEY: Partial<Record<keyof UpdateCommandOptions, string>> = {\n title: \"title\",\n description: \"description\",\n body: \"body\",\n status: \"status\",\n closeReason: \"close_reason\",\n priority: \"priority\",\n type: \"type\",\n deadline: \"deadline\",\n estimatedMinutes: \"estimated_minutes\",\n acceptanceCriteria: \"acceptance_criteria\",\n definitionOfReady: \"definition_of_ready\",\n order: \"order\",\n goal: \"goal\",\n objective: \"objective\",\n value: \"value\",\n impact: \"impact\",\n outcome: \"outcome\",\n whyNow: \"why_now\",\n assignee: \"assignee\",\n parent: \"parent\",\n reviewer: \"reviewer\",\n risk: \"risk\",\n confidence: \"confidence\",\n sprint: \"sprint\",\n release: \"release\",\n blockedBy: \"blocked_by\",\n blockedReason: \"blocked_reason\",\n unblockNote: \"unblock_note\",\n reporter: \"reporter\",\n severity: \"severity\",\n environment: \"environment\",\n reproSteps: \"repro_steps\",\n resolution: \"resolution\",\n expectedResult: \"expected_result\",\n actualResult: \"actual_result\",\n affectedVersion: \"affected_version\",\n fixedVersion: \"fixed_version\",\n component: \"component\",\n regression: \"regression\",\n customerImpact: \"customer_impact\",\n};\n\ninterface CollectionMutationPlanDefinition {\n field: string;\n addKey: keyof UpdateCommandOptions;\n removeKey?: keyof UpdateCommandOptions;\n clearKey: keyof UpdateCommandOptions;\n replaceKey?: keyof UpdateCommandOptions;\n}\n\nconst COLLECTION_MUTATION_PLAN_DEFINITIONS: CollectionMutationPlanDefinition[] = [\n {\n field: \"dependencies\",\n addKey: \"dep\",\n removeKey: \"depRemove\",\n clearKey: \"clearDeps\",\n replaceKey: \"replaceDeps\",\n },\n {\n field: \"comments\",\n addKey: \"comment\",\n clearKey: \"clearComments\",\n },\n {\n field: \"notes\",\n addKey: \"note\",\n clearKey: \"clearNotes\",\n },\n {\n field: \"learnings\",\n addKey: \"learning\",\n clearKey: \"clearLearnings\",\n },\n {\n field: \"files\",\n addKey: \"file\",\n clearKey: \"clearFiles\",\n },\n {\n field: \"tests\",\n addKey: \"test\",\n clearKey: \"clearTests\",\n replaceKey: \"replaceTests\",\n },\n {\n field: \"docs\",\n addKey: \"doc\",\n clearKey: \"clearDocs\",\n },\n {\n field: \"reminders\",\n addKey: \"reminder\",\n clearKey: \"clearReminders\",\n },\n {\n field: \"events\",\n addKey: \"event\",\n clearKey: \"clearEvents\",\n },\n {\n field: \"type_options\",\n addKey: \"typeOption\",\n clearKey: \"clearTypeOptions\",\n },\n];\n\nconst UNSET_FIELD_ALIASES: Record<string, string> = {\n close_reason: \"close_reason\",\n \"close-reason\": \"close_reason\",\n deadline: \"deadline\",\n estimate: \"estimated_minutes\",\n estimated_minutes: \"estimated_minutes\",\n \"estimated-minutes\": \"estimated_minutes\",\n acceptance_criteria: \"acceptance_criteria\",\n \"acceptance-criteria\": \"acceptance_criteria\",\n ac: \"acceptance_criteria\",\n definition_of_ready: \"definition_of_ready\",\n \"definition-of-ready\": \"definition_of_ready\",\n order: \"order\",\n rank: \"order\",\n goal: \"goal\",\n objective: \"objective\",\n value: \"value\",\n impact: \"impact\",\n outcome: \"outcome\",\n why_now: \"why_now\",\n \"why-now\": \"why_now\",\n assignee: \"assignee\",\n parent: \"parent\",\n reviewer: \"reviewer\",\n risk: \"risk\",\n confidence: \"confidence\",\n sprint: \"sprint\",\n release: \"release\",\n blocked_by: \"blocked_by\",\n \"blocked-by\": \"blocked_by\",\n blocked_reason: \"blocked_reason\",\n \"blocked-reason\": \"blocked_reason\",\n unblock_note: \"unblock_note\",\n \"unblock-note\": \"unblock_note\",\n reporter: \"reporter\",\n severity: \"severity\",\n environment: \"environment\",\n repro_steps: \"repro_steps\",\n \"repro-steps\": \"repro_steps\",\n resolution: \"resolution\",\n expected_result: \"expected_result\",\n \"expected-result\": \"expected_result\",\n actual_result: \"actual_result\",\n \"actual-result\": \"actual_result\",\n affected_version: \"affected_version\",\n \"affected-version\": \"affected_version\",\n fixed_version: \"fixed_version\",\n \"fixed-version\": \"fixed_version\",\n component: \"component\",\n regression: \"regression\",\n customer_impact: \"customer_impact\",\n \"customer-impact\": \"customer_impact\",\n type_options: \"type_options\",\n \"type-options\": \"type_options\",\n tags: \"tags\",\n};\n\ninterface UpdateManyCheckpoint {\n schema_version: number;\n id: string;\n created_at: string;\n author: string;\n status_filter: string | null;\n list_filters: Record<string, unknown>;\n update_options: Record<string, unknown>;\n items: MutationCheckpointItem[];\n}\n\n/**\n * Documents the update many command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface UpdateManyCommandOptions {\n status?: string;\n list: ListOptions;\n update: UpdateCommandOptions;\n dryRun?: boolean;\n rollback?: string;\n checkpoint?: boolean;\n}\n\ninterface PlannedChange {\n field: string;\n before: unknown;\n after: unknown;\n}\n\ninterface PlannedItemDiff {\n id: string;\n changes: PlannedChange[];\n}\n\ninterface UpdateManyApplyResultRow {\n id: string;\n status: \"updated\" | \"failed\" | \"skipped\";\n changed_fields?: string[];\n warnings?: string[];\n error?: string;\n}\n\ninterface UpdateManyRollbackResultRow {\n id: string;\n status: \"restored\" | \"failed\";\n changed_fields?: string[];\n warnings?: string[];\n error?: string;\n}\n\n/**\n * Documents the update many result payload exchanged by command, SDK, and package integrations.\n */\nexport interface UpdateManyResult {\n mode: \"dry_run\" | \"apply\" | \"rollback\";\n matched_count: number;\n dry_run: boolean;\n filters?: Record<string, unknown>;\n planned_update_options?: Record<string, unknown>;\n item_plans?: PlannedItemDiff[];\n checkpoint?: {\n id: string;\n created_at: string;\n path: string;\n rollback_command: string;\n };\n updated_count?: number;\n skipped_count?: number;\n failed_count?: number;\n restored_count?: number;\n rollback_checkpoint_id?: string;\n rows?: UpdateManyApplyResultRow[] | UpdateManyRollbackResultRow[];\n ids: string[];\n}\n\nfunction sanitizeUpdateOptionsForSummary(options: UpdateCommandOptions): Record<string, unknown> {\n const summary: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(options) as Array<[keyof UpdateCommandOptions, unknown]>) {\n if (NON_MUTATION_UPDATE_OPTION_KEYS.has(key)) {\n continue;\n }\n if (value === undefined) {\n continue;\n }\n summary[key] = value;\n }\n return summary;\n}\n\nfunction hasAnyUpdateMutationInput(options: UpdateCommandOptions): boolean {\n return Object.keys(sanitizeUpdateOptionsForSummary(options)).length > 0;\n}\n\nfunction toComparablePreviewValue(optionKey: keyof UpdateCommandOptions, value: unknown): unknown {\n if (value === undefined) {\n return undefined;\n }\n if (optionKey === \"priority\") {\n const parsed = Number(String(value).trim());\n return Number.isInteger(parsed) ? parsed : String(value).trim();\n }\n if (optionKey === \"estimatedMinutes\" || optionKey === \"order\" || optionKey === \"rank\") {\n const parsed = Number(String(value).trim());\n return Number.isFinite(parsed) ? parsed : String(value).trim();\n }\n if (optionKey === \"regression\") {\n const normalized = String(value).trim().toLowerCase();\n if (normalized === \"true\" || normalized === \"1\") {\n return true;\n }\n if (normalized === \"false\" || normalized === \"0\") {\n return false;\n }\n }\n if (typeof value === \"string\") {\n return value.trim();\n }\n return value;\n}\n\nfunction normalizeUnsetField(rawField: string): string {\n const normalized = rawField.trim().toLowerCase().replaceAll(\"-\", \"_\");\n return UNSET_FIELD_ALIASES[normalized] ?? normalized;\n}\n\nfunction areValuesEqual(left: unknown, right: unknown): boolean {\n return stableValueEquals(left, right);\n}\n\nfunction normalizeCollectionBeforeValue(field: string, value: unknown): unknown {\n if (value !== undefined) {\n return value;\n }\n if (field === \"type_options\") {\n return {};\n }\n return [];\n}\n\nfunction collectionValueCount(field: string, value: unknown): number {\n if (Array.isArray(value)) {\n return value.length;\n }\n if (field === \"type_options\" && value && typeof value === \"object\") {\n return Object.keys(value as Record<string, unknown>).length;\n }\n return 0;\n}\n\nfunction buildCollectionMutationPlans(row: Record<string, unknown>, update: UpdateCommandOptions): PlannedChange[] {\n const changes: PlannedChange[] = [];\n for (const definition of COLLECTION_MUTATION_PLAN_DEFINITIONS) {\n const addValues = update[definition.addKey];\n const removeValues = definition.removeKey ? update[definition.removeKey] : undefined;\n const addCount = Array.isArray(addValues) ? addValues.length : 0;\n const removeCount = Array.isArray(removeValues) ? removeValues.length : 0;\n const clear = update[definition.clearKey] === true;\n const replace = definition.replaceKey ? update[definition.replaceKey] === true : false;\n if (!clear && !replace && addCount === 0 && removeCount === 0) {\n continue;\n }\n\n const before = normalizeCollectionBeforeValue(definition.field, row[definition.field]);\n const beforeCount = collectionValueCount(definition.field, before);\n const operation = replace ? \"replace\" : clear ? \"clear_or_reset\" : removeCount > 0 ? \"merge_remove\" : \"append\";\n changes.push({\n field: definition.field,\n before,\n after: {\n operation,\n clear,\n replace,\n add_count: addCount,\n remove_count: removeCount,\n before_count: beforeCount,\n },\n });\n }\n return changes;\n}\n\nfunction normalizeExistingTags(value: unknown): string[] {\n if (!Array.isArray(value)) {\n return [];\n }\n return value.filter((tag): tag is string => typeof tag === \"string\");\n}\n\n// Tags support three mutation modes that compose: --tags replaces, --add-tags\n// extends, --remove-tags prunes. Replicate runUpdate's resolution order so the\n// dry-run preview and the apply-mode actionable detection both account for\n// additive/subtractive tag mutations (a --add-tags-only update must NOT be\n// treated as a no-op skip).\nfunction buildTagMutationPlan(row: Record<string, unknown>, update: UpdateCommandOptions): PlannedChange | undefined {\n const hasReplace = update.tags !== undefined;\n const hasAdd = Array.isArray(update.addTags) && update.addTags.length > 0;\n const hasRemove = Array.isArray(update.removeTags) && update.removeTags.length > 0;\n if (!hasReplace && !hasAdd && !hasRemove) {\n return undefined;\n }\n const existing = normalizeExistingTags(row.tags);\n const baseTags = hasReplace ? parseTags(update.tags as string) : existing;\n const withAdditions = mergeAdditiveTags(baseTags, update.addTags);\n const after = applyTagRemovals(withAdditions, update.removeTags).slice().sort((a, b) => a.localeCompare(b));\n const before = existing.slice().sort((a, b) => a.localeCompare(b));\n if (areValuesEqual(before, after)) {\n return undefined;\n }\n return { field: \"tags\", before: existing, after };\n}\n\nfunction buildPlannedItemDiff(\n item: ListedItem,\n update: UpdateCommandOptions = {},\n runtimeFieldRegistry: RuntimeFieldRegistry,\n): PlannedItemDiff {\n const safeUpdate = update;\n const row = toItemRecord(item);\n const changes: PlannedChange[] = [];\n const tagPlan = buildTagMutationPlan(row, safeUpdate);\n if (tagPlan) {\n changes.push(tagPlan);\n }\n for (const [optionKey, itemKey] of Object.entries(UPDATE_OPTION_TO_ITEM_KEY) as Array<[keyof UpdateCommandOptions, string]>) {\n const candidate = safeUpdate[optionKey];\n if (candidate === undefined) {\n continue;\n }\n const before = row[itemKey];\n const after = toComparablePreviewValue(optionKey, candidate);\n if (areValuesEqual(before, after)) {\n continue;\n }\n changes.push({\n field: itemKey,\n before,\n after,\n });\n }\n changes.push(...buildCollectionMutationPlans(row, safeUpdate));\n\n const runtimeFieldUpdates = collectRuntimeUpdateFieldValues(\n safeUpdate as Record<string, unknown>,\n runtimeFieldRegistry,\n [\"update_many\"],\n );\n for (const [fieldKey, fieldValue] of Object.entries(runtimeFieldUpdates)) {\n const before = row[fieldKey];\n if (areValuesEqual(before, fieldValue)) {\n continue;\n }\n changes.push({\n field: fieldKey,\n before,\n after: fieldValue,\n });\n }\n\n if (safeUpdate.unset && safeUpdate.unset.length > 0) {\n for (const rawUnsetField of safeUpdate.unset) {\n const field = normalizeUnsetField(rawUnsetField);\n const before = row[field];\n if (before === undefined) {\n continue;\n }\n changes.push({\n field,\n before,\n after: null,\n });\n }\n }\n\n return {\n id: item.id,\n changes,\n };\n}\n\nfunction normalizeStatusFilter(value: string | undefined, statusRegistry: RuntimeStatusRegistry): ItemStatus | undefined {\n if (value === undefined) {\n return undefined;\n }\n const normalized = normalizeStatusInput(value, statusRegistry);\n if (!normalized) {\n const allowedStatuses = statusRegistry.definitions.map((definition) => definition.id);\n throw new PmCliError(\n `Invalid --filter-status value \"${value}\". Allowed: ${allowedStatuses.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n }\n return normalized;\n}\n\nfunction rejectBlankIdsFilter(list: ListOptions | undefined): void {\n if (list?.ids != null && String(list.ids).trim().length === 0) {\n throw new PmCliError(\"--ids requires at least one non-empty item ID\", EXIT_CODE.USAGE);\n }\n}\n\n// GH-256: validate planned scalar enum/format fields up front so a `--dry-run`\n// preview rejects globally-invalid values exactly as apply would (true\n// preview==apply parity), and so apply itself fails fast before creating an\n// orphan checkpoint. Only VALUE/ENUM/FORMAT correctness is checked here — these\n// are invalid regardless of the matched item. Per-item governance and\n// workflow-transition rules stay in the apply path (runUpdate). Each field is\n// validated only when the caller actually provided it, reusing the exact same\n// resolvers and error messages runUpdate raises so single/bulk/dry-run stay\n// consistent.\nfunction assertPlannedUpdateValuesValid(\n update: UpdateCommandOptions,\n settings: PmSettings,\n statusRegistry: RuntimeStatusRegistry,\n pmRoot: string,\n): void {\n if (update.priority !== undefined) {\n resolvePriority(update.priority);\n }\n if (update.type !== undefined) {\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n if (!resolveTypeName(update.type, typeRegistry)) {\n throw new PmCliError(\n buildInvalidTypeError(update.type, typeRegistry.types, resolveItemTypesFilePath(pmRoot, settings.schema)),\n EXIT_CODE.USAGE,\n );\n }\n }\n if (update.status !== undefined && !normalizeStatusInput(update.status, statusRegistry)) {\n const allowedStatuses = statusRegistry.definitions.map((definition) => definition.id);\n throw new PmCliError(\n `Invalid --status value \"${update.status}\". Allowed: ${allowedStatuses.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n }\n if (update.deadline !== undefined) {\n resolveIsoOrRelative(update.deadline, new Date(), \"deadline\");\n }\n}\n\n\n/**\n * Implements run update many for the public runtime surface of this module.\n */\nexport async function runUpdateMany(options: UpdateManyCommandOptions, global: GlobalOptions): Promise<UpdateManyResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n const settings = await readSettings(pmRoot);\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const runtimeFieldRegistry = resolveRuntimeFieldRegistry(settings.schema);\n\n const dryRun = options.dryRun === true;\n const rollbackId = typeof options.rollback === \"string\" ? options.rollback : undefined;\n const updateSummary = sanitizeUpdateOptionsForSummary(options.update);\n rejectBlankIdsFilter(options.list);\n\n if (rollbackId) {\n if (dryRun) {\n throw new PmCliError(\"--dry-run cannot be combined with --rollback\", EXIT_CODE.USAGE);\n }\n if (hasListFilters(options.list, options.status)) {\n throw new PmCliError(\"Rollback mode does not accept filter options\", EXIT_CODE.USAGE);\n }\n if (Object.keys(updateSummary).length > 0) {\n throw new PmCliError(\"Rollback mode does not accept update mutation flags\", EXIT_CODE.USAGE);\n }\n\n const checkpoint = await loadMutationCheckpoint(\n pmRoot,\n UPDATE_MANY_CHECKPOINT_SUBDIR,\n rollbackId,\n UPDATE_MANY_CHECKPOINT_SCHEMA_VERSION,\n );\n const restoreMessage = options.update?.message ?? `Rollback update-many checkpoint ${checkpoint.id}`;\n const rollback = await restoreCheckpointItems(checkpoint.items, (id, targetUpdatedAt) =>\n runRestore(\n id,\n targetUpdatedAt,\n {\n author: options.update?.author,\n message: restoreMessage,\n force: options.update?.force ?? true,\n },\n global,\n ),\n );\n return {\n mode: \"rollback\",\n matched_count: checkpoint.items.length,\n dry_run: false,\n rollback_checkpoint_id: checkpoint.id,\n checkpoint: {\n id: checkpoint.id,\n created_at: checkpoint.created_at,\n path: checkpoint.path,\n rollback_command: `pm update-many --rollback ${checkpoint.id}`,\n },\n restored_count: rollback.restored_ids.length,\n failed_count: rollback.failed_count,\n rows: rollback.rows,\n ids: rollback.restored_ids,\n };\n }\n\n if (!hasAnyUpdateMutationInput(options.update)) {\n throw new PmCliError(\n `No update-many mutation flags provided. Add at least one mutation flag (for example: ${UPDATE_MANY_MUTATION_FLAG_GUIDANCE}).`,\n EXIT_CODE.USAGE,\n );\n }\n\n // GH-256: validate planned scalar values before listing/checkpointing so\n // dry-run previews and apply both reject globally-invalid enum/format input.\n assertPlannedUpdateValuesValid(options.update, settings, statusRegistry, pmRoot);\n\n const statusFilter = normalizeStatusFilter(options.status, statusRegistry);\n const listed = await runList(statusFilter, { ...options.list, includeBody: true }, global);\n const planned = listed.items.map((item) => buildPlannedItemDiff(item, options.update, runtimeFieldRegistry));\n const actionable = planned.filter((row) => row.changes.length > 0);\n if (dryRun) {\n return {\n mode: \"dry_run\",\n matched_count: listed.items.length,\n dry_run: true,\n filters: listed.filters,\n planned_update_options: updateSummary,\n item_plans: planned,\n ids: [],\n };\n }\n\n if (actionable.length === 0) {\n return {\n mode: \"apply\",\n matched_count: listed.items.length,\n dry_run: false,\n filters: listed.filters,\n planned_update_options: updateSummary,\n updated_count: 0,\n skipped_count: listed.items.length,\n failed_count: 0,\n rows: planned.map((row) => ({\n id: row.id,\n status: \"skipped\" as const,\n })),\n ids: [],\n };\n }\n\n const nowValue = nowIso();\n const checkpointId = createCheckpointId(UPDATE_MANY_CHECKPOINT_SUBDIR, nowValue);\n const checkpointEnabled = options.checkpoint !== false;\n const checkpointItems: MutationCheckpointItem[] = listed.items\n .filter((item) => actionable.some((candidate) => candidate.id === item.id))\n .map((item) => ({\n id: item.id,\n target_updated_at: item.updated_at,\n }));\n\n let checkpointInfo: UpdateManyResult[\"checkpoint\"] | undefined;\n if (checkpointEnabled) {\n const checkpointPayload: UpdateManyCheckpoint = {\n schema_version: UPDATE_MANY_CHECKPOINT_SCHEMA_VERSION,\n id: checkpointId,\n created_at: nowValue,\n author: resolveAuthor(options.update.author, \"unknown\"),\n status_filter: statusFilter ?? null,\n list_filters: listed.filters,\n update_options: updateSummary,\n items: checkpointItems,\n };\n const checkpointPath = await writeMutationCheckpoint(\n pmRoot,\n UPDATE_MANY_CHECKPOINT_SUBDIR,\n checkpointId,\n checkpointPayload,\n );\n checkpointInfo = {\n id: checkpointId,\n created_at: nowValue,\n path: checkpointPath,\n rollback_command: `pm update-many --rollback ${checkpointId}`,\n };\n }\n\n const applyRows: UpdateManyApplyResultRow[] = [];\n const updatedIds: string[] = [];\n const updateMessage = options.update.message ?? `update-many apply ${checkpointId}`;\n const actionableById = new Set(actionable.map((row) => row.id));\n for (const item of listed.items) {\n if (!actionableById.has(item.id)) {\n applyRows.push({ id: item.id, status: \"skipped\" });\n continue;\n }\n try {\n const result = await runUpdate(\n item.id,\n {\n ...options.update,\n message: updateMessage,\n runtimeFieldCommands: [\"update_many\"],\n },\n global,\n );\n applyRows.push({\n id: item.id,\n status: \"updated\",\n changed_fields: result.changed_fields,\n warnings: result.warnings,\n });\n updatedIds.push(item.id);\n } catch (error: unknown) {\n applyRows.push({\n id: item.id,\n status: \"failed\",\n error: toErrorMessage(error),\n });\n }\n }\n\n const updatedCount = applyRows.filter((row) => row.status === \"updated\").length;\n const skippedCount = applyRows.filter((row) => row.status === \"skipped\").length;\n const failedCount = applyRows.filter((row) => row.status === \"failed\").length;\n\n return {\n mode: \"apply\",\n matched_count: listed.items.length,\n dry_run: false,\n filters: listed.filters,\n planned_update_options: updateSummary,\n ...(checkpointInfo ? { checkpoint: checkpointInfo } : {}),\n updated_count: updatedCount,\n skipped_count: skippedCount,\n failed_count: failedCount,\n rows: applyRows,\n ids: updatedIds,\n };\n}\n\nexport const _testOnlyUpdateManyCommand = {\n assertPlannedUpdateValuesValid,\n buildCollectionMutationPlans,\n buildPlannedItemDiff,\n buildTagMutationPlan,\n collectionValueCount,\n hasAnyUpdateMutationInput,\n hasListFilters,\n normalizeStatusFilter,\n normalizeCollectionBeforeValue,\n normalizeExistingTags,\n normalizeUnsetField,\n rejectBlankIdsFilter,\n sanitizeUpdateOptionsForSummary,\n toComparablePreviewValue,\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,IAAM,wCAAwC;AAC9C,IAAM,gCAAgC;AAEtC,IAAM,kCAAkC,oBAAI,IAAgC;EAC1E;EACA;EACA;EACA;EACA;CACD;AAED,IAAM,qCAAqC;EACzC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,KAAK,IAAI;AAEX,IAAM,4BAAiF;EACrF,OAAO;EACP,aAAa;EACb,MAAM;EACN,QAAQ;EACR,aAAa;EACb,UAAU;EACV,MAAM;EACN,UAAU;EACV,kBAAkB;EAClB,oBAAoB;EACpB,mBAAmB;EACnB,OAAO;EACP,MAAM;EACN,WAAW;EACX,OAAO;EACP,QAAQ;EACR,SAAS;EACT,QAAQ;EACR,UAAU;EACV,QAAQ;EACR,UAAU;EACV,MAAM;EACN,YAAY;EACZ,QAAQ;EACR,SAAS;EACT,WAAW;EACX,eAAe;EACf,aAAa;EACb,UAAU;EACV,UAAU;EACV,aAAa;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