@midscene/core 1.12.10-beta-20260920031616.0 → 1.13.0

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 (319) hide show
  1. package/dist/es/agent/agent.mjs +103 -6
  2. package/dist/es/agent/agent.mjs.map +1 -1
  3. package/dist/es/agent/index.mjs +4 -3
  4. package/dist/es/agent/tasks.mjs +2 -2
  5. package/dist/es/agent/tasks.mjs.map +1 -1
  6. package/dist/es/agent/test-runner-nodes.mjs +291 -40
  7. package/dist/es/agent/test-runner-nodes.mjs.map +1 -1
  8. package/dist/es/agent/utils.mjs +1 -1
  9. package/dist/es/device/index.mjs +15 -2
  10. package/dist/es/device/index.mjs.map +1 -1
  11. package/dist/es/dump/html-utils.mjs +37 -4
  12. package/dist/es/dump/html-utils.mjs.map +1 -1
  13. package/dist/es/dump/screenshot-store.mjs +8 -1
  14. package/dist/es/dump/screenshot-store.mjs.map +1 -1
  15. package/dist/es/report-cli.mjs +9 -4
  16. package/dist/es/report-cli.mjs.map +1 -1
  17. package/dist/es/report-generator.mjs +117 -4
  18. package/dist/es/report-generator.mjs.map +1 -1
  19. package/dist/es/report-html-template.mjs +1 -1
  20. package/dist/es/report.mjs +190 -41
  21. package/dist/es/report.mjs.map +1 -1
  22. package/dist/es/test-run-report.mjs.map +1 -1
  23. package/dist/es/test-runner/engine/case-runner.mjs +52 -0
  24. package/dist/es/test-runner/engine/case-runner.mjs.map +1 -0
  25. package/dist/es/test-runner/engine/document-runtime.mjs +273 -0
  26. package/dist/es/test-runner/engine/document-runtime.mjs.map +1 -0
  27. package/dist/es/test-runner/engine/execute-step.mjs +177 -0
  28. package/dist/es/test-runner/engine/execute-step.mjs.map +1 -0
  29. package/dist/es/test-runner/engine/execution-failure.mjs +39 -0
  30. package/dist/es/test-runner/engine/execution-failure.mjs.map +1 -0
  31. package/dist/es/test-runner/engine/index.mjs +12 -0
  32. package/dist/es/test-runner/engine/project-runtime.mjs +142 -0
  33. package/dist/es/test-runner/engine/project-runtime.mjs.map +1 -0
  34. package/dist/es/test-runner/engine/registry.mjs +61 -0
  35. package/dist/es/test-runner/engine/registry.mjs.map +1 -0
  36. package/dist/es/test-runner/engine/resource-operations.mjs +211 -0
  37. package/dist/es/test-runner/engine/resource-operations.mjs.map +1 -0
  38. package/dist/es/test-runner/engine/run-collected-case.mjs +193 -0
  39. package/dist/es/test-runner/engine/run-collected-case.mjs.map +1 -0
  40. package/dist/es/test-runner/engine/run-workflow-document.mjs +155 -0
  41. package/dist/es/test-runner/engine/run-workflow-document.mjs.map +1 -0
  42. package/dist/es/test-runner/engine/scheduler.mjs +27 -0
  43. package/dist/es/test-runner/engine/scheduler.mjs.map +1 -0
  44. package/dist/es/test-runner/engine/scope-teardown.mjs +16 -0
  45. package/dist/es/test-runner/engine/scope-teardown.mjs.map +1 -0
  46. package/dist/es/test-runner/engine/types.mjs +0 -0
  47. package/dist/es/test-runner/errors.mjs +201 -0
  48. package/dist/es/test-runner/errors.mjs.map +1 -0
  49. package/dist/es/test-runner/execution-record.mjs +83 -0
  50. package/dist/es/test-runner/execution-record.mjs.map +1 -0
  51. package/dist/es/test-runner/index.mjs +12 -0
  52. package/dist/es/test-runner/node/define-node.mjs +44 -0
  53. package/dist/es/test-runner/node/define-node.mjs.map +1 -0
  54. package/dist/es/test-runner/node/index.mjs +2 -0
  55. package/dist/es/test-runner/node/types.mjs +0 -0
  56. package/dist/es/test-runner/parser/document-format.mjs +21 -0
  57. package/dist/es/test-runner/parser/document-format.mjs.map +1 -0
  58. package/dist/es/test-runner/parser/normalize.mjs +87 -0
  59. package/dist/es/test-runner/parser/normalize.mjs.map +1 -0
  60. package/dist/es/test-runner/parser/types.mjs +0 -0
  61. package/dist/es/test-runner/project.mjs +0 -0
  62. package/dist/es/test-runner/reporting/agent-report.mjs +23 -0
  63. package/dist/es/test-runner/reporting/agent-report.mjs.map +1 -0
  64. package/dist/es/test-runner/reporting/execution-record.mjs +73 -0
  65. package/dist/es/test-runner/reporting/execution-record.mjs.map +1 -0
  66. package/dist/es/test-runner/reporting/merge-report.mjs +231 -0
  67. package/dist/es/test-runner/reporting/merge-report.mjs.map +1 -0
  68. package/dist/es/test-runner/reporting/sanitize.mjs +162 -0
  69. package/dist/es/test-runner/reporting/sanitize.mjs.map +1 -0
  70. package/dist/es/test-runner/reporting/test-run-report.mjs +327 -0
  71. package/dist/es/test-runner/reporting/test-run-report.mjs.map +1 -0
  72. package/dist/es/test-runner/reporting/types.mjs +0 -0
  73. package/dist/es/utils.mjs +1 -1
  74. package/dist/es/yaml/execution-context.node.mjs +6 -0
  75. package/dist/es/yaml/execution-context.node.mjs.map +1 -0
  76. package/dist/es/yaml/execution-context.stub.mjs +8 -0
  77. package/dist/es/yaml/execution-context.stub.mjs.map +1 -0
  78. package/dist/es/yaml/execution-session.mjs +90 -0
  79. package/dist/es/yaml/execution-session.mjs.map +1 -0
  80. package/dist/es/yaml/index.mjs +2 -1
  81. package/dist/es/yaml/legacy-yaml-execution-record.mjs +47 -0
  82. package/dist/es/yaml/legacy-yaml-execution-record.mjs.map +1 -0
  83. package/dist/es/yaml/legacy-yaml-report.mjs +52 -0
  84. package/dist/es/yaml/legacy-yaml-report.mjs.map +1 -0
  85. package/dist/es/yaml/legacy-yaml-runtime.mjs +119 -0
  86. package/dist/es/yaml/legacy-yaml-runtime.mjs.map +1 -0
  87. package/dist/es/yaml/player-state.mjs +15 -0
  88. package/dist/es/yaml/player-state.mjs.map +1 -0
  89. package/dist/es/yaml/player.mjs +214 -348
  90. package/dist/es/yaml/player.mjs.map +1 -1
  91. package/dist/es/yaml/report-policy.mjs +7 -0
  92. package/dist/es/yaml/report-policy.mjs.map +1 -0
  93. package/dist/es/yaml/test-runner-compat.mjs +301 -0
  94. package/dist/es/yaml/test-runner-compat.mjs.map +1 -0
  95. package/dist/es/yaml/test-runner-nodes.mjs +147 -0
  96. package/dist/es/yaml/test-runner-nodes.mjs.map +1 -0
  97. package/dist/es/yaml/utils.mjs +12 -1
  98. package/dist/es/yaml/utils.mjs.map +1 -1
  99. package/dist/es/yaml-runtime.mjs +7 -0
  100. package/dist/es/yaml.mjs.map +1 -1
  101. package/dist/lib/agent/agent.js +103 -6
  102. package/dist/lib/agent/agent.js.map +1 -1
  103. package/dist/lib/agent/index.js +37 -3
  104. package/dist/lib/agent/tasks.js +2 -2
  105. package/dist/lib/agent/tasks.js.map +1 -1
  106. package/dist/lib/agent/test-runner-nodes.js +329 -45
  107. package/dist/lib/agent/test-runner-nodes.js.map +1 -1
  108. package/dist/lib/agent/utils.js +1 -1
  109. package/dist/lib/device/index.js +15 -2
  110. package/dist/lib/device/index.js.map +1 -1
  111. package/dist/lib/dump/html-utils.js +43 -4
  112. package/dist/lib/dump/html-utils.js.map +1 -1
  113. package/dist/lib/dump/screenshot-store.js +8 -1
  114. package/dist/lib/dump/screenshot-store.js.map +1 -1
  115. package/dist/lib/report-cli.js +8 -3
  116. package/dist/lib/report-cli.js.map +1 -1
  117. package/dist/lib/report-generator.js +114 -1
  118. package/dist/lib/report-generator.js.map +1 -1
  119. package/dist/lib/report-html-template.js +1 -1
  120. package/dist/lib/report.js +187 -38
  121. package/dist/lib/report.js.map +1 -1
  122. package/dist/lib/test-run-report.js.map +1 -1
  123. package/dist/lib/test-runner/engine/case-runner.js +89 -0
  124. package/dist/lib/test-runner/engine/case-runner.js.map +1 -0
  125. package/dist/lib/test-runner/engine/document-runtime.js +307 -0
  126. package/dist/lib/test-runner/engine/document-runtime.js.map +1 -0
  127. package/dist/lib/test-runner/engine/execute-step.js +211 -0
  128. package/dist/lib/test-runner/engine/execute-step.js.map +1 -0
  129. package/dist/lib/test-runner/engine/execution-failure.js +79 -0
  130. package/dist/lib/test-runner/engine/execution-failure.js.map +1 -0
  131. package/dist/lib/test-runner/engine/index.js +137 -0
  132. package/dist/lib/test-runner/engine/index.js.map +1 -0
  133. package/dist/lib/test-runner/engine/project-runtime.js +176 -0
  134. package/dist/lib/test-runner/engine/project-runtime.js.map +1 -0
  135. package/dist/lib/test-runner/engine/registry.js +95 -0
  136. package/dist/lib/test-runner/engine/registry.js.map +1 -0
  137. package/dist/lib/test-runner/engine/resource-operations.js +272 -0
  138. package/dist/lib/test-runner/engine/resource-operations.js.map +1 -0
  139. package/dist/lib/test-runner/engine/run-collected-case.js +227 -0
  140. package/dist/lib/test-runner/engine/run-collected-case.js.map +1 -0
  141. package/dist/lib/test-runner/engine/run-workflow-document.js +189 -0
  142. package/dist/lib/test-runner/engine/run-workflow-document.js.map +1 -0
  143. package/dist/lib/test-runner/engine/scheduler.js +64 -0
  144. package/dist/lib/test-runner/engine/scheduler.js.map +1 -0
  145. package/dist/lib/test-runner/engine/scope-teardown.js +50 -0
  146. package/dist/lib/test-runner/engine/scope-teardown.js.map +1 -0
  147. package/dist/lib/test-runner/engine/types.js +20 -0
  148. package/dist/lib/test-runner/engine/types.js.map +1 -0
  149. package/dist/lib/test-runner/errors.js +283 -0
  150. package/dist/lib/test-runner/errors.js.map +1 -0
  151. package/dist/lib/test-runner/execution-record.js +123 -0
  152. package/dist/lib/test-runner/execution-record.js.map +1 -0
  153. package/dist/lib/test-runner/index.js +137 -0
  154. package/dist/lib/test-runner/index.js.map +1 -0
  155. package/dist/lib/test-runner/node/define-node.js +78 -0
  156. package/dist/lib/test-runner/node/define-node.js.map +1 -0
  157. package/dist/lib/test-runner/node/index.js +67 -0
  158. package/dist/lib/test-runner/node/index.js.map +1 -0
  159. package/dist/lib/test-runner/node/types.js +20 -0
  160. package/dist/lib/test-runner/node/types.js.map +1 -0
  161. package/dist/lib/test-runner/parser/document-format.js +58 -0
  162. package/dist/lib/test-runner/parser/document-format.js.map +1 -0
  163. package/dist/lib/test-runner/parser/normalize.js +124 -0
  164. package/dist/lib/test-runner/parser/normalize.js.map +1 -0
  165. package/dist/lib/test-runner/parser/types.js +20 -0
  166. package/dist/lib/test-runner/parser/types.js.map +1 -0
  167. package/dist/lib/test-runner/project.js +20 -0
  168. package/dist/lib/test-runner/project.js.map +1 -0
  169. package/dist/lib/test-runner/reporting/agent-report.js +57 -0
  170. package/dist/lib/test-runner/reporting/agent-report.js.map +1 -0
  171. package/dist/lib/test-runner/reporting/execution-record.js +107 -0
  172. package/dist/lib/test-runner/reporting/execution-record.js.map +1 -0
  173. package/dist/lib/test-runner/reporting/merge-report.js +265 -0
  174. package/dist/lib/test-runner/reporting/merge-report.js.map +1 -0
  175. package/dist/lib/test-runner/reporting/sanitize.js +202 -0
  176. package/dist/lib/test-runner/reporting/sanitize.js.map +1 -0
  177. package/dist/lib/test-runner/reporting/test-run-report.js +364 -0
  178. package/dist/lib/test-runner/reporting/test-run-report.js.map +1 -0
  179. package/dist/lib/test-runner/reporting/types.js +20 -0
  180. package/dist/lib/test-runner/reporting/types.js.map +1 -0
  181. package/dist/lib/utils.js +1 -1
  182. package/dist/lib/yaml/execution-context.node.js +43 -0
  183. package/dist/lib/yaml/execution-context.node.js.map +1 -0
  184. package/dist/lib/yaml/execution-context.stub.js +45 -0
  185. package/dist/lib/yaml/execution-context.stub.js.map +1 -0
  186. package/dist/lib/yaml/execution-session.js +136 -0
  187. package/dist/lib/yaml/execution-session.js.map +1 -0
  188. package/dist/lib/yaml/index.js +49 -7
  189. package/dist/lib/yaml/legacy-yaml-execution-record.js +81 -0
  190. package/dist/lib/yaml/legacy-yaml-execution-record.js.map +1 -0
  191. package/dist/lib/yaml/legacy-yaml-report.js +86 -0
  192. package/dist/lib/yaml/legacy-yaml-report.js.map +1 -0
  193. package/dist/lib/yaml/legacy-yaml-runtime.js +156 -0
  194. package/dist/lib/yaml/legacy-yaml-runtime.js.map +1 -0
  195. package/dist/lib/yaml/player-state.js +52 -0
  196. package/dist/lib/yaml/player-state.js.map +1 -0
  197. package/dist/lib/yaml/player.js +213 -347
  198. package/dist/lib/yaml/player.js.map +1 -1
  199. package/dist/lib/yaml/report-policy.js +41 -0
  200. package/dist/lib/yaml/report-policy.js.map +1 -0
  201. package/dist/lib/yaml/test-runner-compat.js +344 -0
  202. package/dist/lib/yaml/test-runner-compat.js.map +1 -0
  203. package/dist/lib/yaml/test-runner-nodes.js +184 -0
  204. package/dist/lib/yaml/test-runner-nodes.js.map +1 -0
  205. package/dist/lib/yaml/utils.js +18 -1
  206. package/dist/lib/yaml/utils.js.map +1 -1
  207. package/dist/lib/yaml-runtime.js +67 -0
  208. package/dist/lib/yaml-runtime.js.map +1 -0
  209. package/dist/lib/yaml.js.map +1 -1
  210. package/dist/types/agent/agent.d.ts +14 -1
  211. package/dist/types/agent/agent.d.ts.map +1 -1
  212. package/dist/types/agent/index.d.ts +4 -3
  213. package/dist/types/agent/index.d.ts.map +1 -1
  214. package/dist/types/agent/tasks.d.ts +1 -1
  215. package/dist/types/agent/tasks.d.ts.map +1 -1
  216. package/dist/types/agent/test-runner-nodes.d.ts +226 -0
  217. package/dist/types/agent/test-runner-nodes.d.ts.map +1 -1
  218. package/dist/types/device/index.d.ts +1 -1
  219. package/dist/types/device/index.d.ts.map +1 -1
  220. package/dist/types/dump/html-utils.d.ts +4 -0
  221. package/dist/types/dump/html-utils.d.ts.map +1 -1
  222. package/dist/types/dump/screenshot-store.d.ts +2 -1
  223. package/dist/types/dump/screenshot-store.d.ts.map +1 -1
  224. package/dist/types/report-cli.d.ts.map +1 -1
  225. package/dist/types/report-generator.d.ts +10 -0
  226. package/dist/types/report-generator.d.ts.map +1 -1
  227. package/dist/types/report.d.ts +3 -1
  228. package/dist/types/report.d.ts.map +1 -1
  229. package/dist/types/test-run-report.d.ts +18 -2
  230. package/dist/types/test-run-report.d.ts.map +1 -1
  231. package/dist/types/test-runner/engine/case-runner.d.ts +13 -0
  232. package/dist/types/test-runner/engine/case-runner.d.ts.map +1 -0
  233. package/dist/types/test-runner/engine/document-runtime.d.ts +4 -0
  234. package/dist/types/test-runner/engine/document-runtime.d.ts.map +1 -0
  235. package/dist/types/test-runner/engine/execute-step.d.ts +17 -0
  236. package/dist/types/test-runner/engine/execute-step.d.ts.map +1 -0
  237. package/dist/types/test-runner/engine/execution-failure.d.ts +13 -0
  238. package/dist/types/test-runner/engine/execution-failure.d.ts.map +1 -0
  239. package/dist/types/test-runner/engine/index.d.ts +13 -0
  240. package/dist/types/test-runner/engine/index.d.ts.map +1 -0
  241. package/dist/types/test-runner/engine/project-runtime.d.ts +3 -0
  242. package/dist/types/test-runner/engine/project-runtime.d.ts.map +1 -0
  243. package/dist/types/test-runner/engine/registry.d.ts +12 -0
  244. package/dist/types/test-runner/engine/registry.d.ts.map +1 -0
  245. package/dist/types/test-runner/engine/resource-operations.d.ts +32 -0
  246. package/dist/types/test-runner/engine/resource-operations.d.ts.map +1 -0
  247. package/dist/types/test-runner/engine/run-collected-case.d.ts +4 -0
  248. package/dist/types/test-runner/engine/run-collected-case.d.ts.map +1 -0
  249. package/dist/types/test-runner/engine/run-workflow-document.d.ts +4 -0
  250. package/dist/types/test-runner/engine/run-workflow-document.d.ts.map +1 -0
  251. package/dist/types/test-runner/engine/scheduler.d.ts +12 -0
  252. package/dist/types/test-runner/engine/scheduler.d.ts.map +1 -0
  253. package/dist/types/test-runner/engine/scope-teardown.d.ts +3 -0
  254. package/dist/types/test-runner/engine/scope-teardown.d.ts.map +1 -0
  255. package/dist/types/test-runner/engine/types.d.ts +226 -0
  256. package/dist/types/test-runner/engine/types.d.ts.map +1 -0
  257. package/dist/types/test-runner/errors.d.ts +79 -0
  258. package/dist/types/test-runner/errors.d.ts.map +1 -0
  259. package/dist/types/test-runner/execution-record.d.ts +43 -0
  260. package/dist/types/test-runner/execution-record.d.ts.map +1 -0
  261. package/dist/types/test-runner/index.d.ts +20 -0
  262. package/dist/types/test-runner/index.d.ts.map +1 -0
  263. package/dist/types/test-runner/node/define-node.d.ts +4 -0
  264. package/dist/types/test-runner/node/define-node.d.ts.map +1 -0
  265. package/dist/types/test-runner/node/index.d.ts +3 -0
  266. package/dist/types/test-runner/node/index.d.ts.map +1 -0
  267. package/dist/types/test-runner/node/types.d.ts +66 -0
  268. package/dist/types/test-runner/node/types.d.ts.map +1 -0
  269. package/dist/types/test-runner/parser/document-format.d.ts +8 -0
  270. package/dist/types/test-runner/parser/document-format.d.ts.map +1 -0
  271. package/dist/types/test-runner/parser/normalize.d.ts +9 -0
  272. package/dist/types/test-runner/parser/normalize.d.ts.map +1 -0
  273. package/dist/types/test-runner/parser/types.d.ts +69 -0
  274. package/dist/types/test-runner/parser/types.d.ts.map +1 -0
  275. package/dist/types/test-runner/project.d.ts +75 -0
  276. package/dist/types/test-runner/project.d.ts.map +1 -0
  277. package/dist/types/test-runner/reporting/agent-report.d.ts +9 -0
  278. package/dist/types/test-runner/reporting/agent-report.d.ts.map +1 -0
  279. package/dist/types/test-runner/reporting/execution-record.d.ts +9 -0
  280. package/dist/types/test-runner/reporting/execution-record.d.ts.map +1 -0
  281. package/dist/types/test-runner/reporting/merge-report.d.ts +15 -0
  282. package/dist/types/test-runner/reporting/merge-report.d.ts.map +1 -0
  283. package/dist/types/test-runner/reporting/sanitize.d.ts +6 -0
  284. package/dist/types/test-runner/reporting/sanitize.d.ts.map +1 -0
  285. package/dist/types/test-runner/reporting/test-run-report.d.ts +5 -0
  286. package/dist/types/test-runner/reporting/test-run-report.d.ts.map +1 -0
  287. package/dist/types/test-runner/reporting/types.d.ts +34 -0
  288. package/dist/types/test-runner/reporting/types.d.ts.map +1 -0
  289. package/dist/types/yaml/execution-context.node.d.ts +4 -0
  290. package/dist/types/yaml/execution-context.node.d.ts.map +1 -0
  291. package/dist/types/yaml/execution-context.stub.d.ts +6 -0
  292. package/dist/types/yaml/execution-context.stub.d.ts.map +1 -0
  293. package/dist/types/yaml/execution-session.d.ts +17 -0
  294. package/dist/types/yaml/execution-session.d.ts.map +1 -0
  295. package/dist/types/yaml/index.d.ts +1 -1
  296. package/dist/types/yaml/index.d.ts.map +1 -1
  297. package/dist/types/yaml/legacy-yaml-execution-record.d.ts +24 -0
  298. package/dist/types/yaml/legacy-yaml-execution-record.d.ts.map +1 -0
  299. package/dist/types/yaml/legacy-yaml-report.d.ts +19 -0
  300. package/dist/types/yaml/legacy-yaml-report.d.ts.map +1 -0
  301. package/dist/types/yaml/legacy-yaml-runtime.d.ts +23 -0
  302. package/dist/types/yaml/legacy-yaml-runtime.d.ts.map +1 -0
  303. package/dist/types/yaml/player-state.d.ts +11 -0
  304. package/dist/types/yaml/player-state.d.ts.map +1 -0
  305. package/dist/types/yaml/player.d.ts +11 -3
  306. package/dist/types/yaml/player.d.ts.map +1 -1
  307. package/dist/types/yaml/report-policy.d.ts +4 -0
  308. package/dist/types/yaml/report-policy.d.ts.map +1 -0
  309. package/dist/types/yaml/test-runner-compat.d.ts +17 -0
  310. package/dist/types/yaml/test-runner-compat.d.ts.map +1 -0
  311. package/dist/types/yaml/test-runner-nodes.d.ts +6 -0
  312. package/dist/types/yaml/test-runner-nodes.d.ts.map +1 -0
  313. package/dist/types/yaml/utils.d.ts +9 -0
  314. package/dist/types/yaml/utils.d.ts.map +1 -1
  315. package/dist/types/yaml-runtime.d.ts +13 -0
  316. package/dist/types/yaml-runtime.d.ts.map +1 -0
  317. package/dist/types/yaml.d.ts +25 -7
  318. package/dist/types/yaml.d.ts.map +1 -1
  319. package/package.json +28 -2
