@unbrained/pm-cli 2026.6.13 → 2026.6.17

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 (808) hide show
  1. package/CHANGELOG.md +102 -0
  2. package/README.md +1 -1
  3. package/dist/cli/bootstrap-args.d.ts +29 -0
  4. package/dist/cli/bootstrap-args.js +11 -4
  5. package/dist/cli/bootstrap-args.js.map +1 -1
  6. package/dist/cli/commander-usage.d.ts +12 -0
  7. package/dist/cli/commander-usage.js +18 -7
  8. package/dist/cli/commander-usage.js.map +1 -1
  9. package/dist/cli/commands/activity.d.ts +19 -0
  10. package/dist/cli/commands/activity.js +12 -2
  11. package/dist/cli/commands/activity.js.map +1 -1
  12. package/dist/cli/commands/aggregate.d.ts +58 -0
  13. package/dist/cli/commands/aggregate.js +48 -15
  14. package/dist/cli/commands/aggregate.js.map +1 -1
  15. package/dist/cli/commands/annotation-command.d.ts +6 -1
  16. package/dist/cli/commands/annotation-command.js +72 -2
  17. package/dist/cli/commands/annotation-command.js.map +1 -1
  18. package/dist/cli/commands/append.js +4 -3
  19. package/dist/cli/commands/append.js.map +1 -1
  20. package/dist/cli/commands/close-many.d.ts +20 -0
  21. package/dist/cli/commands/close-many.js +14 -23
  22. package/dist/cli/commands/close-many.js.map +1 -1
  23. package/dist/cli/commands/close.js +37 -4
  24. package/dist/cli/commands/close.js.map +1 -1
  25. package/dist/cli/commands/comments-audit.js +3 -2
  26. package/dist/cli/commands/comments-audit.js.map +1 -1
  27. package/dist/cli/commands/comments.d.ts +2 -0
  28. package/dist/cli/commands/comments.js +49 -23
  29. package/dist/cli/commands/comments.js.map +1 -1
  30. package/dist/cli/commands/completion.js +362 -15
  31. package/dist/cli/commands/completion.js.map +1 -1
  32. package/dist/cli/commands/config.d.ts +51 -1
  33. package/dist/cli/commands/config.js +50 -12
  34. package/dist/cli/commands/config.js.map +1 -1
  35. package/dist/cli/commands/context.d.ts +79 -1
  36. package/dist/cli/commands/context.js +151 -25
  37. package/dist/cli/commands/context.js.map +1 -1
  38. package/dist/cli/commands/contracts.d.ts +80 -1
  39. package/dist/cli/commands/contracts.js +54 -4
  40. package/dist/cli/commands/contracts.js.map +1 -1
  41. package/dist/cli/commands/create.d.ts +51 -0
  42. package/dist/cli/commands/create.js +137 -18
  43. package/dist/cli/commands/create.js.map +1 -1
  44. package/dist/cli/commands/dedupe-audit.d.ts +33 -0
  45. package/dist/cli/commands/dedupe-audit.js +18 -14
  46. package/dist/cli/commands/dedupe-audit.js.map +1 -1
  47. package/dist/cli/commands/deps.js +7 -4
  48. package/dist/cli/commands/deps.js.map +1 -1
  49. package/dist/cli/commands/event-validation-messages.js +3 -3
  50. package/dist/cli/commands/event-validation-messages.js.map +1 -1
  51. package/dist/cli/commands/extension/bundled-catalog.d.ts +7 -0
  52. package/dist/cli/commands/extension/bundled-catalog.js +19 -15
  53. package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
  54. package/dist/cli/commands/extension/install-sources.d.ts +41 -1
  55. package/dist/cli/commands/extension/install-sources.js +26 -8
  56. package/dist/cli/commands/extension/install-sources.js.map +1 -1
  57. package/dist/cli/commands/extension/shared.d.ts +5 -0
  58. package/dist/cli/commands/extension/shared.js +9 -3
  59. package/dist/cli/commands/extension/shared.js.map +1 -1
  60. package/dist/cli/commands/extension.d.ts +133 -1
  61. package/dist/cli/commands/extension.js +127 -9
  62. package/dist/cli/commands/extension.js.map +1 -1
  63. package/dist/cli/commands/files.d.ts +30 -1
  64. package/dist/cli/commands/files.js +21 -2
  65. package/dist/cli/commands/files.js.map +1 -1
  66. package/dist/cli/commands/focus.d.ts +11 -0
  67. package/dist/cli/commands/focus.js +86 -0
  68. package/dist/cli/commands/focus.js.map +1 -0
  69. package/dist/cli/commands/get.d.ts +9 -2
  70. package/dist/cli/commands/get.js +34 -6
  71. package/dist/cli/commands/get.js.map +1 -1
  72. package/dist/cli/commands/guide.d.ts +5 -0
  73. package/dist/cli/commands/guide.js +6 -3
  74. package/dist/cli/commands/guide.js.map +1 -1
  75. package/dist/cli/commands/health.d.ts +109 -0
  76. package/dist/cli/commands/health.js +87 -35
  77. package/dist/cli/commands/health.js.map +1 -1
  78. package/dist/cli/commands/history-compact.js +27 -36
  79. package/dist/cli/commands/history-compact.js.map +1 -1
  80. package/dist/cli/commands/history-redact.d.ts +46 -0
  81. package/dist/cli/commands/history-redact.js +99 -67
  82. package/dist/cli/commands/history-redact.js.map +1 -1
  83. package/dist/cli/commands/history-repair.js +34 -37
  84. package/dist/cli/commands/history-repair.js.map +1 -1
  85. package/dist/cli/commands/history.js +6 -2
  86. package/dist/cli/commands/history.js.map +1 -1
  87. package/dist/cli/commands/index.d.ts +4 -1
  88. package/dist/cli/commands/index.js +6 -3
  89. package/dist/cli/commands/index.js.map +1 -1
  90. package/dist/cli/commands/init-agent-guidance.d.ts +54 -0
  91. package/dist/cli/commands/init-agent-guidance.js +31 -4
  92. package/dist/cli/commands/init-agent-guidance.js.map +1 -1
  93. package/dist/cli/commands/init.d.ts +38 -2
  94. package/dist/cli/commands/init.js +50 -64
  95. package/dist/cli/commands/init.js.map +1 -1
  96. package/dist/cli/commands/learnings.js +4 -3
  97. package/dist/cli/commands/learnings.js.map +1 -1
  98. package/dist/cli/commands/lifecycle-transitions.d.ts +23 -0
  99. package/dist/cli/commands/lifecycle-transitions.js +41 -0
  100. package/dist/cli/commands/lifecycle-transitions.js.map +1 -0
  101. package/dist/cli/commands/linked-artifacts.d.ts +5 -0
  102. package/dist/cli/commands/linked-artifacts.js +18 -4
  103. package/dist/cli/commands/linked-artifacts.js.map +1 -1
  104. package/dist/cli/commands/linked-test-parsers.d.ts +5 -0
  105. package/dist/cli/commands/linked-test-parsers.js +5 -2
  106. package/dist/cli/commands/linked-test-parsers.js.map +1 -1
  107. package/dist/cli/commands/list-filter-shared.d.ts +8 -0
  108. package/dist/cli/commands/list-filter-shared.js +70 -0
  109. package/dist/cli/commands/list-filter-shared.js.map +1 -0
  110. package/dist/cli/commands/list.d.ts +116 -0
  111. package/dist/cli/commands/list.js +194 -6
  112. package/dist/cli/commands/list.js.map +1 -1
  113. package/dist/cli/commands/normalize.js +16 -2
  114. package/dist/cli/commands/normalize.js.map +1 -1
  115. package/dist/cli/commands/notes.js +4 -3
  116. package/dist/cli/commands/notes.js.map +1 -1
  117. package/dist/cli/commands/plan.js +3 -2
  118. package/dist/cli/commands/plan.js.map +1 -1
  119. package/dist/cli/commands/recurrence-parsers.d.ts +9 -0
  120. package/dist/cli/commands/recurrence-parsers.js +19 -2
  121. package/dist/cli/commands/recurrence-parsers.js.map +1 -1
  122. package/dist/cli/commands/reindex.d.ts +83 -0
  123. package/dist/cli/commands/reindex.js +45 -10
  124. package/dist/cli/commands/reindex.js.map +1 -1
  125. package/dist/cli/commands/repeatable-metadata-parsers.js +28 -4
  126. package/dist/cli/commands/repeatable-metadata-parsers.js.map +1 -1
  127. package/dist/cli/commands/restore.d.ts +40 -1
  128. package/dist/cli/commands/restore.js +27 -2
  129. package/dist/cli/commands/restore.js.map +1 -1
  130. package/dist/cli/commands/scheduling-shortcuts.d.ts +43 -0
  131. package/dist/cli/commands/scheduling-shortcuts.js +87 -0
  132. package/dist/cli/commands/scheduling-shortcuts.js.map +1 -0
  133. package/dist/cli/commands/schema.d.ts +152 -2
  134. package/dist/cli/commands/schema.js +510 -4
  135. package/dist/cli/commands/schema.js.map +1 -1
  136. package/dist/cli/commands/search.d.ts +289 -1
  137. package/dist/cli/commands/search.js +367 -60
  138. package/dist/cli/commands/search.js.map +1 -1
  139. package/dist/cli/commands/stats.d.ts +38 -0
  140. package/dist/cli/commands/stats.js +38 -10
  141. package/dist/cli/commands/stats.js.map +1 -1
  142. package/dist/cli/commands/telemetry.js +5 -3
  143. package/dist/cli/commands/telemetry.js.map +1 -1
  144. package/dist/cli/commands/templates.d.ts +18 -0
  145. package/dist/cli/commands/templates.js +9 -2
  146. package/dist/cli/commands/templates.js.map +1 -1
  147. package/dist/cli/commands/test-all.d.ts +5 -0
  148. package/dist/cli/commands/test-all.js +9 -3
  149. package/dist/cli/commands/test-all.js.map +1 -1
  150. package/dist/cli/commands/test.d.ts +70 -1
  151. package/dist/cli/commands/test.js +84 -3
  152. package/dist/cli/commands/test.js.map +1 -1
  153. package/dist/cli/commands/update-many.d.ts +34 -1
  154. package/dist/cli/commands/update-many.js +60 -31
  155. package/dist/cli/commands/update-many.js.map +1 -1
  156. package/dist/cli/commands/update.d.ts +71 -0
  157. package/dist/cli/commands/update.js +91 -11
  158. package/dist/cli/commands/update.js.map +1 -1
  159. package/dist/cli/commands/upgrade.d.ts +28 -1
  160. package/dist/cli/commands/upgrade.js +17 -4
  161. package/dist/cli/commands/upgrade.js.map +1 -1
  162. package/dist/cli/commands/validate.d.ts +114 -0
  163. package/dist/cli/commands/validate.js +153 -8
  164. package/dist/cli/commands/validate.js.map +1 -1
  165. package/dist/cli/error-guidance.d.ts +30 -0
  166. package/dist/cli/error-guidance.js +41 -6
  167. package/dist/cli/error-guidance.js.map +1 -1
  168. package/dist/cli/extension-command-options.js +9 -7
  169. package/dist/cli/extension-command-options.js.map +1 -1
  170. package/dist/cli/help-content.d.ts +8 -0
  171. package/dist/cli/help-content.js +54 -6
  172. package/dist/cli/help-content.js.map +1 -1
  173. package/dist/cli/help-json-payload.d.ts +19 -1
  174. package/dist/cli/help-json-payload.js +16 -7
  175. package/dist/cli/help-json-payload.js.map +1 -1
  176. package/dist/cli/main.d.ts +242 -0
  177. package/dist/cli/main.js +241 -45
  178. package/dist/cli/main.js.map +1 -1
  179. package/dist/cli/register-list-query.js +62 -5
  180. package/dist/cli/register-list-query.js.map +1 -1
  181. package/dist/cli/register-mutation.d.ts +16 -0
  182. package/dist/cli/register-mutation.js +376 -100
  183. package/dist/cli/register-mutation.js.map +1 -1
  184. package/dist/cli/register-operations.d.ts +8 -0
  185. package/dist/cli/register-operations.js +134 -11
  186. package/dist/cli/register-operations.js.map +1 -1
  187. package/dist/cli/register-setup.js +9 -6
  188. package/dist/cli/register-setup.js.map +1 -1
  189. package/dist/cli/registration-helpers.d.ts +4 -0
  190. package/dist/cli/registration-helpers.js +124 -38
  191. package/dist/cli/registration-helpers.js.map +1 -1
  192. package/dist/cli-bundle/chunks/activity-PZYSZA26.js +18 -0
  193. package/dist/cli-bundle/chunks/{activity-PPO7QWJF.js → activity-SFM4THAU.js} +13 -11
  194. package/dist/cli-bundle/chunks/{aggregate-IRHJWEKG.js → aggregate-Y5ADDKBM.js} +55 -26
  195. package/dist/cli-bundle/chunks/aggregate-Y5ADDKBM.js.map +1 -0
  196. package/dist/cli-bundle/chunks/{aggregate-XEBW22UQ.js → aggregate-YTAUQLRW.js} +54 -25
  197. package/dist/cli-bundle/chunks/aggregate-YTAUQLRW.js.map +7 -0
  198. package/dist/cli-bundle/chunks/{append-NL67JNJU.js → append-4M7OVV7M.js} +11 -11
  199. package/dist/cli-bundle/chunks/append-4M7OVV7M.js.map +1 -0
  200. package/dist/cli-bundle/chunks/{append-N2AWXKZC.js → append-HSPK4L4V.js} +10 -10
  201. package/dist/cli-bundle/chunks/{append-N2AWXKZC.js.map → append-HSPK4L4V.js.map} +2 -2
  202. package/dist/cli-bundle/chunks/{chunk-IIOIBAQW.js → chunk-26BM6YLO.js} +3 -3
  203. package/dist/cli-bundle/chunks/{chunk-CEGUH2E5.js → chunk-2C6FU3D3.js} +5 -5
  204. package/dist/cli-bundle/chunks/{chunk-CEGUH2E5.js.map → chunk-2C6FU3D3.js.map} +1 -1
  205. package/dist/cli-bundle/chunks/{chunk-SQDKAEKG.js → chunk-2OPYLXDO.js} +117 -37
  206. package/dist/cli-bundle/chunks/chunk-2OPYLXDO.js.map +7 -0
  207. package/dist/cli-bundle/chunks/{chunk-4ZKKZMLH.js → chunk-2S46FKLB.js} +104 -30
  208. package/dist/cli-bundle/chunks/chunk-2S46FKLB.js.map +1 -0
  209. package/dist/cli-bundle/chunks/{chunk-LSSTKL3Y.js → chunk-2TMKMTEI.js} +3 -3
  210. package/dist/cli-bundle/chunks/{chunk-QU3OPNVV.js → chunk-2VH7DFSJ.js} +2 -2
  211. package/dist/cli-bundle/chunks/{chunk-RHYBR6G7.js → chunk-3ENF4NO4.js} +74 -14
  212. package/dist/cli-bundle/chunks/chunk-3ENF4NO4.js.map +1 -0
  213. package/dist/cli-bundle/chunks/chunk-3GR2HTYY.js +404 -0
  214. package/dist/cli-bundle/chunks/chunk-3GR2HTYY.js.map +7 -0
  215. package/dist/cli-bundle/chunks/{chunk-AAUYXSFF.js → chunk-3R3FYCBV.js} +223 -50
  216. package/dist/cli-bundle/chunks/chunk-3R3FYCBV.js.map +7 -0
  217. package/dist/cli-bundle/chunks/{chunk-5HSAHRYA.js → chunk-3UKJX3RP.js} +82 -21
  218. package/dist/cli-bundle/chunks/chunk-3UKJX3RP.js.map +7 -0
  219. package/dist/cli-bundle/chunks/chunk-4RTLBTYS.js +83 -0
  220. package/dist/cli-bundle/chunks/chunk-4RTLBTYS.js.map +1 -0
  221. package/dist/cli-bundle/chunks/{chunk-UCVJP4JL.js → chunk-5FDYWOJT.js} +52 -8
  222. package/dist/cli-bundle/chunks/chunk-5FDYWOJT.js.map +7 -0
  223. package/dist/cli-bundle/chunks/{chunk-LGOXXQUW.js → chunk-5XGWFUW2.js} +2 -2
  224. package/dist/cli-bundle/chunks/{chunk-LYNQ3NGI.js → chunk-6BD77FGL.js} +309 -20
  225. package/dist/cli-bundle/chunks/chunk-6BD77FGL.js.map +1 -0
  226. package/dist/cli-bundle/chunks/chunk-6EFCFPNE.js +35 -0
  227. package/dist/cli-bundle/chunks/chunk-6EFCFPNE.js.map +7 -0
  228. package/dist/cli-bundle/chunks/{chunk-36BCSMKP.js → chunk-6HF6CIY2.js} +26 -11
  229. package/dist/cli-bundle/chunks/chunk-6HF6CIY2.js.map +7 -0
  230. package/dist/cli-bundle/chunks/{chunk-M3SI2REU.js → chunk-6PBPD4MN.js} +322 -19
  231. package/dist/cli-bundle/chunks/chunk-6PBPD4MN.js.map +7 -0
  232. package/dist/cli-bundle/chunks/{chunk-TSXWFN3L.js → chunk-6VFUEGOA.js} +53 -9
  233. package/dist/cli-bundle/chunks/chunk-6VFUEGOA.js.map +1 -0
  234. package/dist/cli-bundle/chunks/{chunk-2J2AH4V5.js → chunk-AAOXSPAE.js} +56 -72
  235. package/dist/cli-bundle/chunks/chunk-AAOXSPAE.js.map +1 -0
  236. package/dist/cli-bundle/chunks/{chunk-Z647PYLD.js → chunk-AJCQ5GT6.js} +4 -4
  237. package/dist/cli-bundle/chunks/chunk-ALTGYHN3.js +61 -0
  238. package/dist/cli-bundle/chunks/chunk-ALTGYHN3.js.map +7 -0
  239. package/dist/cli-bundle/chunks/{chunk-KHGTYCJ6.js → chunk-AOJQL33L.js} +83 -22
  240. package/dist/cli-bundle/chunks/chunk-AOJQL33L.js.map +1 -0
  241. package/dist/cli-bundle/chunks/{chunk-5LMF75Q7.js → chunk-AXLDUGXA.js} +7 -4
  242. package/dist/cli-bundle/chunks/{chunk-5LMF75Q7.js.map → chunk-AXLDUGXA.js.map} +2 -2
  243. package/dist/cli-bundle/chunks/{chunk-DWG4FHPY.js → chunk-BITCVGHT.js} +2 -2
  244. package/dist/cli-bundle/chunks/{chunk-JE5IZXDS.js → chunk-CGQTFWYI.js} +4 -4
  245. package/dist/cli-bundle/chunks/{chunk-LFW5NQUP.js → chunk-CHM2VFVL.js} +407 -290
  246. package/dist/cli-bundle/chunks/chunk-CHM2VFVL.js.map +7 -0
  247. package/dist/cli-bundle/chunks/{chunk-VYZNX4C5.js → chunk-COVLE33A.js} +3 -3
  248. package/dist/cli-bundle/chunks/{chunk-SGMGMCIF.js → chunk-DDNBWH4W.js} +157 -25
  249. package/dist/cli-bundle/chunks/chunk-DDNBWH4W.js.map +1 -0
  250. package/dist/cli-bundle/chunks/{chunk-6ZFTM65G.js → chunk-F5MSD5HE.js} +2 -2
  251. package/dist/cli-bundle/chunks/{chunk-6TBR5AZ2.js → chunk-FAXB6F6R.js} +76 -8
  252. package/dist/cli-bundle/chunks/chunk-FAXB6F6R.js.map +7 -0
  253. package/dist/cli-bundle/chunks/{chunk-L6YQONLM.js → chunk-FPDK5BZQ.js} +18 -19
  254. package/dist/cli-bundle/chunks/chunk-FPDK5BZQ.js.map +1 -0
  255. package/dist/cli-bundle/chunks/{chunk-AGG32LKL.js → chunk-FPY2TOFI.js} +480 -24
  256. package/dist/cli-bundle/chunks/chunk-FPY2TOFI.js.map +1 -0
  257. package/dist/cli-bundle/chunks/{chunk-JWXTOYBI.js → chunk-G2MOUCTU.js} +121 -44
  258. package/dist/cli-bundle/chunks/chunk-G2MOUCTU.js.map +7 -0
  259. package/dist/cli-bundle/chunks/{chunk-3VULHQNS.js → chunk-G57RHEGP.js} +36 -18
  260. package/dist/cli-bundle/chunks/chunk-G57RHEGP.js.map +1 -0
  261. package/dist/cli-bundle/chunks/{chunk-QQG4HEX7.js → chunk-IROHIK2T.js} +37 -63
  262. package/dist/cli-bundle/chunks/chunk-IROHIK2T.js.map +1 -0
  263. package/dist/cli-bundle/chunks/{chunk-GOO4UXBI.js → chunk-JZHL4E3Q.js} +4 -4
  264. package/dist/cli-bundle/chunks/{chunk-XXLMJDUB.js → chunk-KA22USXD.js} +21 -22
  265. package/dist/cli-bundle/chunks/chunk-KA22USXD.js.map +7 -0
  266. package/dist/cli-bundle/chunks/{chunk-WLH7X4RN.js → chunk-KBC4O7SY.js} +56 -72
  267. package/dist/cli-bundle/chunks/chunk-KBC4O7SY.js.map +7 -0
  268. package/dist/cli-bundle/chunks/{chunk-NN6RKGFW.js → chunk-KCAGIH6K.js} +3 -3
  269. package/dist/cli-bundle/chunks/{chunk-BVL5KGVA.js → chunk-KO3VM5GS.js} +27 -12
  270. package/dist/cli-bundle/chunks/chunk-KO3VM5GS.js.map +1 -0
  271. package/dist/cli-bundle/chunks/{chunk-IXVSSHGV.js → chunk-LNH5Q32E.js} +13 -8
  272. package/dist/cli-bundle/chunks/chunk-LNH5Q32E.js.map +7 -0
  273. package/dist/cli-bundle/chunks/{chunk-3FMQMHAG.js → chunk-LORM3M2I.js} +4 -4
  274. package/dist/cli-bundle/chunks/{chunk-3FMQMHAG.js.map → chunk-LORM3M2I.js.map} +1 -1
  275. package/dist/cli-bundle/chunks/{chunk-PNYAAB4S.js → chunk-LWGMDLQ6.js} +8 -3
  276. package/dist/cli-bundle/chunks/chunk-LWGMDLQ6.js.map +1 -0
  277. package/dist/cli-bundle/chunks/{chunk-GFBEXDCQ.js → chunk-M4AVU7VC.js} +19 -8
  278. package/dist/cli-bundle/chunks/{chunk-GFBEXDCQ.js.map → chunk-M4AVU7VC.js.map} +2 -2
  279. package/dist/cli-bundle/chunks/{chunk-3CQPVBK3.js → chunk-MIBX6ZRN.js} +3 -3
  280. package/dist/cli-bundle/chunks/{chunk-AUDDXKNX.js → chunk-MMF2E3FM.js} +77 -9
  281. package/dist/cli-bundle/chunks/chunk-MMF2E3FM.js.map +1 -0
  282. package/dist/cli-bundle/chunks/{chunk-RFR2YQGO.js → chunk-MORZOR7W.js} +21 -8
  283. package/dist/cli-bundle/chunks/chunk-MORZOR7W.js.map +1 -0
  284. package/dist/cli-bundle/chunks/{chunk-4TPFXE2R.js → chunk-MUTUZ2HD.js} +118 -74
  285. package/dist/cli-bundle/chunks/chunk-MUTUZ2HD.js.map +1 -0
  286. package/dist/cli-bundle/chunks/{chunk-HZOX5BYD.js → chunk-OGXEBTX3.js} +35 -17
  287. package/dist/cli-bundle/chunks/chunk-OGXEBTX3.js.map +7 -0
  288. package/dist/cli-bundle/chunks/{chunk-LOAR5TKX.js → chunk-OOIH6J5T.js} +4 -4
  289. package/dist/cli-bundle/chunks/{chunk-LOAR5TKX.js.map → chunk-OOIH6J5T.js.map} +1 -1
  290. package/dist/cli-bundle/chunks/{chunk-VNC2HBL4.js → chunk-OSBJPPX3.js} +20 -9
  291. package/dist/cli-bundle/chunks/chunk-OSBJPPX3.js.map +1 -0
  292. package/dist/cli-bundle/chunks/{chunk-2ANTZBYF.js → chunk-PJS3WDO2.js} +122 -45
  293. package/dist/cli-bundle/chunks/chunk-PJS3WDO2.js.map +1 -0
  294. package/dist/cli-bundle/chunks/{chunk-7SM7VA5I.js → chunk-QGPE2H6Z.js} +19 -8
  295. package/dist/cli-bundle/chunks/chunk-QGPE2H6Z.js.map +7 -0
  296. package/dist/cli-bundle/chunks/chunk-QVTFFLR2.js +58 -0
  297. package/dist/cli-bundle/chunks/chunk-QVTFFLR2.js.map +1 -0
  298. package/dist/cli-bundle/chunks/{chunk-JCTZV7TO.js → chunk-QW2F6ARZ.js} +8 -5
  299. package/dist/cli-bundle/chunks/{chunk-JCTZV7TO.js.map → chunk-QW2F6ARZ.js.map} +1 -1
  300. package/dist/cli-bundle/chunks/{chunk-TOX7YQ7X.js → chunk-QXC3LWB7.js} +223 -50
  301. package/dist/cli-bundle/chunks/chunk-QXC3LWB7.js.map +1 -0
  302. package/dist/cli-bundle/chunks/{chunk-W6KNFAMZ.js → chunk-QXMXRPX5.js} +9 -8
  303. package/dist/cli-bundle/chunks/chunk-QXMXRPX5.js.map +7 -0
  304. package/dist/cli-bundle/chunks/{chunk-O3YCJOVX.js → chunk-R4AKUPKI.js} +3 -3
  305. package/dist/cli-bundle/chunks/{chunk-O3YCJOVX.js.map → chunk-R4AKUPKI.js.map} +1 -1
  306. package/dist/cli-bundle/chunks/chunk-RASR23HV.js +394 -0
  307. package/dist/cli-bundle/chunks/chunk-RASR23HV.js.map +1 -0
  308. package/dist/cli-bundle/chunks/{chunk-JW7D6437.js → chunk-SCDCNGCV.js} +20 -9
  309. package/dist/cli-bundle/chunks/chunk-SCDCNGCV.js.map +1 -0
  310. package/dist/cli-bundle/chunks/{chunk-GRZGHGRG.js → chunk-SCS5PVAA.js} +10 -9
  311. package/dist/cli-bundle/chunks/{chunk-GRZGHGRG.js.map → chunk-SCS5PVAA.js.map} +2 -2
  312. package/dist/cli-bundle/chunks/{chunk-S2CDTRJ6.js → chunk-SJCMTOEU.js} +381 -271
  313. package/dist/cli-bundle/chunks/chunk-SJCMTOEU.js.map +1 -0
  314. package/dist/cli-bundle/chunks/{chunk-XWDZVCBJ.js → chunk-SO2ES46D.js} +11 -10
  315. package/dist/cli-bundle/chunks/{chunk-XWDZVCBJ.js.map → chunk-SO2ES46D.js.map} +1 -1
  316. package/dist/cli-bundle/chunks/{chunk-MACCNKSZ.js → chunk-TBV33CB4.js} +36 -62
  317. package/dist/cli-bundle/chunks/chunk-TBV33CB4.js.map +7 -0
  318. package/dist/cli-bundle/chunks/chunk-TEFEXQWI.js +86 -0
  319. package/dist/cli-bundle/chunks/chunk-TEFEXQWI.js.map +7 -0
  320. package/dist/cli-bundle/chunks/{chunk-HLEGAQXT.js → chunk-TWBDDVIF.js} +20 -7
  321. package/dist/cli-bundle/chunks/chunk-TWBDDVIF.js.map +7 -0
  322. package/dist/cli-bundle/chunks/{chunk-4JHJ7YG2.js → chunk-UGUJ2UOR.js} +118 -74
  323. package/dist/cli-bundle/chunks/chunk-UGUJ2UOR.js.map +7 -0
  324. package/dist/cli-bundle/chunks/{chunk-XOYHMHFF.js → chunk-UN6P3IJ4.js} +3 -3
  325. package/dist/cli-bundle/chunks/{chunk-32XSW44C.js → chunk-V2GYOMEX.js} +10 -9
  326. package/dist/cli-bundle/chunks/chunk-V2GYOMEX.js.map +1 -0
  327. package/dist/cli-bundle/chunks/{chunk-HWHONML5.js → chunk-VF3KQGNY.js} +4 -4
  328. package/dist/cli-bundle/chunks/{chunk-SOHXUA2Q.js → chunk-VHG6LUKR.js} +116 -36
  329. package/dist/cli-bundle/chunks/chunk-VHG6LUKR.js.map +1 -0
  330. package/dist/cli-bundle/chunks/{chunk-7CRFV6JR.js → chunk-VXHMQDXA.js} +483 -27
  331. package/dist/cli-bundle/chunks/chunk-VXHMQDXA.js.map +7 -0
  332. package/dist/cli-bundle/chunks/{chunk-IZHCCG4S.js → chunk-VXRFAE7W.js} +14 -9
  333. package/dist/cli-bundle/chunks/chunk-VXRFAE7W.js.map +1 -0
  334. package/dist/cli-bundle/chunks/{chunk-R4VWYWRN.js → chunk-W3HFLORZ.js} +7 -2
  335. package/dist/cli-bundle/chunks/chunk-W3HFLORZ.js.map +7 -0
  336. package/dist/cli-bundle/chunks/{chunk-4FHLNNW7.js → chunk-WQRL4COW.js} +74 -14
  337. package/dist/cli-bundle/chunks/chunk-WQRL4COW.js.map +7 -0
  338. package/dist/cli-bundle/chunks/chunk-X3W5ESZQ.js +32 -0
  339. package/dist/cli-bundle/chunks/chunk-X3W5ESZQ.js.map +1 -0
  340. package/dist/cli-bundle/chunks/{chunk-MGAQ6KZG.js → chunk-XESAPVZ4.js} +166 -27
  341. package/dist/cli-bundle/chunks/chunk-XESAPVZ4.js.map +7 -0
  342. package/dist/cli-bundle/chunks/{chunk-PEH7SZD2.js → chunk-YLAW3FZN.js} +105 -31
  343. package/dist/cli-bundle/chunks/chunk-YLAW3FZN.js.map +7 -0
  344. package/dist/cli-bundle/chunks/{claim-HE6KEGJW.js → claim-WGAWJCPY.js} +10 -10
  345. package/dist/cli-bundle/chunks/{claim-QJOQBH7J.js → claim-ZI6P4LMU.js} +10 -10
  346. package/dist/cli-bundle/chunks/close-I7PRQ5G7.js +13 -0
  347. package/dist/cli-bundle/chunks/{close-SPUFW5QR.js → close-JMVVSIQE.js} +8 -8
  348. package/dist/cli-bundle/chunks/{close-many-GKAJX54X.js → close-many-IKPJXVOZ.js} +32 -20
  349. package/dist/cli-bundle/chunks/close-many-IKPJXVOZ.js.map +1 -0
  350. package/dist/cli-bundle/chunks/{close-many-GL6NRUU5.js → close-many-TXABDCSJ.js} +31 -19
  351. package/dist/cli-bundle/chunks/close-many-TXABDCSJ.js.map +7 -0
  352. package/dist/cli-bundle/chunks/{comments-5FPT6L7N.js → comments-RLWR2S7W.js} +55 -31
  353. package/dist/cli-bundle/chunks/comments-RLWR2S7W.js.map +1 -0
  354. package/dist/cli-bundle/chunks/{comments-TOLOYWNI.js → comments-YAMXKHUX.js} +54 -30
  355. package/dist/cli-bundle/chunks/comments-YAMXKHUX.js.map +7 -0
  356. package/dist/cli-bundle/chunks/{config-7N6D7YJE.js → config-7ICYC2WU.js} +83 -19
  357. package/dist/cli-bundle/chunks/config-7ICYC2WU.js.map +7 -0
  358. package/dist/cli-bundle/chunks/{config-4MN45TIH.js → config-NGWN3EXC.js} +83 -19
  359. package/dist/cli-bundle/chunks/config-NGWN3EXC.js.map +1 -0
  360. package/dist/cli-bundle/chunks/{context-AQSLE7DZ.js → context-K6QAHN5H.js} +128 -39
  361. package/dist/cli-bundle/chunks/context-K6QAHN5H.js.map +1 -0
  362. package/dist/cli-bundle/chunks/{context-U3PUJMVN.js → context-VGXOOAH2.js} +127 -38
  363. package/dist/cli-bundle/chunks/context-VGXOOAH2.js.map +7 -0
  364. package/dist/cli-bundle/chunks/{contracts-ITSJXO3O.js → contracts-KJGY2AQA.js} +99 -15
  365. package/dist/cli-bundle/chunks/contracts-KJGY2AQA.js.map +1 -0
  366. package/dist/cli-bundle/chunks/{contracts-H7KCQXLY.js → contracts-KMA6OJY7.js} +99 -15
  367. package/dist/cli-bundle/chunks/contracts-KMA6OJY7.js.map +7 -0
  368. package/dist/cli-bundle/chunks/{copy-EB3MUCSW.js → copy-Q2PPU4AY.js} +7 -7
  369. package/dist/cli-bundle/chunks/{copy-C4W522JM.js → copy-SC6UF3PI.js} +7 -7
  370. package/dist/cli-bundle/chunks/{create-4EQNELMY.js → create-76FE7JVF.js} +16 -13
  371. package/dist/cli-bundle/chunks/create-RTRFW6RE.js +30 -0
  372. package/dist/cli-bundle/chunks/{delete-X5QLXIQX.js → delete-T6DJSUJI.js} +7 -7
  373. package/dist/cli-bundle/chunks/{delete-ZLGUYIXU.js → delete-XFUX533E.js} +7 -7
  374. package/dist/cli-bundle/chunks/{deps-GPB3LGWN.js → deps-5GWMMS6D.js} +9 -10
  375. package/dist/cli-bundle/chunks/{deps-GPB3LGWN.js.map → deps-5GWMMS6D.js.map} +2 -2
  376. package/dist/cli-bundle/chunks/{deps-HV2C2L46.js → deps-MCCU633S.js} +10 -11
  377. package/dist/cli-bundle/chunks/deps-MCCU633S.js.map +1 -0
  378. package/dist/cli-bundle/chunks/{docs-SRTLCQOL.js → docs-HE3HCQ4S.js} +9 -9
  379. package/dist/cli-bundle/chunks/{docs-RJQPLROO.js → docs-SXMOABHR.js} +9 -9
  380. package/dist/cli-bundle/chunks/{extension-WKPVPNCC.js → extension-E23K4QRR.js} +7 -5
  381. package/dist/cli-bundle/chunks/{extension-MM3TVWOO.js → extension-PMD3XMLN.js} +7 -5
  382. package/dist/cli-bundle/chunks/{files-OIFN3DQX.js → files-2RSWGPEU.js} +25 -11
  383. package/dist/cli-bundle/chunks/files-2RSWGPEU.js.map +1 -0
  384. package/dist/cli-bundle/chunks/{files-LIFDKNCN.js → files-ZWFJFWBK.js} +24 -10
  385. package/dist/cli-bundle/chunks/files-ZWFJFWBK.js.map +7 -0
  386. package/dist/cli-bundle/chunks/focus-KTTB3P3F.js +106 -0
  387. package/dist/cli-bundle/chunks/focus-KTTB3P3F.js.map +1 -0
  388. package/dist/cli-bundle/chunks/focus-ZMDP4FEL.js +109 -0
  389. package/dist/cli-bundle/chunks/focus-ZMDP4FEL.js.map +7 -0
  390. package/dist/cli-bundle/chunks/{gc-NRFHLVFT.js → gc-BXIAKLAH.js} +3 -3
  391. package/dist/cli-bundle/chunks/{gc-DL6AVOX5.js → gc-C7K6JNUO.js} +3 -3
  392. package/dist/cli-bundle/chunks/{get-SAB7CRBG.js → get-AZQLC4NO.js} +43 -16
  393. package/dist/cli-bundle/chunks/get-AZQLC4NO.js.map +1 -0
  394. package/dist/cli-bundle/chunks/{get-K7UULTQF.js → get-I65HTAWO.js} +42 -15
  395. package/dist/cli-bundle/chunks/get-I65HTAWO.js.map +7 -0
  396. package/dist/cli-bundle/chunks/{health-NUVZYIEV.js → health-3MFFPQVZ.js} +75 -49
  397. package/dist/cli-bundle/chunks/health-3MFFPQVZ.js.map +1 -0
  398. package/dist/cli-bundle/chunks/{health-VJWH3ZFK.js → health-MYZEOCLI.js} +74 -48
  399. package/dist/cli-bundle/chunks/health-MYZEOCLI.js.map +7 -0
  400. package/dist/cli-bundle/chunks/{history-GYFD2DJW.js → history-73Z6OBFZ.js} +10 -10
  401. package/dist/cli-bundle/chunks/history-BIPHVUMF.js +20 -0
  402. package/dist/cli-bundle/chunks/{history-compact-WQZQ6KXM.js → history-compact-24VQ63A3.js} +37 -46
  403. package/dist/cli-bundle/chunks/history-compact-24VQ63A3.js.map +7 -0
  404. package/dist/cli-bundle/chunks/{history-compact-SLL6ESXH.js → history-compact-UIAR2OI4.js} +38 -47
  405. package/dist/cli-bundle/chunks/history-compact-UIAR2OI4.js.map +1 -0
  406. package/dist/cli-bundle/chunks/{history-redact-SDTDR6WM.js → history-redact-7YCXEWJD.js} +13 -11
  407. package/dist/cli-bundle/chunks/history-redact-WZZ6GZ2Z.js +21 -0
  408. package/dist/cli-bundle/chunks/{history-repair-BJCGM6Q3.js → history-repair-4NOFFG2W.js} +44 -49
  409. package/dist/cli-bundle/chunks/history-repair-4NOFFG2W.js.map +1 -0
  410. package/dist/cli-bundle/chunks/{history-repair-UCYS55ZX.js → history-repair-GQN2X4TR.js} +43 -48
  411. package/dist/cli-bundle/chunks/history-repair-GQN2X4TR.js.map +7 -0
  412. package/dist/cli-bundle/chunks/init-K34V4PZR.js +20 -0
  413. package/dist/cli-bundle/chunks/{init-MXV57LKL.js → init-TDEDNVMM.js} +12 -9
  414. package/dist/cli-bundle/chunks/{learnings-QKJOKEAO.js → learnings-TV2CTGJ3.js} +13 -12
  415. package/dist/cli-bundle/chunks/learnings-TV2CTGJ3.js.map +7 -0
  416. package/dist/cli-bundle/chunks/{learnings-L6KTZGOT.js → learnings-U67FTXPB.js} +14 -13
  417. package/dist/cli-bundle/chunks/learnings-U67FTXPB.js.map +1 -0
  418. package/dist/cli-bundle/chunks/list-MSHYOCFU.js +33 -0
  419. package/dist/cli-bundle/chunks/list-VV57WGUD.js +29 -0
  420. package/dist/cli-bundle/chunks/{notes-HMCB7TK6.js → notes-EUANWWKD.js} +13 -12
  421. package/dist/cli-bundle/chunks/notes-EUANWWKD.js.map +7 -0
  422. package/dist/cli-bundle/chunks/{notes-3NLK7WTZ.js → notes-GYVNDAL4.js} +14 -13
  423. package/dist/cli-bundle/chunks/notes-GYVNDAL4.js.map +1 -0
  424. package/dist/cli-bundle/chunks/{plan-NANUWH4T.js → plan-4LF4AV63.js} +15 -14
  425. package/dist/cli-bundle/chunks/plan-4LF4AV63.js.map +7 -0
  426. package/dist/cli-bundle/chunks/{plan-DWBYI5C6.js → plan-W27O6DBS.js} +16 -15
  427. package/dist/cli-bundle/chunks/plan-W27O6DBS.js.map +1 -0
  428. package/dist/cli-bundle/chunks/{register-list-query-SMMMLSWW.js → register-list-query-BXLEHJ7L.js} +32 -23
  429. package/dist/cli-bundle/chunks/register-list-query-BXLEHJ7L.js.map +1 -0
  430. package/dist/cli-bundle/chunks/{register-list-query-PWQ5F2VI.js → register-list-query-C2MS3BVQ.js} +31 -22
  431. package/dist/cli-bundle/chunks/register-list-query-C2MS3BVQ.js.map +7 -0
  432. package/dist/cli-bundle/chunks/{register-mutation-QKFPTIZG.js → register-mutation-6UCOEQ6L.js} +361 -106
  433. package/dist/cli-bundle/chunks/register-mutation-6UCOEQ6L.js.map +7 -0
  434. package/dist/cli-bundle/chunks/{register-mutation-ZYJQ4DVP.js → register-mutation-HE73PREP.js} +355 -107
  435. package/dist/cli-bundle/chunks/register-mutation-HE73PREP.js.map +1 -0
  436. package/dist/cli-bundle/chunks/{register-operations-2FMZ6WEF.js → register-operations-L6C32FDA.js} +111 -39
  437. package/dist/cli-bundle/chunks/register-operations-L6C32FDA.js.map +7 -0
  438. package/dist/cli-bundle/chunks/{register-operations-BAFQURZG.js → register-operations-QQEHEX4P.js} +112 -40
  439. package/dist/cli-bundle/chunks/register-operations-QQEHEX4P.js.map +1 -0
  440. package/dist/cli-bundle/chunks/{register-setup-QN2XV7UL.js → register-setup-A7N4PNT3.js} +18 -21
  441. package/dist/cli-bundle/chunks/register-setup-A7N4PNT3.js.map +1 -0
  442. package/dist/cli-bundle/chunks/{register-setup-DQEIKBIP.js → register-setup-WHG3NBP6.js} +17 -20
  443. package/dist/cli-bundle/chunks/register-setup-WHG3NBP6.js.map +7 -0
  444. package/dist/cli-bundle/chunks/{restore-FJQWXMPY.js → restore-TSWSULYY.js} +13 -11
  445. package/dist/cli-bundle/chunks/restore-XQXICL3V.js +19 -0
  446. package/dist/cli-bundle/chunks/scheduling-shortcuts-NC46K6BD.js +91 -0
  447. package/dist/cli-bundle/chunks/scheduling-shortcuts-NC46K6BD.js.map +7 -0
  448. package/dist/cli-bundle/chunks/scheduling-shortcuts-UGDPQALY.js +88 -0
  449. package/dist/cli-bundle/chunks/scheduling-shortcuts-UGDPQALY.js.map +1 -0
  450. package/dist/cli-bundle/chunks/{schema-ZZ7ZDM2X.js → schema-7U7JUYGK.js} +797 -10
  451. package/dist/cli-bundle/chunks/schema-7U7JUYGK.js.map +1 -0
  452. package/dist/cli-bundle/chunks/{schema-RNVJ55V2.js → schema-TSBYSEMW.js} +810 -9
  453. package/dist/cli-bundle/chunks/schema-TSBYSEMW.js.map +7 -0
  454. package/dist/cli-bundle/chunks/{search-BJ457C2A.js → search-OXLSQKHP.js} +328 -71
  455. package/dist/cli-bundle/chunks/search-OXLSQKHP.js.map +7 -0
  456. package/dist/cli-bundle/chunks/{search-FQDZXX7P.js → search-T3TOFLOQ.js} +328 -71
  457. package/dist/cli-bundle/chunks/search-T3TOFLOQ.js.map +1 -0
  458. package/dist/cli-bundle/chunks/{stats-DUQWCVOS.js → stats-5CLG22YZ.js} +41 -16
  459. package/dist/cli-bundle/chunks/stats-5CLG22YZ.js.map +7 -0
  460. package/dist/cli-bundle/chunks/{stats-CUG3ZHOI.js → stats-XEMUXS42.js} +42 -17
  461. package/dist/cli-bundle/chunks/stats-XEMUXS42.js.map +1 -0
  462. package/dist/cli-bundle/chunks/{telemetry-RK2VX75A.js → telemetry-23OPBBZT.js} +7 -7
  463. package/dist/cli-bundle/chunks/telemetry-23OPBBZT.js.map +1 -0
  464. package/dist/cli-bundle/chunks/{telemetry-33MRGX4Z.js → telemetry-I3D7XZ55.js} +6 -6
  465. package/dist/cli-bundle/chunks/telemetry-I3D7XZ55.js.map +7 -0
  466. package/dist/cli-bundle/chunks/test-AROS3LIV.js +35 -0
  467. package/dist/cli-bundle/chunks/{test-Y3CTFMEC.js → test-CECIMKOA.js} +17 -14
  468. package/dist/cli-bundle/chunks/{test-all-ARSMX33Q.js → test-all-4DEQPIXH.js} +25 -17
  469. package/dist/cli-bundle/chunks/test-all-4DEQPIXH.js.map +1 -0
  470. package/dist/cli-bundle/chunks/{test-all-ANYQ33O2.js → test-all-6RO6X3SM.js} +24 -16
  471. package/dist/cli-bundle/chunks/test-all-6RO6X3SM.js.map +7 -0
  472. package/dist/cli-bundle/chunks/{test-runs-5URSD34O.js → test-runs-AAXVFWKH.js} +62 -65
  473. package/dist/cli-bundle/chunks/test-runs-AAXVFWKH.js.map +1 -0
  474. package/dist/cli-bundle/chunks/{test-runs-XNACGSNQ.js → test-runs-LYBQSYRC.js} +61 -64
  475. package/dist/cli-bundle/chunks/test-runs-LYBQSYRC.js.map +7 -0
  476. package/dist/cli-bundle/chunks/update-MIWEJC76.js +24 -0
  477. package/dist/cli-bundle/chunks/update-P7I5YSRB.js +28 -0
  478. package/dist/cli-bundle/chunks/{update-many-724JCVDE.js → update-many-5B4HLVBK.js} +79 -33
  479. package/dist/cli-bundle/chunks/update-many-5B4HLVBK.js.map +7 -0
  480. package/dist/cli-bundle/chunks/{update-many-6B7PJ33I.js → update-many-G2QOVZSB.js} +80 -34
  481. package/dist/cli-bundle/chunks/update-many-G2QOVZSB.js.map +1 -0
  482. package/dist/cli-bundle/chunks/{upgrade-QHRGDBSA.js → upgrade-GFIDL62L.js} +23 -9
  483. package/dist/cli-bundle/chunks/upgrade-GFIDL62L.js.map +1 -0
  484. package/dist/cli-bundle/chunks/{upgrade-ALBEZAI7.js → upgrade-QUQYL7D3.js} +22 -8
  485. package/dist/cli-bundle/chunks/upgrade-QUQYL7D3.js.map +7 -0
  486. package/dist/cli-bundle/chunks/{validate-UY6DRCG5.js → validate-ADDZBMM3.js} +236 -30
  487. package/dist/cli-bundle/chunks/validate-ADDZBMM3.js.map +7 -0
  488. package/dist/cli-bundle/chunks/{validate-IQRYFXIV.js → validate-MAS3H6ZP.js} +222 -30
  489. package/dist/cli-bundle/chunks/validate-MAS3H6ZP.js.map +1 -0
  490. package/dist/cli-bundle/main.js +312 -139
  491. package/dist/cli-bundle/main.js.map +3 -3
  492. package/dist/cli.d.ts +10 -0
  493. package/dist/cli.js +21 -8
  494. package/dist/cli.js.map +1 -1
  495. package/dist/core/config/nested-settings.js +40 -2
  496. package/dist/core/config/nested-settings.js.map +1 -1
  497. package/dist/core/diagnostics/remediation.js +7 -2
  498. package/dist/core/diagnostics/remediation.js.map +1 -1
  499. package/dist/core/extensions/extension-policy.js +14 -15
  500. package/dist/core/extensions/extension-policy.js.map +1 -1
  501. package/dist/core/extensions/item-fields.js +4 -5
  502. package/dist/core/extensions/item-fields.js.map +1 -1
  503. package/dist/core/extensions/loader.d.ts +75 -1
  504. package/dist/core/extensions/loader.js +56 -32
  505. package/dist/core/extensions/loader.js.map +1 -1
  506. package/dist/core/governance/content-fields.d.ts +84 -0
  507. package/dist/core/governance/content-fields.js +182 -0
  508. package/dist/core/governance/content-fields.js.map +1 -0
  509. package/dist/core/governance/issue-codes.d.ts +51 -0
  510. package/dist/core/governance/issue-codes.js +95 -0
  511. package/dist/core/governance/issue-codes.js.map +1 -0
  512. package/dist/core/governance/metadata-coverage.d.ts +168 -0
  513. package/dist/core/governance/metadata-coverage.js +362 -0
  514. package/dist/core/governance/metadata-coverage.js.map +1 -0
  515. package/dist/core/history/history-rewrite.d.ts +22 -0
  516. package/dist/core/history/history-rewrite.js +38 -2
  517. package/dist/core/history/history-rewrite.js.map +1 -1
  518. package/dist/core/history/history.d.ts +7 -0
  519. package/dist/core/history/history.js +6 -2
  520. package/dist/core/history/history.js.map +1 -1
  521. package/dist/core/io/body-file.d.ts +14 -0
  522. package/dist/core/io/body-file.js +47 -0
  523. package/dist/core/io/body-file.js.map +1 -0
  524. package/dist/core/item/item-format.d.ts +46 -1
  525. package/dist/core/item/item-format.js +51 -60
  526. package/dist/core/item/item-format.js.map +1 -1
  527. package/dist/core/item/parse.d.ts +41 -0
  528. package/dist/core/item/parse.js +69 -16
  529. package/dist/core/item/parse.js.map +1 -1
  530. package/dist/core/item/type-registry.d.ts +1 -0
  531. package/dist/core/item/type-registry.js +8 -10
  532. package/dist/core/item/type-registry.js.map +1 -1
  533. package/dist/core/lock/lock.d.ts +26 -0
  534. package/dist/core/lock/lock.js +10 -2
  535. package/dist/core/lock/lock.js.map +1 -1
  536. package/dist/core/output/output.d.ts +7 -0
  537. package/dist/core/output/output.js +6 -2
  538. package/dist/core/output/output.js.map +1 -1
  539. package/dist/core/schema/fields-file.d.ts +94 -0
  540. package/dist/core/schema/fields-file.js +317 -0
  541. package/dist/core/schema/fields-file.js.map +1 -0
  542. package/dist/core/schema/item-types-file.d.ts +25 -2
  543. package/dist/core/schema/item-types-file.js +78 -6
  544. package/dist/core/schema/item-types-file.js.map +1 -1
  545. package/dist/core/schema/runtime-schema.d.ts +7 -0
  546. package/dist/core/schema/runtime-schema.js +23 -16
  547. package/dist/core/schema/runtime-schema.js.map +1 -1
  548. package/dist/core/schema/type-inference.d.ts +34 -0
  549. package/dist/core/schema/type-inference.js +97 -0
  550. package/dist/core/schema/type-inference.js.map +1 -0
  551. package/dist/core/schema/type-presets.d.ts +30 -0
  552. package/dist/core/schema/type-presets.js +96 -0
  553. package/dist/core/schema/type-presets.js.map +1 -0
  554. package/dist/core/search/cache.d.ts +19 -1
  555. package/dist/core/search/cache.js +11 -3
  556. package/dist/core/search/cache.js.map +1 -1
  557. package/dist/core/search/corpus.d.ts +36 -2
  558. package/dist/core/search/corpus.js +120 -24
  559. package/dist/core/search/corpus.js.map +1 -1
  560. package/dist/core/search/providers.d.ts +19 -0
  561. package/dist/core/search/providers.js +19 -2
  562. package/dist/core/search/providers.js.map +1 -1
  563. package/dist/core/sentry/instrument.d.ts +1 -0
  564. package/dist/core/sentry/instrument.js +6 -2
  565. package/dist/core/sentry/instrument.js.map +1 -1
  566. package/dist/core/session/session-state.d.ts +16 -0
  567. package/dist/core/session/session-state.js +48 -0
  568. package/dist/core/session/session-state.js.map +1 -0
  569. package/dist/core/shared/constants.d.ts +8 -0
  570. package/dist/core/shared/constants.js +11 -2
  571. package/dist/core/shared/constants.js.map +1 -1
  572. package/dist/core/shared/text-normalization.js +4 -3
  573. package/dist/core/shared/text-normalization.js.map +1 -1
  574. package/dist/core/shared/time.d.ts +13 -0
  575. package/dist/core/shared/time.js +19 -7
  576. package/dist/core/shared/time.js.map +1 -1
  577. package/dist/core/store/front-matter-cache.d.ts +13 -0
  578. package/dist/core/store/front-matter-cache.js +21 -11
  579. package/dist/core/store/front-matter-cache.js.map +1 -1
  580. package/dist/core/store/item-store.d.ts +11 -0
  581. package/dist/core/store/item-store.js +12 -3
  582. package/dist/core/store/item-store.js.map +1 -1
  583. package/dist/core/store/settings-validator.d.ts +2 -0
  584. package/dist/core/store/settings-validator.js +25 -2
  585. package/dist/core/store/settings-validator.js.map +1 -1
  586. package/dist/core/store/settings.d.ts +60 -1
  587. package/dist/core/store/settings.js +100 -46
  588. package/dist/core/store/settings.js.map +1 -1
  589. package/dist/core/telemetry/observability.js +10 -8
  590. package/dist/core/telemetry/observability.js.map +1 -1
  591. package/dist/core/telemetry/runtime.d.ts +272 -1
  592. package/dist/core/telemetry/runtime.js +358 -37
  593. package/dist/core/telemetry/runtime.js.map +1 -1
  594. package/dist/core/test/background-runs.d.ts +35 -0
  595. package/dist/core/test/background-runs.js +72 -61
  596. package/dist/core/test/background-runs.js.map +1 -1
  597. package/dist/core/test/run-selectors.js +5 -4
  598. package/dist/core/test/run-selectors.js.map +1 -1
  599. package/dist/core/validate/estimate-defaults.d.ts +39 -0
  600. package/dist/core/validate/estimate-defaults.js +117 -0
  601. package/dist/core/validate/estimate-defaults.js.map +1 -0
  602. package/dist/core/validate/fix-planning.d.ts +21 -3
  603. package/dist/core/validate/fix-planning.js +31 -4
  604. package/dist/core/validate/fix-planning.js.map +1 -1
  605. package/dist/core/validate/missing-link-owners.d.ts +64 -0
  606. package/dist/core/validate/missing-link-owners.js +98 -0
  607. package/dist/core/validate/missing-link-owners.js.map +1 -0
  608. package/dist/mcp/server.d.ts +61 -0
  609. package/dist/mcp/server.js +98 -8
  610. package/dist/mcp/server.js.map +1 -1
  611. package/dist/mcp/tool-definitions.js +64 -10
  612. package/dist/mcp/tool-definitions.js.map +1 -1
  613. package/dist/sdk/cli-contracts/commander-types.js +13 -2
  614. package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
  615. package/dist/sdk/cli-contracts/enum-contracts.d.ts +2 -2
  616. package/dist/sdk/cli-contracts/enum-contracts.js +7 -2
  617. package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
  618. package/dist/sdk/cli-contracts/tool-option-contracts.js +110 -2
  619. package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
  620. package/dist/sdk/cli-contracts/tool-parameter-tables.js +127 -11
  621. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  622. package/dist/sdk/cli-contracts.d.ts +31 -0
  623. package/dist/sdk/cli-contracts.js +238 -12
  624. package/dist/sdk/cli-contracts.js.map +1 -1
  625. package/dist/types.d.ts +17 -1
  626. package/dist/types.js +3 -3
  627. package/dist/types.js.map +1 -1
  628. package/docs/AGENT_GUIDE.md +15 -3
  629. package/docs/CLAUDE_CODE_PLUGIN.md +2 -2
  630. package/docs/COMMANDS.md +171 -10
  631. package/docs/CONFIGURATION.md +135 -0
  632. package/docs/TESTING.md +6 -4
  633. package/package.json +6 -4
  634. package/packages/pm-calendar/extensions/calendar/runtime.js +6 -0
  635. package/packages/pm-calendar/extensions/calendar/runtime.ts +12 -0
  636. package/packages/pm-todos/extensions/todos/runtime.ts +5 -0
  637. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  638. package/plugins/pm-claude/README.md +3 -3
  639. package/plugins/pm-claude/commands/pm-init.md +1 -1
  640. package/plugins/pm-codex/README.md +1 -1
  641. package/scripts/bundle-cli.mjs +46 -37
  642. package/scripts/finalize-build.mjs +20 -9
  643. package/scripts/prepare-build-cache.mjs +27 -16
  644. package/dist/cli-bundle/chunks/activity-XIOTGZMU.js +0 -16
  645. package/dist/cli-bundle/chunks/aggregate-IRHJWEKG.js.map +0 -1
  646. package/dist/cli-bundle/chunks/aggregate-XEBW22UQ.js.map +0 -7
  647. package/dist/cli-bundle/chunks/append-NL67JNJU.js.map +0 -1
  648. package/dist/cli-bundle/chunks/chunk-2ANTZBYF.js.map +0 -1
  649. package/dist/cli-bundle/chunks/chunk-2J2AH4V5.js.map +0 -1
  650. package/dist/cli-bundle/chunks/chunk-32XSW44C.js.map +0 -1
  651. package/dist/cli-bundle/chunks/chunk-36BCSMKP.js.map +0 -7
  652. package/dist/cli-bundle/chunks/chunk-3VULHQNS.js.map +0 -1
  653. package/dist/cli-bundle/chunks/chunk-4FHLNNW7.js.map +0 -7
  654. package/dist/cli-bundle/chunks/chunk-4JHJ7YG2.js.map +0 -7
  655. package/dist/cli-bundle/chunks/chunk-4TPFXE2R.js.map +0 -1
  656. package/dist/cli-bundle/chunks/chunk-4ZKKZMLH.js.map +0 -1
  657. package/dist/cli-bundle/chunks/chunk-5HSAHRYA.js.map +0 -7
  658. package/dist/cli-bundle/chunks/chunk-6TBR5AZ2.js.map +0 -7
  659. package/dist/cli-bundle/chunks/chunk-7CRFV6JR.js.map +0 -7
  660. package/dist/cli-bundle/chunks/chunk-7SM7VA5I.js.map +0 -7
  661. package/dist/cli-bundle/chunks/chunk-AAUYXSFF.js.map +0 -7
  662. package/dist/cli-bundle/chunks/chunk-AGG32LKL.js.map +0 -1
  663. package/dist/cli-bundle/chunks/chunk-AUDDXKNX.js.map +0 -1
  664. package/dist/cli-bundle/chunks/chunk-BVL5KGVA.js.map +0 -1
  665. package/dist/cli-bundle/chunks/chunk-C24PWDFG.js +0 -138
  666. package/dist/cli-bundle/chunks/chunk-C24PWDFG.js.map +0 -7
  667. package/dist/cli-bundle/chunks/chunk-HLEGAQXT.js.map +0 -7
  668. package/dist/cli-bundle/chunks/chunk-HZOX5BYD.js.map +0 -7
  669. package/dist/cli-bundle/chunks/chunk-IXVSSHGV.js.map +0 -7
  670. package/dist/cli-bundle/chunks/chunk-IZHCCG4S.js.map +0 -1
  671. package/dist/cli-bundle/chunks/chunk-JW7D6437.js.map +0 -1
  672. package/dist/cli-bundle/chunks/chunk-JWXTOYBI.js.map +0 -7
  673. package/dist/cli-bundle/chunks/chunk-KHGTYCJ6.js.map +0 -1
  674. package/dist/cli-bundle/chunks/chunk-L6YQONLM.js.map +0 -1
  675. package/dist/cli-bundle/chunks/chunk-LFW5NQUP.js.map +0 -7
  676. package/dist/cli-bundle/chunks/chunk-LYNQ3NGI.js.map +0 -1
  677. package/dist/cli-bundle/chunks/chunk-M3SI2REU.js.map +0 -7
  678. package/dist/cli-bundle/chunks/chunk-MACCNKSZ.js.map +0 -7
  679. package/dist/cli-bundle/chunks/chunk-MGAQ6KZG.js.map +0 -7
  680. package/dist/cli-bundle/chunks/chunk-PEH7SZD2.js.map +0 -7
  681. package/dist/cli-bundle/chunks/chunk-PNYAAB4S.js.map +0 -1
  682. package/dist/cli-bundle/chunks/chunk-QQG4HEX7.js.map +0 -1
  683. package/dist/cli-bundle/chunks/chunk-R4VWYWRN.js.map +0 -7
  684. package/dist/cli-bundle/chunks/chunk-RFR2YQGO.js.map +0 -1
  685. package/dist/cli-bundle/chunks/chunk-RHYBR6G7.js.map +0 -1
  686. package/dist/cli-bundle/chunks/chunk-S2CDTRJ6.js.map +0 -1
  687. package/dist/cli-bundle/chunks/chunk-SGMGMCIF.js.map +0 -1
  688. package/dist/cli-bundle/chunks/chunk-SOHXUA2Q.js.map +0 -1
  689. package/dist/cli-bundle/chunks/chunk-SQDKAEKG.js.map +0 -7
  690. package/dist/cli-bundle/chunks/chunk-TOX7YQ7X.js.map +0 -1
  691. package/dist/cli-bundle/chunks/chunk-TSXWFN3L.js.map +0 -1
  692. package/dist/cli-bundle/chunks/chunk-UCVJP4JL.js.map +0 -7
  693. package/dist/cli-bundle/chunks/chunk-V4KP3TCN.js +0 -128
  694. package/dist/cli-bundle/chunks/chunk-V4KP3TCN.js.map +0 -1
  695. package/dist/cli-bundle/chunks/chunk-VNC2HBL4.js.map +0 -1
  696. package/dist/cli-bundle/chunks/chunk-W6KNFAMZ.js.map +0 -7
  697. package/dist/cli-bundle/chunks/chunk-WLH7X4RN.js.map +0 -7
  698. package/dist/cli-bundle/chunks/chunk-XXLMJDUB.js.map +0 -7
  699. package/dist/cli-bundle/chunks/close-WOG5WTMZ.js +0 -13
  700. package/dist/cli-bundle/chunks/close-many-GKAJX54X.js.map +0 -1
  701. package/dist/cli-bundle/chunks/close-many-GL6NRUU5.js.map +0 -7
  702. package/dist/cli-bundle/chunks/comments-5FPT6L7N.js.map +0 -1
  703. package/dist/cli-bundle/chunks/comments-TOLOYWNI.js.map +0 -7
  704. package/dist/cli-bundle/chunks/config-4MN45TIH.js.map +0 -1
  705. package/dist/cli-bundle/chunks/config-7N6D7YJE.js.map +0 -7
  706. package/dist/cli-bundle/chunks/context-AQSLE7DZ.js.map +0 -1
  707. package/dist/cli-bundle/chunks/context-U3PUJMVN.js.map +0 -7
  708. package/dist/cli-bundle/chunks/contracts-H7KCQXLY.js.map +0 -7
  709. package/dist/cli-bundle/chunks/contracts-ITSJXO3O.js.map +0 -1
  710. package/dist/cli-bundle/chunks/create-NW3K7LVG.js +0 -27
  711. package/dist/cli-bundle/chunks/deps-HV2C2L46.js.map +0 -1
  712. package/dist/cli-bundle/chunks/files-LIFDKNCN.js.map +0 -7
  713. package/dist/cli-bundle/chunks/files-OIFN3DQX.js.map +0 -1
  714. package/dist/cli-bundle/chunks/get-K7UULTQF.js.map +0 -7
  715. package/dist/cli-bundle/chunks/get-SAB7CRBG.js.map +0 -1
  716. package/dist/cli-bundle/chunks/health-NUVZYIEV.js.map +0 -1
  717. package/dist/cli-bundle/chunks/health-VJWH3ZFK.js.map +0 -7
  718. package/dist/cli-bundle/chunks/history-IUVN4NTN.js +0 -20
  719. package/dist/cli-bundle/chunks/history-compact-SLL6ESXH.js.map +0 -1
  720. package/dist/cli-bundle/chunks/history-compact-WQZQ6KXM.js.map +0 -7
  721. package/dist/cli-bundle/chunks/history-redact-75KIIJUJ.js +0 -19
  722. package/dist/cli-bundle/chunks/history-repair-BJCGM6Q3.js.map +0 -1
  723. package/dist/cli-bundle/chunks/history-repair-UCYS55ZX.js.map +0 -7
  724. package/dist/cli-bundle/chunks/init-JJFYRUKG.js +0 -17
  725. package/dist/cli-bundle/chunks/learnings-L6KTZGOT.js.map +0 -1
  726. package/dist/cli-bundle/chunks/learnings-QKJOKEAO.js.map +0 -7
  727. package/dist/cli-bundle/chunks/list-GGVPXEV6.js +0 -23
  728. package/dist/cli-bundle/chunks/list-VOQDQHA4.js +0 -19
  729. package/dist/cli-bundle/chunks/notes-3NLK7WTZ.js.map +0 -1
  730. package/dist/cli-bundle/chunks/notes-HMCB7TK6.js.map +0 -7
  731. package/dist/cli-bundle/chunks/plan-DWBYI5C6.js.map +0 -1
  732. package/dist/cli-bundle/chunks/plan-NANUWH4T.js.map +0 -7
  733. package/dist/cli-bundle/chunks/register-list-query-PWQ5F2VI.js.map +0 -7
  734. package/dist/cli-bundle/chunks/register-list-query-SMMMLSWW.js.map +0 -1
  735. package/dist/cli-bundle/chunks/register-mutation-QKFPTIZG.js.map +0 -7
  736. package/dist/cli-bundle/chunks/register-mutation-ZYJQ4DVP.js.map +0 -1
  737. package/dist/cli-bundle/chunks/register-operations-2FMZ6WEF.js.map +0 -7
  738. package/dist/cli-bundle/chunks/register-operations-BAFQURZG.js.map +0 -1
  739. package/dist/cli-bundle/chunks/register-setup-DQEIKBIP.js.map +0 -7
  740. package/dist/cli-bundle/chunks/register-setup-QN2XV7UL.js.map +0 -1
  741. package/dist/cli-bundle/chunks/restore-DRBNXJJH.js +0 -17
  742. package/dist/cli-bundle/chunks/schema-RNVJ55V2.js.map +0 -7
  743. package/dist/cli-bundle/chunks/schema-ZZ7ZDM2X.js.map +0 -1
  744. package/dist/cli-bundle/chunks/search-BJ457C2A.js.map +0 -7
  745. package/dist/cli-bundle/chunks/search-FQDZXX7P.js.map +0 -1
  746. package/dist/cli-bundle/chunks/stats-CUG3ZHOI.js.map +0 -1
  747. package/dist/cli-bundle/chunks/stats-DUQWCVOS.js.map +0 -7
  748. package/dist/cli-bundle/chunks/telemetry-33MRGX4Z.js.map +0 -7
  749. package/dist/cli-bundle/chunks/telemetry-RK2VX75A.js.map +0 -1
  750. package/dist/cli-bundle/chunks/test-SDMYEQHH.js +0 -32
  751. package/dist/cli-bundle/chunks/test-all-ANYQ33O2.js.map +0 -7
  752. package/dist/cli-bundle/chunks/test-all-ARSMX33Q.js.map +0 -1
  753. package/dist/cli-bundle/chunks/test-runs-5URSD34O.js.map +0 -1
  754. package/dist/cli-bundle/chunks/test-runs-XNACGSNQ.js.map +0 -7
  755. package/dist/cli-bundle/chunks/update-PD46VOXI.js +0 -21
  756. package/dist/cli-bundle/chunks/update-U235A7WP.js +0 -25
  757. package/dist/cli-bundle/chunks/update-many-6B7PJ33I.js.map +0 -1
  758. package/dist/cli-bundle/chunks/update-many-724JCVDE.js.map +0 -7
  759. package/dist/cli-bundle/chunks/upgrade-ALBEZAI7.js.map +0 -7
  760. package/dist/cli-bundle/chunks/upgrade-QHRGDBSA.js.map +0 -1
  761. package/dist/cli-bundle/chunks/validate-IQRYFXIV.js.map +0 -1
  762. package/dist/cli-bundle/chunks/validate-UY6DRCG5.js.map +0 -7
  763. /package/dist/cli-bundle/chunks/{activity-XIOTGZMU.js.map → activity-PZYSZA26.js.map} +0 -0
  764. /package/dist/cli-bundle/chunks/{activity-PPO7QWJF.js.map → activity-SFM4THAU.js.map} +0 -0
  765. /package/dist/cli-bundle/chunks/{chunk-IIOIBAQW.js.map → chunk-26BM6YLO.js.map} +0 -0
  766. /package/dist/cli-bundle/chunks/{chunk-LSSTKL3Y.js.map → chunk-2TMKMTEI.js.map} +0 -0
  767. /package/dist/cli-bundle/chunks/{chunk-QU3OPNVV.js.map → chunk-2VH7DFSJ.js.map} +0 -0
  768. /package/dist/cli-bundle/chunks/{chunk-LGOXXQUW.js.map → chunk-5XGWFUW2.js.map} +0 -0
  769. /package/dist/cli-bundle/chunks/{chunk-Z647PYLD.js.map → chunk-AJCQ5GT6.js.map} +0 -0
  770. /package/dist/cli-bundle/chunks/{chunk-DWG4FHPY.js.map → chunk-BITCVGHT.js.map} +0 -0
  771. /package/dist/cli-bundle/chunks/{chunk-JE5IZXDS.js.map → chunk-CGQTFWYI.js.map} +0 -0
  772. /package/dist/cli-bundle/chunks/{chunk-VYZNX4C5.js.map → chunk-COVLE33A.js.map} +0 -0
  773. /package/dist/cli-bundle/chunks/{chunk-6ZFTM65G.js.map → chunk-F5MSD5HE.js.map} +0 -0
  774. /package/dist/cli-bundle/chunks/{chunk-GOO4UXBI.js.map → chunk-JZHL4E3Q.js.map} +0 -0
  775. /package/dist/cli-bundle/chunks/{chunk-NN6RKGFW.js.map → chunk-KCAGIH6K.js.map} +0 -0
  776. /package/dist/cli-bundle/chunks/{chunk-3CQPVBK3.js.map → chunk-MIBX6ZRN.js.map} +0 -0
  777. /package/dist/cli-bundle/chunks/{chunk-XOYHMHFF.js.map → chunk-UN6P3IJ4.js.map} +0 -0
  778. /package/dist/cli-bundle/chunks/{chunk-HWHONML5.js.map → chunk-VF3KQGNY.js.map} +0 -0
  779. /package/dist/cli-bundle/chunks/{claim-HE6KEGJW.js.map → claim-WGAWJCPY.js.map} +0 -0
  780. /package/dist/cli-bundle/chunks/{claim-QJOQBH7J.js.map → claim-ZI6P4LMU.js.map} +0 -0
  781. /package/dist/cli-bundle/chunks/{close-WOG5WTMZ.js.map → close-I7PRQ5G7.js.map} +0 -0
  782. /package/dist/cli-bundle/chunks/{close-SPUFW5QR.js.map → close-JMVVSIQE.js.map} +0 -0
  783. /package/dist/cli-bundle/chunks/{copy-EB3MUCSW.js.map → copy-Q2PPU4AY.js.map} +0 -0
  784. /package/dist/cli-bundle/chunks/{copy-C4W522JM.js.map → copy-SC6UF3PI.js.map} +0 -0
  785. /package/dist/cli-bundle/chunks/{create-4EQNELMY.js.map → create-76FE7JVF.js.map} +0 -0
  786. /package/dist/cli-bundle/chunks/{create-NW3K7LVG.js.map → create-RTRFW6RE.js.map} +0 -0
  787. /package/dist/cli-bundle/chunks/{delete-X5QLXIQX.js.map → delete-T6DJSUJI.js.map} +0 -0
  788. /package/dist/cli-bundle/chunks/{delete-ZLGUYIXU.js.map → delete-XFUX533E.js.map} +0 -0
  789. /package/dist/cli-bundle/chunks/{docs-SRTLCQOL.js.map → docs-HE3HCQ4S.js.map} +0 -0
  790. /package/dist/cli-bundle/chunks/{docs-RJQPLROO.js.map → docs-SXMOABHR.js.map} +0 -0
  791. /package/dist/cli-bundle/chunks/{extension-WKPVPNCC.js.map → extension-E23K4QRR.js.map} +0 -0
  792. /package/dist/cli-bundle/chunks/{extension-MM3TVWOO.js.map → extension-PMD3XMLN.js.map} +0 -0
  793. /package/dist/cli-bundle/chunks/{gc-NRFHLVFT.js.map → gc-BXIAKLAH.js.map} +0 -0
  794. /package/dist/cli-bundle/chunks/{gc-DL6AVOX5.js.map → gc-C7K6JNUO.js.map} +0 -0
  795. /package/dist/cli-bundle/chunks/{history-GYFD2DJW.js.map → history-73Z6OBFZ.js.map} +0 -0
  796. /package/dist/cli-bundle/chunks/{history-IUVN4NTN.js.map → history-BIPHVUMF.js.map} +0 -0
  797. /package/dist/cli-bundle/chunks/{history-redact-SDTDR6WM.js.map → history-redact-7YCXEWJD.js.map} +0 -0
  798. /package/dist/cli-bundle/chunks/{history-redact-75KIIJUJ.js.map → history-redact-WZZ6GZ2Z.js.map} +0 -0
  799. /package/dist/cli-bundle/chunks/{init-JJFYRUKG.js.map → init-K34V4PZR.js.map} +0 -0
  800. /package/dist/cli-bundle/chunks/{init-MXV57LKL.js.map → init-TDEDNVMM.js.map} +0 -0
  801. /package/dist/cli-bundle/chunks/{list-GGVPXEV6.js.map → list-MSHYOCFU.js.map} +0 -0
  802. /package/dist/cli-bundle/chunks/{list-VOQDQHA4.js.map → list-VV57WGUD.js.map} +0 -0
  803. /package/dist/cli-bundle/chunks/{restore-FJQWXMPY.js.map → restore-TSWSULYY.js.map} +0 -0
  804. /package/dist/cli-bundle/chunks/{restore-DRBNXJJH.js.map → restore-XQXICL3V.js.map} +0 -0
  805. /package/dist/cli-bundle/chunks/{test-SDMYEQHH.js.map → test-AROS3LIV.js.map} +0 -0
  806. /package/dist/cli-bundle/chunks/{test-Y3CTFMEC.js.map → test-CECIMKOA.js.map} +0 -0
  807. /package/dist/cli-bundle/chunks/{update-PD46VOXI.js.map → update-MIWEJC76.js.map} +0 -0
  808. /package/dist/cli-bundle/chunks/{update-U235A7WP.js.map → update-P7I5YSRB.js.map} +0 -0
@@ -105,8 +105,29 @@ export interface BackgroundRunLogsResult {
105
105
  stdout: string[];
106
106
  stderr: string[];
107
107
  }
108
+ interface WorkerEvaluationResult {
109
+ summary: BackgroundRunSummary;
110
+ parsedResult: unknown | null;
111
+ }
108
112
  export declare function buildBackgroundTestRunFingerprint(kind: BackgroundTestRunKind, commandArgs: string[], pmRoot: string): string;
113
+ declare function isPidRunning(pid: number | undefined): boolean;
109
114
  export declare function readBackgroundTestRunRecord(pmRoot: string, runId: string): Promise<BackgroundTestRunRecord | null>;
115
+ declare function parseLinuxRssStatus(raw: string): number | undefined;
116
+ declare function readLinuxRssBytes(pid: number): Promise<number | undefined>;
117
+ declare function parseLinuxCpuStat(raw: string): {
118
+ cpu_user_seconds?: number;
119
+ cpu_system_seconds?: number;
120
+ };
121
+ declare function readLinuxCpuSeconds(pid: number): Promise<{
122
+ cpu_user_seconds?: number;
123
+ cpu_system_seconds?: number;
124
+ }>;
125
+ declare function buildResourceSnapshot(record: BackgroundTestRunRecord): Promise<BackgroundRunResourceSnapshot | undefined>;
126
+ declare function evaluateWorkerResult(kind: BackgroundTestRunKind, payload: unknown): WorkerEvaluationResult;
127
+ declare function parseProgressLine(stderrLine: string): Partial<BackgroundRunProgress> | null;
128
+ declare function splitLines(value: string): string[];
129
+ declare function tailLines(value: string, limit: number): string[];
130
+ declare function refreshRunIfStale(pmRoot: string, record: BackgroundTestRunRecord): Promise<BackgroundTestRunRecord>;
110
131
  export declare function startBackgroundTestRun(options: StartBackgroundTestRunOptions): Promise<StartBackgroundTestRunResult>;