@@ -0,0 +1,124 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ normalizeStep: ()=>normalizeStep,
28
+ normalizeSteps: ()=>normalizeSteps
29
+ });
30
+ const external_errors_js_namespaceObject = require("../errors.js");
31
+ const supportedMetaKeys = new Set([
32
+ 'timeout',
33
+ 'continue-on-error'
34
+ ]);
35
+ function isMapping(value) {
36
+ return 'object' == typeof value && null !== value && !Array.isArray(value) && (Object.getPrototypeOf(value) === Object.prototype || null === Object.getPrototypeOf(value));
37
+ }
38
+ function formatStep(index) {
39
+ return `step ${index + 1}`;
40
+ }
41
+ function normalizeMeta(value, index) {
42
+ if (void 0 === value) return {
43
+ continueOnError: false
44
+ };
45
+ if (!isMapping(value)) throw new external_errors_js_namespaceObject.WorkflowParseError(`${formatStep(index)} "$" must be a mapping.`, {
46
+ index
47
+ });
48
+ for (const key of Object.keys(value))if (!supportedMetaKeys.has(key)) throw new external_errors_js_namespaceObject.WorkflowParseError(`${formatStep(index)} has unsupported engine metadata "${key}".`, {
49
+ index,
50
+ key
51
+ });
52
+ const timeout = value.timeout;
53
+ if (void 0 !== timeout && ('number' != typeof timeout || !Number.isFinite(timeout) || timeout <= 0)) throw new external_errors_js_namespaceObject.WorkflowParseError(`${formatStep(index)} "$.timeout" must be a positive number of milliseconds.`, {
54
+ index,
55
+ timeout
56
+ });
57
+ const continueOnError = value['continue-on-error'];
58
+ if (void 0 !== continueOnError && 'boolean' != typeof continueOnError) throw new external_errors_js_namespaceObject.WorkflowParseError(`${formatStep(index)} "$.continue-on-error" must be a boolean.`, {
59
+ index,
60
+ continueOnError
61
+ });
62
+ return {
63
+ ...void 0 === timeout ? {} : {
64
+ timeoutMs: timeout
65
+ },
66
+ continueOnError: continueOnError ?? false
67
+ };
68
+ }
69
+ function normalizeStep(value, index = 0, resolveNode) {
70
+ if (!isMapping(value)) throw new external_errors_js_namespaceObject.WorkflowParseError(`${formatStep(index)} must be a mapping.`, {
71
+ index
72
+ });
73
+ const entries = Object.entries(value);
74
+ if (1 !== entries.length) throw new external_errors_js_namespaceObject.WorkflowParseError(`${formatStep(index)} must contain exactly one node.`, {
75
+ index,
76
+ nodes: Object.keys(value)
77
+ });
78
+ const [node, rawValue] = entries[0];
79
+ if (0 === node.trim().length) throw new external_errors_js_namespaceObject.WorkflowParseError(`${formatStep(index)} node name must not be empty.`, {
80
+ index
81
+ });
82
+ if ('string' == typeof rawValue) {
83
+ const resolvedNode = resolveNode?.(node);
84
+ const stringInputKey = resolvedNode ? resolvedNode.stringInputKey : 'prompt';
85
+ if (false === stringInputKey || void 0 === stringInputKey) throw new external_errors_js_namespaceObject.WorkflowParseError(`${formatStep(index)} node "${node}" does not accept string shorthand.`, {
86
+ index,
87
+ node
88
+ });
89
+ return {
90
+ node,
91
+ input: {
92
+ [stringInputKey]: rawValue
93
+ },
94
+ meta: {
95
+ continueOnError: false
96
+ }
97
+ };
98
+ }
99
+ if (!isMapping(rawValue)) throw new external_errors_js_namespaceObject.WorkflowParseError(`${formatStep(index)} value must be a string shorthand or a mapping.`, {
100
+ index,
101
+ node
102
+ });
103
+ const { $: rawMeta, ...input } = rawValue;
104
+ return {
105
+ node,
106
+ input,
107
+ meta: normalizeMeta(rawMeta, index)
108
+ };
109
+ }
110
+ function normalizeSteps(steps, resolveNode) {
111
+ if (!Array.isArray(steps)) throw new external_errors_js_namespaceObject.WorkflowParseError('Steps must be an array.');
112
+ return steps.map((step, index)=>normalizeStep(step, index, resolveNode));
113
+ }
114
+ exports.normalizeStep = __webpack_exports__.normalizeStep;
115
+ exports.normalizeSteps = __webpack_exports__.normalizeSteps;
116
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
117
+ "normalizeStep",
118
+ "normalizeSteps"
119
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
120
+ Object.defineProperty(exports, '__esModule', {
121
+ value: true
122
+ });
123
+
124
+ //# sourceMappingURL=normalize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-runner/parser/normalize.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../../src/test-runner/parser/normalize.ts"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { WorkflowParseError } from '../errors';\nimport type { NormalizedStep, NormalizedStepMeta } from './types';\n\ninterface StringInputNodeDefinition {\n stringInputKey?: string | false;\n}\n\nexport type ResolveNodeForNormalization = (\n name: string,\n) => StringInputNodeDefinition | undefined;\n\nconst supportedMetaKeys = new Set(['timeout', 'continue-on-error']);\n\nfunction isMapping(value: unknown): value is Record<string, unknown> {\n return (\n typeof value === 'object' &&\n value !== null &&\n !Array.isArray(value) &&\n (Object.getPrototypeOf(value) === Object.prototype ||\n Object.getPrototypeOf(value) === null)\n );\n}\n\nfunction formatStep(index: number): string {\n return `step ${index + 1}`;\n}\n\nfunction normalizeMeta(value: unknown, index: number): NormalizedStepMeta {\n if (value === undefined) {\n return { continueOnError: false };\n }\n\n if (!isMapping(value)) {\n throw new WorkflowParseError(\n `${formatStep(index)} \"$\" must be a mapping.`,\n { index },\n );\n }\n\n for (const key of Object.keys(value)) {\n if (!supportedMetaKeys.has(key)) {\n throw new WorkflowParseError(\n `${formatStep(index)} has unsupported engine metadata \"${key}\".`,\n { index, key },\n );\n }\n }\n\n const timeout = value.timeout;\n if (\n timeout !== undefined &&\n (typeof timeout !== 'number' || !Number.isFinite(timeout) || timeout <= 0)\n ) {\n throw new WorkflowParseError(\n `${formatStep(index)} \"$.timeout\" must be a positive number of milliseconds.`,\n { index, timeout },\n );\n }\n\n const continueOnError = value['continue-on-error'];\n if (continueOnError !== undefined && typeof continueOnError !== 'boolean') {\n throw new WorkflowParseError(\n `${formatStep(index)} \"$.continue-on-error\" must be a boolean.`,\n { index, continueOnError },\n );\n }\n\n return {\n ...(timeout === undefined ? {} : { timeoutMs: timeout }),\n continueOnError: continueOnError ?? false,\n };\n}\n\nexport function normalizeStep(\n value: unknown,\n index = 0,\n resolveNode?: ResolveNodeForNormalization,\n): NormalizedStep {\n if (!isMapping(value)) {\n throw new WorkflowParseError(`${formatStep(index)} must be a mapping.`, {\n index,\n });\n }\n\n const entries = Object.entries(value);\n if (entries.length !== 1) {\n throw new WorkflowParseError(\n `${formatStep(index)} must contain exactly one node.`,\n { index, nodes: Object.keys(value) },\n );\n }\n\n const [node, rawValue] = entries[0];\n if (node.trim().length === 0) {\n throw new WorkflowParseError(\n `${formatStep(index)} node name must not be empty.`,\n { index },\n );\n }\n\n if (typeof rawValue === 'string') {\n const resolvedNode = resolveNode?.(node);\n const stringInputKey = resolvedNode\n ? resolvedNode.stringInputKey\n : 'prompt';\n if (stringInputKey === false || stringInputKey === undefined) {\n throw new WorkflowParseError(\n `${formatStep(index)} node \"${node}\" does not accept string shorthand.`,\n { index, node },\n );\n }\n return {\n node,\n input: { [stringInputKey]: rawValue },\n meta: { continueOnError: false },\n };\n }\n\n if (!isMapping(rawValue)) {\n throw new WorkflowParseError(\n `${formatStep(index)} value must be a string shorthand or a mapping.`,\n { index, node },\n );\n }\n\n const { $: rawMeta, ...input } = rawValue;\n\n return {\n node,\n input,\n meta: normalizeMeta(rawMeta, index),\n };\n}\n\nexport function normalizeSteps(\n steps: unknown,\n resolveNode?: ResolveNodeForNormalization,\n): NormalizedStep[] {\n if (!Array.isArray(steps)) {\n throw new WorkflowParseError('Steps must be an array.');\n }\n return steps.map((step, index) => normalizeStep(step, index, resolveNode));\n}\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","supportedMetaKeys","Set","isMapping","value","Array","formatStep","index","normalizeMeta","undefined","WorkflowParseError","timeout","Number","continueOnError","normalizeStep","resolveNode","entries","node","rawValue","resolvedNode","stringInputKey","rawMeta","input","normalizeSteps","steps","step"],"mappings":"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"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.r = (exports1)=>{
5
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
6
+ value: 'Module'
7
+ });
8
+ Object.defineProperty(exports1, '__esModule', {
9
+ value: true
10
+ });
11
+ };
12
+ })();
13
+ var __webpack_exports__ = {};
14
+ __webpack_require__.r(__webpack_exports__);
15
+ for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
16
+ Object.defineProperty(exports, '__esModule', {
17
+ value: true
18
+ });
19
+
20
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-runner/parser/types.js","sources":["webpack/runtime/make_namespace_object"],"sourcesContent":["// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};"],"names":["__webpack_require__","Symbol","Object"],"mappings":";;;IACAA,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,eAAlB,OAAOC,UAA0BA,OAAO,WAAW,EACrDC,OAAO,cAAc,CAAC,UAASD,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEC,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.r = (exports1)=>{
5
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
6
+ value: 'Module'
7
+ });
8
+ Object.defineProperty(exports1, '__esModule', {
9
+ value: true
10
+ });
11
+ };
12
+ })();
13
+ var __webpack_exports__ = {};
14
+ __webpack_require__.r(__webpack_exports__);
15
+ for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
16
+ Object.defineProperty(exports, '__esModule', {
17
+ value: true
18
+ });
19
+
20
+ //# sourceMappingURL=project.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-runner/project.js","sources":["webpack/runtime/make_namespace_object"],"sourcesContent":["// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};"],"names":["__webpack_require__","Symbol","Object"],"mappings":";;;IACAA,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,eAAlB,OAAOC,UAA0BA,OAAO,WAAW,EACrDC,OAAO,cAAc,CAAC,UAASD,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEC,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D"}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ buildAgentTestRunReportDump: ()=>buildAgentTestRunReportDump
28
+ });
29
+ const external_report_stats_js_namespaceObject = require("../../report-stats.js");
30
+ const external_test_run_report_js_namespaceObject = require("./test-run-report.js");
31
+ function buildAgentTestRunReportDump(input, agentDump, source) {
32
+ const summary = (0, external_report_stats_js_namespaceObject.collectReportSummary)(agentDump);
33
+ return (0, external_test_run_report_js_namespaceObject.buildTestRunReportDump)(input, {
34
+ sources: agentDump.executions.length ? [
35
+ {
36
+ ...source,
37
+ executionIds: agentDump.executions.flatMap((execution)=>execution.id ? [
38
+ execution.id
39
+ ] : [])
40
+ }
41
+ ] : [],
42
+ metrics: {
43
+ modelCallCount: summary.timing.modelCallCount,
44
+ modelTimeMs: summary.timing.modelCallTimeMs,
45
+ ...summary.tokens
46
+ }
47
+ });
48
+ }
49
+ exports.buildAgentTestRunReportDump = __webpack_exports__.buildAgentTestRunReportDump;
50
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
51
+ "buildAgentTestRunReportDump"
52
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
53
+ Object.defineProperty(exports, '__esModule', {
54
+ value: true
55
+ });
56
+
57
+ //# sourceMappingURL=agent-report.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-runner/reporting/agent-report.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../../src/test-runner/reporting/agent-report.ts"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { collectReportSummary } from '../../report-stats';\nimport type { TestRunReportDump } from '../../test-run-report';\nimport type { ReportActionDump } from '../../types';\nimport { buildTestRunReportDump } from './test-run-report';\nimport type { RunReportInput } from './types';\n\nexport function buildAgentTestRunReportDump(\n input: RunReportInput,\n agentDump: ReportActionDump,\n source: { scopeId: string; reportId: string; sourcePath: string },\n): TestRunReportDump {\n const summary = collectReportSummary(agentDump);\n return buildTestRunReportDump(input, {\n sources: agentDump.executions.length\n ? [\n {\n ...source,\n executionIds: agentDump.executions.flatMap((execution) =>\n execution.id ? [execution.id] : [],\n ),\n },\n ]\n : [],\n metrics: {\n modelCallCount: summary.timing.modelCallCount,\n modelTimeMs: summary.timing.modelCallTimeMs,\n ...summary.tokens,\n },\n });\n}\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","buildAgentTestRunReportDump","input","agentDump","source","summary","collectReportSummary","buildTestRunReportDump","execution"],"mappings":";;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGD,oBAAoB,CAAC,CAACC,YAAYC,QAAQ,CAACF,oBAAoB,CAAC,CAAC,UAASE,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAF,oBAAoB,CAAC,GAAG,CAACI,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFL,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,eAAlB,OAAOM,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D;;;;;;;;;ACAO,SAASI,4BACdC,KAAqB,EACrBC,SAA2B,EAC3BC,MAAiE;IAEjE,MAAMC,UAAUC,AAAAA,IAAAA,yCAAAA,oBAAAA,AAAAA,EAAqBH;IACrC,OAAOI,AAAAA,IAAAA,4CAAAA,sBAAAA,AAAAA,EAAuBL,OAAO;QACnC,SAASC,UAAU,UAAU,CAAC,MAAM,GAChC;YACE;gBACE,GAAGC,MAAM;gBACT,cAAcD,UAAU,UAAU,CAAC,OAAO,CAAC,CAACK,YAC1CA,UAAU,EAAE,GAAG;wBAACA,UAAU,EAAE;qBAAC,GAAG,EAAE;YAEtC;SACD,GACD,EAAE;QACN,SAAS;YACP,gBAAgBH,QAAQ,MAAM,CAAC,cAAc;YAC7C,aAAaA,QAAQ,MAAM,CAAC,eAAe;YAC3C,GAAGA,QAAQ,MAAM;QACnB;IACF;AACF"}
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ executionRecordsToReportInput: ()=>executionRecordsToReportInput
28
+ });
29
+ const external_execution_record_js_namespaceObject = require("../execution-record.js");
30
+ function executionRecordsToReportInput(records, options) {
31
+ if (0 === records.length) throw new Error('A report requires at least one execution record.');
32
+ const grouped = new Map();
33
+ for (const record of records){
34
+ const key = record.document.projectId;
35
+ const group = grouped.get(key) ?? [];
36
+ group.push(record);
37
+ grouped.set(key, group);
38
+ }
39
+ const summary = {
40
+ total: 0,
41
+ passed: 0,
42
+ failed: 0,
43
+ notRun: 0,
44
+ filtered: 0,
45
+ collectionErrors: 0,
46
+ documentFailures: 0,
47
+ projectFailures: 0
48
+ };
49
+ const projects = [];
50
+ for (const [projectId, group] of grouped){
51
+ const platform = group[0].platform;
52
+ const name = group[0].projectName ?? platform;
53
+ const latest = new Map();
54
+ const currentInvocation = new Map();
55
+ for (const record of group){
56
+ const documentId = record.document.documentId;
57
+ if (0 === record.attemptIndex || !currentInvocation.has(documentId)) currentInvocation.set(documentId, record.runId);
58
+ latest.set(currentInvocation.get(documentId), record);
59
+ }
60
+ for (const record of latest.values()){
61
+ const outcomes = record.execution?.cases;
62
+ summary.total += record.document.cases.length;
63
+ summary.passed += outcomes?.filter((item)=>'success' === item.status).length ?? 0;
64
+ summary.failed += outcomes?.filter((item)=>'failed' === item.status).length ?? 0;
65
+ summary.notRun += outcomes?.filter((item)=>'not-run' === item.status).length ?? record.document.cases.length;
66
+ if (void 0 !== record.setupError || void 0 !== record.executionError || void 0 !== record.reportError || (record.publicationErrors?.length ?? 0) > 0 || (record.observerErrors?.length ?? 0) > 0 || record.cleanupErrors.length || record.execution?.document.status === 'failed') summary.documentFailures += 1;
67
+ }
68
+ const results = group.map(external_execution_record_js_namespaceObject.executionRecordToResult);
69
+ const documents = results.map((result)=>result.document);
70
+ projects.push({
71
+ projectId,
72
+ name,
73
+ platform,
74
+ status: [
75
+ ...latest.values()
76
+ ].some((record)=>'failed' === record.status) ? 'failed' : 'success',
77
+ retry: Math.max(...group.map((record)=>record.attemptIndex)),
78
+ documents,
79
+ collectionErrors: [],
80
+ cases: results.flatMap((result)=>result.cases.map((outcome)=>({
81
+ ...outcome,
82
+ documentId: result.document.documentId,
83
+ documentRunId: result.document.documentRunId
84
+ })))
85
+ });
86
+ }
87
+ const startedAt = options.startedAt ?? records.map((record)=>record.startedAt).sort()[0];
88
+ const endedAt = options.endedAt ?? records.map((record)=>record.endedAt).sort().at(-1);
89
+ return {
90
+ runId: options.runId,
91
+ startedAt,
92
+ endedAt,
93
+ durationMs: Math.max(0, Date.parse(endedAt) - Date.parse(startedAt)),
94
+ status: projects.some((project)=>'failed' === project.status) ? 'failed' : 'success',
95
+ summary,
96
+ projects
97
+ };
98
+ }
99
+ exports.executionRecordsToReportInput = __webpack_exports__.executionRecordsToReportInput;
100
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
101
+ "executionRecordsToReportInput"
102
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
103
+ Object.defineProperty(exports, '__esModule', {
104
+ value: true
105
+ });
106
+
107
+ //# sourceMappingURL=execution-record.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-runner/reporting/execution-record.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../../src/test-runner/reporting/execution-record.ts"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import {\n type WorkflowExecutionRecord,\n executionRecordToResult,\n} from '../execution-record';\nimport type { RunReportInput, RunReportProjectInput } from './types';\n\n/** Project complete invocations without changing their legacy/API state. */\nexport function executionRecordsToReportInput(\n records: readonly WorkflowExecutionRecord[],\n options: { runId: string; startedAt?: string; endedAt?: string },\n): RunReportInput {\n if (records.length === 0)\n throw new Error('A report requires at least one execution record.');\n const grouped = new Map<string, WorkflowExecutionRecord[]>();\n for (const record of records) {\n const key = record.document.projectId;\n const group = grouped.get(key) ?? [];\n group.push(record);\n grouped.set(key, group);\n }\n const summary = {\n total: 0,\n passed: 0,\n failed: 0,\n notRun: 0,\n filtered: 0,\n collectionErrors: 0,\n documentFailures: 0,\n projectFailures: 0,\n };\n const projects: RunReportProjectInput[] = [];\n for (const [projectId, group] of grouped) {\n const platform = group[0].platform;\n const name = group[0].projectName ?? platform;\n const latest = new Map<string, WorkflowExecutionRecord>();\n const currentInvocation = new Map<string, string>();\n for (const record of group) {\n const documentId = record.document.documentId;\n if (record.attemptIndex === 0 || !currentInvocation.has(documentId))\n currentInvocation.set(documentId, record.runId);\n latest.set(currentInvocation.get(documentId)!, record);\n }\n for (const record of latest.values()) {\n const outcomes = record.execution?.cases;\n summary.total += record.document.cases.length;\n summary.passed +=\n outcomes?.filter((item) => item.status === 'success').length ?? 0;\n summary.failed +=\n outcomes?.filter((item) => item.status === 'failed').length ?? 0;\n summary.notRun +=\n outcomes?.filter((item) => item.status === 'not-run').length ??\n record.document.cases.length;\n if (\n record.setupError !== undefined ||\n record.executionError !== undefined ||\n record.reportError !== undefined ||\n (record.publicationErrors?.length ?? 0) > 0 ||\n (record.observerErrors?.length ?? 0) > 0 ||\n record.cleanupErrors.length ||\n record.execution?.document.status === 'failed'\n )\n summary.documentFailures += 1;\n }\n const results = group.map(executionRecordToResult);\n const documents = results.map((result) => result.document);\n projects.push({\n projectId,\n name,\n platform,\n status: [...latest.values()].some((record) => record.status === 'failed')\n ? 'failed'\n : 'success',\n retry: Math.max(...group.map((record) => record.attemptIndex)),\n documents,\n collectionErrors: [],\n cases: results.flatMap((result) =>\n result.cases.map((outcome) => ({\n ...outcome,\n documentId: result.document.documentId,\n documentRunId: result.document.documentRunId,\n })),\n ),\n });\n }\n const startedAt =\n options.startedAt ?? records.map((record) => record.startedAt).sort()[0];\n const endedAt =\n options.endedAt ??\n records\n .map((record) => record.endedAt)\n .sort()\n .at(-1)!;\n return {\n runId: options.runId,\n startedAt,\n endedAt,\n durationMs: Math.max(0, Date.parse(endedAt) - Date.parse(startedAt)),\n status: projects.some((project) => project.status === 'failed')\n ? 'failed'\n : 'success',\n summary,\n projects,\n };\n}\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","executionRecordsToReportInput","records","options","Error","grouped","Map","record","group","summary","projects","projectId","platform","name","latest","currentInvocation","documentId","outcomes","item","undefined","results","executionRecordToResult","documents","result","Math","outcome","startedAt","endedAt","Date","project"],"mappings":"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"}
@@ -0,0 +1,265 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ mergeTestRunReportDumps: ()=>mergeTestRunReportDumps
28
+ });
29
+ function agentReportAsTestRun(source) {
30
+ const { attributes, reportId } = source;
31
+ const status = 'skipped' === attributes.testStatus ? 'not-run' : 'passed' === attributes.testStatus ? 'success' : 'failed';
32
+ const failed = 'failed' === status;
33
+ return {
34
+ status: failed ? 'failed' : 'success',
35
+ ...source.timing,
36
+ summary: {
37
+ total: 1,
38
+ passed: 'success' === status ? 1 : 0,
39
+ failed: failed ? 1 : 0,
40
+ notRun: 'not-run' === status ? 1 : 0,
41
+ filtered: 0,
42
+ collectionErrors: 0,
43
+ documentFailures: 0,
44
+ projectFailures: 0
45
+ },
46
+ projects: [
47
+ {
48
+ projectId: 'agent-report',
49
+ name: attributes.testTitle,
50
+ platform: 'agent',
51
+ status: failed ? 'failed' : 'success',
52
+ retry: 0,
53
+ collectionErrors: [],
54
+ documents: [
55
+ {
56
+ documentId: 'agent-report',
57
+ sourcePath: source.sourcePath,
58
+ status: failed ? 'failed' : 'success',
59
+ beforeAll: [],
60
+ afterAll: [],
61
+ scopeReportIds: [
62
+ reportId
63
+ ],
64
+ cases: [
65
+ {
66
+ caseId: attributes.testId,
67
+ name: attributes.testTitle,
68
+ caseIndex: 0,
69
+ status,
70
+ attempts: 'not-run' !== status && source.timing ? [
71
+ {
72
+ attemptId: 'agent-report',
73
+ attemptIndex: 0,
74
+ status,
75
+ ...source.timing,
76
+ beforeEach: [],
77
+ steps: [],
78
+ afterEach: [],
79
+ scopeReportIds: [
80
+ reportId
81
+ ]
82
+ }
83
+ ] : []
84
+ }
85
+ ]
86
+ }
87
+ ]
88
+ }
89
+ ]
90
+ };
91
+ }
92
+ function retainHostFailure(source) {
93
+ const dump = source.dump;
94
+ if (!dump || 'failed' === dump.status || ![
95
+ 'failed',
96
+ 'timedOut',
97
+ 'interrupted'
98
+ ].includes(source.attributes.testStatus)) return dump;
99
+ const message = `Host test "${source.attributes.testTitle}" finished with status "${source.attributes.testStatus}".`;
100
+ const projectIndex = dump.projects.length - 1;
101
+ const project = dump.projects[projectIndex];
102
+ const documentIndex = (project?.documents.length ?? 0) - 1;
103
+ const document = project?.documents[documentIndex];
104
+ const afterHost = (value)=>({
105
+ ...value,
106
+ status: 'failed',
107
+ afterAll: [
108
+ ...value.afterAll,
109
+ {
110
+ id: `${value.documentRunId ?? value.documentId}:host-result`,
111
+ phase: 'afterAll',
112
+ stepIndex: value.afterAll.length,
113
+ node: 'runner:host-result',
114
+ status: 'failed',
115
+ continuedAfterError: false,
116
+ startedAt: value.endedAt ?? dump.endedAt,
117
+ endedAt: value.endedAt ?? dump.endedAt,
118
+ durationMs: 0,
119
+ error: {
120
+ name: 'HostTestError',
121
+ message
122
+ }
123
+ }
124
+ ]
125
+ });
126
+ return {
127
+ ...dump,
128
+ status: 'failed',
129
+ summary: {
130
+ ...dump.summary,
131
+ ...document ? {
132
+ documentFailures: dump.summary.documentFailures + 1
133
+ } : {
134
+ projectFailures: dump.summary.projectFailures + 1
135
+ }
136
+ },
137
+ projects: dump.projects.map((item, index)=>index !== projectIndex ? item : {
138
+ ...item,
139
+ status: 'failed',
140
+ documents: item.documents.map((value, index)=>index !== documentIndex ? value : {
141
+ ...afterHost(value),
142
+ ...value.attempts ? {
143
+ attempts: value.attempts.map((attempt, index)=>index === value.attempts.length - 1 ? afterHost(attempt) : attempt)
144
+ } : {}
145
+ })
146
+ }),
147
+ diagnostics: [
148
+ ...dump.diagnostics ?? [],
149
+ {
150
+ level: 'error',
151
+ code: 'run-infrastructure-error',
152
+ message
153
+ }
154
+ ]
155
+ };
156
+ }
157
+ function mergeTestRunReportDumps(sources, metrics, runId) {
158
+ const dumps = sources.map((source)=>{
159
+ if (source.dump && (!Number.isFinite(Date.parse(source.dump.startedAt)) || !Number.isFinite(Date.parse(source.dump.endedAt)) || Date.parse(source.dump.endedAt) < Date.parse(source.dump.startedAt))) throw new Error(`Invalid execution timestamps in Midscene Test report: ${source.sourcePath}`);
160
+ const dump = retainHostFailure(source) ?? agentReportAsTestRun(source);
161
+ const id = (value)=>`${source.reportId}:${value}`;
162
+ const scopeReports = (reportIds)=>reportIds?.length ? [
163
+ source.reportId
164
+ ] : reportIds;
165
+ const step = (value)=>({
166
+ ...value,
167
+ id: id(value.id),
168
+ ...value.agentDetails ? {
169
+ agentDetails: value.agentDetails.map((detail)=>({
170
+ ...detail,
171
+ reportId: source.reportId
172
+ }))
173
+ } : {}
174
+ });
175
+ const documentScope = (value)=>({
176
+ ...value,
177
+ documentId: id(value.documentId),
178
+ ...value.logicalDocumentId ? {
179
+ logicalDocumentId: id(value.logicalDocumentId)
180
+ } : {},
181
+ ...value.documentRunId ? {
182
+ documentRunId: id(value.documentRunId)
183
+ } : {},
184
+ beforeAll: value.beforeAll.map(step),
185
+ afterAll: value.afterAll.map(step),
186
+ scopeReportIds: scopeReports(value.scopeReportIds)
187
+ });
188
+ return {
189
+ ...dump,
190
+ projects: dump.projects.map((project)=>({
191
+ ...project,
192
+ projectId: id(project.projectId),
193
+ documents: project.documents.map((document)=>({
194
+ ...documentScope(document),
195
+ ...document.attempts ? {
196
+ attempts: document.attempts.map(documentScope)
197
+ } : {},
198
+ cases: document.cases.map((testCase)=>({
199
+ ...testCase,
200
+ caseId: id(testCase.caseId),
201
+ attempts: testCase.attempts.map((attempt)=>({
202
+ ...attempt,
203
+ attemptId: id(attempt.attemptId),
204
+ beforeEach: attempt.beforeEach.map(step),
205
+ steps: attempt.steps.map(step),
206
+ afterEach: attempt.afterEach.map(step),
207
+ scopeReportIds: scopeReports(attempt.scopeReportIds)
208
+ }))
209
+ }))
210
+ }))
211
+ })),
212
+ diagnostics: dump.diagnostics?.map((diagnostic)=>({
213
+ ...diagnostic,
214
+ ...diagnostic.scopeId ? {
215
+ scopeId: id(diagnostic.scopeId)
216
+ } : {}
217
+ }))
218
+ };
219
+ });
220
+ const recordedTimes = dumps.flatMap((dump)=>dump.startedAt && dump.endedAt ? [
221
+ {
222
+ start: Date.parse(dump.startedAt),
223
+ end: Date.parse(dump.endedAt)
224
+ }
225
+ ] : []);
226
+ if (!recordedTimes.length) throw new Error('Cannot merge Midscene Test reports without recorded execution timestamps.');
227
+ const startedAt = new Date(Math.min(...recordedTimes.map((time)=>time.start))).toISOString();
228
+ const endedAt = new Date(Math.max(...recordedTimes.map((time)=>time.end))).toISOString();
229
+ const summary = {
230
+ total: 0,
231
+ passed: 0,
232
+ failed: 0,
233
+ notRun: 0,
234
+ filtered: 0,
235
+ collectionErrors: 0,
236
+ documentFailures: 0,
237
+ projectFailures: 0
238
+ };
239
+ for (const dump of dumps)for (const key of Object.keys(summary))summary[key] += dump.summary[key];
240
+ const diagnostics = dumps.flatMap((dump)=>dump.diagnostics ?? []);
241
+ return {
242
+ schemaVersion: 1,
243
+ kind: 'test-runner',
244
+ runId,
245
+ status: dumps.some((dump)=>'failed' === dump.status) ? 'failed' : 'success',
246
+ startedAt,
247
+ endedAt,
248
+ durationMs: Math.max(0, Date.parse(endedAt) - Date.parse(startedAt)),
249
+ summary,
250
+ metrics,
251
+ projects: dumps.flatMap((dump)=>dump.projects),
252
+ ...diagnostics.length ? {
253
+ diagnostics
254
+ } : {}
255
+ };
256
+ }
257
+ exports.mergeTestRunReportDumps = __webpack_exports__.mergeTestRunReportDumps;
258
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
259
+ "mergeTestRunReportDumps"
260
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
261
+ Object.defineProperty(exports, '__esModule', {
262
+ value: true
263
+ });
264
+
265
+ //# sourceMappingURL=merge-report.js.map