111
132
  export declare function spawnBackgroundTestRunWorker(options: SpawnBackgroundTestRunWorkerOptions): Promise<BackgroundTestRunRecord>;
112
133
  export declare function runBackgroundTestRunWorker(pmRoot: string, runId: string, noExtensions?: boolean): Promise<BackgroundTestRunRecord>;
@@ -115,3 +136,17 @@ export declare function getBackgroundTestRunStatus(pmRoot: string, runId: string
115
136
  export declare function stopBackgroundTestRun(pmRoot: string, runId: string, force?: boolean): Promise<StopBackgroundTestRunResult>;
116
137
  export declare function resumeBackgroundTestRun(pmRoot: string, runId: string, requestedBy: string, noExtensions?: boolean): Promise<BackgroundTestRunRecord>;
117
138
  export declare function readBackgroundTestRunLogs(pmRoot: string, runId: string, stream: BackgroundLogStream, tail: number | undefined): Promise<BackgroundRunLogsResult>;
139
+ export declare const _testOnly: {
140
+ buildResourceSnapshot: typeof buildResourceSnapshot;
141
+ evaluateWorkerResult: typeof evaluateWorkerResult;
142
+ isPidRunning: typeof isPidRunning;
143
+ parseLinuxCpuStat: typeof parseLinuxCpuStat;
144
+ parseLinuxRssStatus: typeof parseLinuxRssStatus;
145
+ parseProgressLine: typeof parseProgressLine;
146
+ readLinuxCpuSeconds: typeof readLinuxCpuSeconds;
147
+ readLinuxRssBytes: typeof readLinuxRssBytes;
148
+ refreshRunIfStale: typeof refreshRunIfStale;
149
+ splitLines: typeof splitLines;
150
+ tailLines: typeof tailLines;
151
+ };
152
+ export {};
@@ -1,5 +1,5 @@
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]="2ba2ffd6-1f2e-5ee4-8534-9ac9e3ba2c77")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="6d6c09d7-3b95-5342-b83c-d5e2c6e201ae")}catch(e){}}();
3
3
  import fs from "node:fs/promises";
4
4
  import { spawn } from "node:child_process";
5
5
  import { createHash, randomBytes } from "node:crypto";
@@ -100,47 +100,49 @@ async function listBackgroundRunRecordPaths(pmRoot) {
100
100
  .map((entry) => path.join(recordsRoot, entry.name))
101
101
  .sort((left, right) => right.localeCompare(left));
102
102
  }
103
+ function parseLinuxRssStatus(raw) {
104
+ const match = raw.match(/^VmRSS:\s+(\d+)\s+kB$/m);
105
+ if (!match) {
106
+ return undefined;
107
+ }
108
+ return Number.parseInt(match[1], 10) * 1024;
109
+ }
103
110
  async function readLinuxRssBytes(pid) {
104
111
  if (process.platform !== "linux") {
105
112
  return undefined;
106
113
  }
107
114
  try {
108
115
  const raw = await fs.readFile(`/proc/${pid}/status`, "utf8");
109
- const match = raw.match(/^VmRSS:\s+(\d+)\s+kB$/m);
110
- if (!match) {
111
- return undefined;
112
- }
113
- const value = Number.parseInt(match[1] ?? "", 10);
114
- if (!Number.isFinite(value)) {
115
- return undefined;
116
- }
117
- return value * 1024;
116
+ return parseLinuxRssStatus(raw);
118
117
  }
119
118
  catch {
120
119
  return undefined;
121
120
  }
122
121
  }
122
+ function parseLinuxCpuStat(raw) {
123
+ const closeParenIndex = raw.lastIndexOf(")");
124
+ if (closeParenIndex < 0) {
125
+ return {};
126
+ }
127
+ const remainder = raw.slice(closeParenIndex + 2).trim();
128
+ const parts = remainder.split(/\s+/);
129
+ const utimeTicks = Number.parseInt(parts[11], 10);
130
+ const stimeTicks = Number.parseInt(parts[12], 10);
131
+ if (!Number.isFinite(utimeTicks) || !Number.isFinite(stimeTicks)) {
132
+ return {};
133
+ }
134
+ return {
135
+ cpu_user_seconds: utimeTicks / PROC_STAT_TICKS_PER_SECOND,
136
+ cpu_system_seconds: stimeTicks / PROC_STAT_TICKS_PER_SECOND,
137
+ };
138
+ }
123
139
  async function readLinuxCpuSeconds(pid) {
124
140
  if (process.platform !== "linux") {
125
141
  return {};
126
142
  }
127
143
  try {
128
144
  const raw = await fs.readFile(`/proc/${pid}/stat`, "utf8");
129
- const closeParenIndex = raw.lastIndexOf(")");
130
- if (closeParenIndex < 0) {
131
- return {};
132
- }
133
- const remainder = raw.slice(closeParenIndex + 2).trim();
134
- const parts = remainder.split(/\s+/);
135
- const utimeTicks = Number.parseInt(parts[11] ?? "", 10);
136
- const stimeTicks = Number.parseInt(parts[12] ?? "", 10);
137
- if (!Number.isFinite(utimeTicks) || !Number.isFinite(stimeTicks)) {
138
- return {};
139
- }
140
- return {
141
- cpu_user_seconds: utimeTicks / PROC_STAT_TICKS_PER_SECOND,
142
- cpu_system_seconds: stimeTicks / PROC_STAT_TICKS_PER_SECOND,
143
- };
145
+ return parseLinuxCpuStat(raw);
144
146
  }
145
147
  catch {
146
148
  return {};
@@ -230,12 +232,12 @@ function parseProgressLine(stderrLine) {
230
232
  if (!match) {
231
233
  return null;
232
234
  }
233
- const index = Number.parseInt(match[1] ?? "", 10);
234
- const total = Number.parseInt(match[2] ?? "", 10);
235
+ const index = Number.parseInt(match[1], 10);
236
+ const total = Number.parseInt(match[2], 10);
235
237
  const elapsed = match[4] ? Number.parseInt(match[4], 10) : undefined;
236
238
  return {
237
- linked_test_index: Number.isFinite(index) ? index : undefined,
238
- linked_test_total: Number.isFinite(total) ? total : undefined,
239
+ linked_test_index: index,
240
+ linked_test_total: total,
239
241
  elapsed_ms: Number.isFinite(elapsed) ? elapsed : undefined,
240
242
  heartbeat_at: nowIso(),
241
243
  phase: match[3]?.toLowerCase() === "end" ? "finished" : "running",
@@ -311,10 +313,7 @@ export async function startBackgroundTestRun(options) {
311
313
  if (refreshed.fingerprint !== fingerprint) {
312
314
  continue;
313
315
  }
314
- if (!BACKGROUND_RUN_ACTIVE_STATUSES.has(refreshed.status)) {
315
- continue;
316
- }
317
- if (!isPidRunning(refreshed.worker_pid)) {
316
+ if (!BACKGROUND_RUN_ACTIVE_STATUSES.has(refreshed.status) || !isPidRunning(refreshed.worker_pid)) {
318
317
  continue;
319
318
  }
320
319
  return {
@@ -401,7 +400,7 @@ export async function spawnBackgroundTestRunWorker(options) {
401
400
  const next = {
402
401
  ...record,
403
402
  status: "queued",
404
- worker_pid: child.pid && child.pid > 0 ? child.pid : record.worker_pid,
403
+ worker_pid: child.pid,
405
404
  progress: {
406
405
  phase: "queued",
407
406
  message: "Worker process started.",
@@ -447,13 +446,16 @@ export async function runBackgroundTestRunWorker(pmRoot, runId, noExtensions = f
447
446
  stdio: ["ignore", "pipe", "pipe"],
448
447
  windowsHide: true,
449
448
  });
450
- record.child_pid = child.pid && child.pid > 0 ? child.pid : undefined;
449
+ record.child_pid = child.pid;
451
450
  let writeQueue = Promise.resolve();
452
451
  const scheduleRecordWrite = () => {
453
452
  writeQueue = writeQueue.then(async () => {
454
- await writeBackgroundRunRecord(pmRoot, record);
455
- }).catch(() => {
456
- // Keep worker alive even if a single metadata write fails.
453
+ try {
454
+ await writeBackgroundRunRecord(pmRoot, record);
455
+ }
456
+ catch {
457
+ // Keep worker alive even if a single metadata write fails.
458
+ }
457
459
  });
458
460
  };
459
461
  let stdoutWriteQueue = Promise.resolve();
@@ -473,9 +475,6 @@ export async function runBackgroundTestRunWorker(pmRoot, runId, noExtensions = f
473
475
  heartbeat_at: nowIso(),
474
476
  };
475
477
  scheduleRecordWrite();
476
- if (!child.pid || child.pid <= 0) {
477
- return;
478
- }
479
478
  try {
480
479
  child.kill("SIGTERM");
481
480
  }
@@ -508,38 +507,37 @@ export async function runBackgroundTestRunWorker(pmRoot, runId, noExtensions = f
508
507
  const resourceTimer = setInterval(() => {
509
508
  void (async () => {
510
509
  record.resource = await buildResourceSnapshot(record);
511
- if (record.progress) {
512
- record.progress.heartbeat_at = nowIso();
513
- }
510
+ record.progress.heartbeat_at = nowIso();
514
511
  scheduleRecordWrite();
515
512
  })();
516
513
  }, resourceInterval);
517
514
  resourceTimer.unref?.();
518
515
  child.stdout?.on("data", (chunk) => {
519
- const text = typeof chunk === "string" ? chunk : chunk.toString("utf8");
516
+ const text = chunk.toString("utf8");
520
517
  stdoutBuffer += text;
521
518
  stdoutWriteQueue = appendFileOrdered(stdoutWriteQueue, record.stdout_path, text);
522
519
  });
523
520
  child.stderr?.on("data", (chunk) => {
524
- const text = typeof chunk === "string" ? chunk : chunk.toString("utf8");
521
+ const text = chunk.toString("utf8");
525
522
  stderrWriteQueue = appendFileOrdered(stderrWriteQueue, record.stderr_path, text);
526
523
  const lines = splitLines(text);
527
524
  const latestLine = lines.at(-1);
528
- if (latestLine) {
529
- const progressPatch = parseProgressLine(latestLine);
530
- record.progress = {
531
- phase: record.progress?.phase ?? "running",
532
- message: latestLine,
533
- heartbeat_at: nowIso(),
534
- linked_test_index: progressPatch?.linked_test_index ?? record.progress?.linked_test_index,
535
- linked_test_total: progressPatch?.linked_test_total ?? record.progress?.linked_test_total,
536
- elapsed_ms: progressPatch?.elapsed_ms ?? record.progress?.elapsed_ms,
537
- };
538
- if (progressPatch?.phase === "finished" && !stopRequested) {
539
- record.progress.phase = "running";
540
- }
541
- scheduleRecordWrite();
525
+ if (!latestLine) {
526
+ return;
527
+ }
528
+ const progressPatch = parseProgressLine(latestLine);
529
+ record.progress = {
530
+ phase: record.progress.phase === "stopping" ? "stopping" : "running",
531
+ message: latestLine,
532
+ heartbeat_at: nowIso(),
533
+ linked_test_index: progressPatch?.linked_test_index ?? record.progress?.linked_test_index ?? undefined,
534
+ linked_test_total: progressPatch?.linked_test_total ?? record.progress?.linked_test_total ?? undefined,
535
+ elapsed_ms: progressPatch?.elapsed_ms ?? record.progress?.elapsed_ms ?? undefined,
536
+ };
537
+ if (progressPatch?.phase === "finished" && !stopRequested) {
538
+ record.progress.phase = "running";
542
539
  }
540
+ scheduleRecordWrite();
543
541
  });
544
542
  let exitCode = null;
545
543
  let signal = null;
@@ -759,5 +757,18 @@ export async function readBackgroundTestRunLogs(pmRoot, runId, stream, tail) {
759
757
  stderr: stream === "stderr" || stream === "both" ? tailLines(stderrRaw, resolvedTail) : [],
760
758
  };
761
759
  }
760
+ export const _testOnly = {
761
+ buildResourceSnapshot,
762
+ evaluateWorkerResult,
763
+ isPidRunning,
764
+ parseLinuxCpuStat,
765
+ parseLinuxRssStatus,
766
+ parseProgressLine,
767
+ readLinuxCpuSeconds,
768
+ readLinuxRssBytes,
769
+ refreshRunIfStale,
770
+ splitLines,
771
+ tailLines,
772
+ };
762
773
  //# sourceMappingURL=background-runs.js.map
763
- //# debugId=2ba2ffd6-1f2e-5ee4-8534-9ac9e3ba2c77
774
+ //# debugId=6d6c09d7-3b95-5342-b83c-d5e2c6e201ae
@@ -1 +1 @@
1
- {"version":3,"file":"background-runs.js","sources":["core/test/background-runs.ts"],"sourceRoot":"/","sourcesContent":["import 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\nexport type BackgroundTestRunKind = \"test\" | \"test-all\";\n\nexport type BackgroundTestRunStatus = \"queued\" | \"running\" | \"passed\" | \"failed\" | \"stopped\" | \"canceled\";\n\nexport type BackgroundLogStream = \"stdout\" | \"stderr\" | \"both\";\n\nexport interface BackgroundRunProgress {\n phase: \"queued\" | \"running\" | \"stopping\" | \"finished\";\n message?: string;\n linked_test_index?: number;\n linked_test_total?: number;\n elapsed_ms?: number;\n heartbeat_at?: string;\n}\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\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\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\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\nexport interface StartBackgroundTestRunResult {\n started: boolean;\n run: BackgroundTestRunRecord;\n duplicate_of?: string;\n}\n\nexport interface SpawnBackgroundTestRunWorkerOptions {\n pmRoot: string;\n runId: string;\n noExtensions?: boolean;\n}\n\nexport interface StopBackgroundTestRunResult {\n run: BackgroundTestRunRecord;\n signal_sent: \"SIGTERM\" | \"SIGKILL\" | \"none\";\n}\n\nexport interface ListBackgroundTestRunOptions {\n status?: BackgroundTestRunStatus;\n limit?: number;\n}\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\nexport interface BackgroundRunStatusView {\n run: BackgroundTestRunRecord;\n health: BackgroundRunHealth;\n}\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\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\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\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 const match = raw.match(/^VmRSS:\\s+(\\d+)\\s+kB$/m);\n if (!match) {\n return undefined;\n }\n const value = Number.parseInt(match[1] ?? \"\", 10);\n if (!Number.isFinite(value)) {\n return undefined;\n }\n return value * 1024;\n } catch {\n return undefined;\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 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 } catch {\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 match = line.match(/\\[pm test\\]\\s+linked-test\\s+(\\d+)\\/(\\d+)\\s+(start|running|end)(?:.*elapsed_ms=(\\d+))?/i);\n if (!match) {\n return null;\n }\n const index = Number.parseInt(match[1] ?? \"\", 10);\n const total = Number.parseInt(match[2] ?? \"\", 10);\n const elapsed = match[4] ? Number.parseInt(match[4], 10) : undefined;\n return {\n linked_test_index: Number.isFinite(index) ? index : undefined,\n linked_test_total: Number.isFinite(total) ? total : undefined,\n elapsed_ms: Number.isFinite(elapsed) ? elapsed : undefined,\n heartbeat_at: nowIso(),\n phase: match[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\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)) {\n continue;\n }\n if (!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\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 && child.pid > 0 ? child.pid : record.worker_pid,\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\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 && child.pid > 0 ? child.pid : undefined;\n\n let writeQueue: Promise<void> = Promise.resolve();\n const scheduleRecordWrite = (): void => {\n writeQueue = writeQueue.then(async () => {\n await writeBackgroundRunRecord(pmRoot, record);\n }).catch(() => {\n // Keep worker alive even if a single metadata write fails.\n });\n };\n\n let stdoutWriteQueue: Promise<void> = Promise.resolve();\n let stderrWriteQueue: Promise<void> = Promise.resolve();\n let stdoutBuffer = \"\";\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 if (!child.pid || child.pid <= 0) {\n return;\n }\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 if (record.progress) {\n record.progress.heartbeat_at = nowIso();\n }\n scheduleRecordWrite();\n })();\n }, resourceInterval);\n resourceTimer.unref?.();\n\n child.stdout?.on(\"data\", (chunk) => {\n const text = typeof chunk === \"string\" ? chunk : chunk.toString(\"utf8\");\n stdoutBuffer += text;\n stdoutWriteQueue = appendFileOrdered(stdoutWriteQueue, record.stdout_path, text);\n });\n child.stderr?.on(\"data\", (chunk) => {\n const text = typeof chunk === \"string\" ? chunk : chunk.toString(\"utf8\");\n stderrWriteQueue = appendFileOrdered(stderrWriteQueue, record.stderr_path, text);\n const lines = splitLines(text);\n const latestLine = lines.at(-1);\n if (latestLine) {\n const progressPatch = parseProgressLine(latestLine);\n record.progress = {\n phase: record.progress?.phase ?? \"running\",\n message: latestLine,\n heartbeat_at: nowIso(),\n linked_test_index: progressPatch?.linked_test_index ?? record.progress?.linked_test_index,\n linked_test_total: progressPatch?.linked_test_total ?? record.progress?.linked_test_total,\n elapsed_ms: progressPatch?.elapsed_ms ?? record.progress?.elapsed_ms,\n };\n if (progressPatch?.phase === \"finished\" && !stopRequested) {\n record.progress.phase = \"running\";\n }\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\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 linked_test_index: record.progress?.linked_test_index,\n linked_test_total: record.progress?.linked_test_total,\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\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\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\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 linked_test_index: refreshed.progress?.linked_test_index,\n linked_test_total: refreshed.progress?.linked_test_total,\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\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\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"],"names":[],"mappings":";;AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,8BAA8B,GAAG,IAAI,GAAG,CAA0B,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC;AAC/F,MAAM,gCAAgC,GAAG,IAAI,GAAG,CAA0B,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,CA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,uBAAuB,KAAK,YAAY,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACtF,CAAC;IACD,MAAM,YAAY,GAAG,OAAO,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,qCAAqC,CAAC;IAC/I,MAAM,SAAS,GAAG,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,gBAAgB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACrH,MAAM,SAAS,GAAG,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,gBAAgB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACrH,OAAO;QACL,GAAG,EAAE,MAAM;QACX,MAAM;QACN,IAAI,EAAE,YAAY;QAClB,MAAM,EAAE,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE;QAC1F,MAAM,EAAE,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE;KAC3F,CAAC;AACJ,CAAC","debugId":"2ba2ffd6-1f2e-5ee4-8534-9ac9e3ba2c77"}
1
+ {"version":3,"file":"background-runs.js","sources":["core/test/background-runs.ts"],"sourceRoot":"/","sourcesContent":["import 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\nexport type BackgroundTestRunKind = \"test\" | \"test-all\";\n\nexport type BackgroundTestRunStatus = \"queued\" | \"running\" | \"passed\" | \"failed\" | \"stopped\" | \"canceled\";\n\nexport type BackgroundLogStream = \"stdout\" | \"stderr\" | \"both\";\n\nexport interface BackgroundRunProgress {\n phase: \"queued\" | \"running\" | \"stopping\" | \"finished\";\n message?: string;\n linked_test_index?: number;\n linked_test_total?: number;\n elapsed_ms?: number;\n heartbeat_at?: string;\n}\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\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\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\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\nexport interface StartBackgroundTestRunResult {\n started: boolean;\n run: BackgroundTestRunRecord;\n duplicate_of?: string;\n}\n\nexport interface SpawnBackgroundTestRunWorkerOptions {\n pmRoot: string;\n runId: string;\n noExtensions?: boolean;\n}\n\nexport interface StopBackgroundTestRunResult {\n run: BackgroundTestRunRecord;\n signal_sent: \"SIGTERM\" | \"SIGKILL\" | \"none\";\n}\n\nexport interface ListBackgroundTestRunOptions {\n status?: BackgroundTestRunStatus;\n limit?: number;\n}\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\nexport interface BackgroundRunStatusView {\n run: BackgroundTestRunRecord;\n health: BackgroundRunHealth;\n}\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\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\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 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 match = line.match(/\\[pm test\\]\\s+linked-test\\s+(\\d+)\\/(\\d+)\\s+(start|running|end)(?:.*elapsed_ms=(\\d+))?/i);\n if (!match) {\n return null;\n }\n const index = Number.parseInt(match[1], 10);\n const total = Number.parseInt(match[2], 10);\n const elapsed = match[4] ? Number.parseInt(match[4], 10) : undefined;\n return {\n linked_test_index: index,\n linked_test_total: total,\n elapsed_ms: Number.isFinite(elapsed) ? elapsed : undefined,\n heartbeat_at: nowIso(),\n phase: match[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\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\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\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 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 child.stderr?.on(\"data\", (chunk) => {\n const text = chunk.toString(\"utf8\");\n stderrWriteQueue = appendFileOrdered(stderrWriteQueue, record.stderr_path, text);\n const lines = splitLines(text);\n const latestLine = lines.at(-1);\n if (!latestLine) {\n return;\n }\n const progressPatch = parseProgressLine(latestLine);\n record.progress = {\n phase: (record.progress as BackgroundRunProgress).phase === \"stopping\" ? \"stopping\" : \"running\",\n message: latestLine,\n heartbeat_at: nowIso(),\n linked_test_index: progressPatch?.linked_test_index ?? record.progress?.linked_test_index ?? undefined,\n linked_test_total: progressPatch?.linked_test_total ?? record.progress?.linked_test_total ?? undefined,\n elapsed_ms: progressPatch?.elapsed_ms ?? record.progress?.elapsed_ms ?? undefined,\n };\n if (progressPatch?.phase === \"finished\" && !stopRequested) {\n record.progress.phase = \"running\";\n }\n scheduleRecordWrite();\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\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 linked_test_index: record.progress?.linked_test_index,\n linked_test_total: record.progress?.linked_test_total,\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\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\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\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 linked_test_index: refreshed.progress?.linked_test_index,\n linked_test_total: refreshed.progress?.linked_test_total,\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\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\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":";;AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAA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C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,qCAAqC,CAAC;IAC/I,MAAM,SAAS,GAAG,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,gBAAgB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACrH,MAAM,SAAS,GAAG,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,gBAAgB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACrH,OAAO;QACL,GAAG,EAAE,MAAM;QACX,MAAM;QACN,IAAI,EAAE,YAAY;QAClB,MAAM,EAAE,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE;QAC1F,MAAM,EAAE,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE;KAC3F,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,qBAAqB;IACrB,oBAAoB;IACpB,YAAY;IACZ,iBAAiB;IACjB,mBAAmB;IACnB,iBAAiB;IACjB,mBAAmB;IACnB,iBAAiB;IACjB,iBAAiB;IACjB,UAAU;IACV,SAAS;CACV,CAAC","debugId":"6d6c09d7-3b95-5342-b83c-d5e2c6e201ae"}
@@ -1,5 +1,5 @@
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]="89480c78-9cf5-55e5-a881-aaa130d9c509")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2e6ce913-4630-561f-9c88-3542b2b32c38")}catch(e){}}();
3
3
  import { EXIT_CODE } from "../shared/constants.js";
4
4
  import { PmCliError } from "../shared/errors.js";
5
5
  const MAX_SELECTOR_ENTRY_LABEL_LENGTH = 100;
@@ -59,7 +59,8 @@ export function resolveLinkedTestRunSelection(tests, selector) {
59
59
  throw new PmCliError(`--${kind} matched no linked tests because this item has none. Add one first with --add, --command, or --add-json.`, EXIT_CODE.USAGE);
60
60
  }
61
61
  if (kind === "match") {
62
- const needle = (selector.match ?? "").trim().toLowerCase();
62
+ // kind is "match" only when selector.match is defined (see activeSelectorKinds).
63
+ const needle = selector.match.trim().toLowerCase();
63
64
  if (needle.length === 0) {
64
65
  throw new PmCliError("--match requires a non-empty substring to match against linked-test command/path values", EXIT_CODE.USAGE);
65
66
  }
@@ -76,7 +77,7 @@ export function resolveLinkedTestRunSelection(tests, selector) {
76
77
  }
77
78
  return {
78
79
  selector: "match",
79
- requested: selector.match ?? "",
80
+ requested: selector.match,
80
81
  selected,
81
82
  selected_indexes: selectedIndexes,
82
83
  selected_count: selected.length,
@@ -107,4 +108,4 @@ export function resolveLinkedTestRunSelection(tests, selector) {
107
108
  };
108
109
  }
109
110
  //# sourceMappingURL=run-selectors.js.map
110
- //# debugId=89480c78-9cf5-55e5-a881-aaa130d9c509
111
+ //# debugId=2e6ce913-4630-561f-9c88-3542b2b32c38