@midscene/core 1.15.2-beta-20261012123219.0 → 1.15.2

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 (180) hide show
  1. package/dist/es/agent/action-readiness.mjs +6 -3
  2. package/dist/es/agent/action-readiness.mjs.map +1 -1
  3. package/dist/es/agent/agent.mjs +4 -2
  4. package/dist/es/agent/agent.mjs.map +1 -1
  5. package/dist/es/agent/execution-session.mjs.map +1 -1
  6. package/dist/es/agent/task-builder.mjs +35 -16
  7. package/dist/es/agent/task-builder.mjs.map +1 -1
  8. package/dist/es/agent/tasks.mjs +35 -12
  9. package/dist/es/agent/tasks.mjs.map +1 -1
  10. package/dist/es/agent/utils.mjs +1 -1
  11. package/dist/es/device/index.mjs +7 -6
  12. package/dist/es/device/index.mjs.map +1 -1
  13. package/dist/es/report-generator.mjs +30 -14
  14. package/dist/es/report-generator.mjs.map +1 -1
  15. package/dist/es/report-html-template.mjs +1 -1
  16. package/dist/es/report.mjs +121 -44
  17. package/dist/es/report.mjs.map +1 -1
  18. package/dist/es/service/index.mjs.map +1 -1
  19. package/dist/es/task-runner.mjs +22 -12
  20. package/dist/es/task-runner.mjs.map +1 -1
  21. package/dist/es/test-run-report.mjs.map +1 -1
  22. package/dist/es/test-runner/engine/case-runner.mjs +1 -1
  23. package/dist/es/test-runner/engine/case-runner.mjs.map +1 -1
  24. package/dist/es/test-runner/engine/document-runtime.mjs +42 -12
  25. package/dist/es/test-runner/engine/document-runtime.mjs.map +1 -1
  26. package/dist/es/test-runner/engine/execute-step.mjs +130 -12
  27. package/dist/es/test-runner/engine/execute-step.mjs.map +1 -1
  28. package/dist/es/test-runner/engine/index.mjs +1 -0
  29. package/dist/es/test-runner/engine/project-runtime.mjs +14 -5
  30. package/dist/es/test-runner/engine/project-runtime.mjs.map +1 -1
  31. package/dist/es/test-runner/engine/resource-operations.mjs +286 -35
  32. package/dist/es/test-runner/engine/resource-operations.mjs.map +1 -1
  33. package/dist/es/test-runner/engine/result-metadata.mjs +21 -0
  34. package/dist/es/test-runner/engine/result-metadata.mjs.map +1 -0
  35. package/dist/es/test-runner/engine/run-collected-case.mjs +30 -9
  36. package/dist/es/test-runner/engine/run-collected-case.mjs.map +1 -1
  37. package/dist/es/test-runner/engine/run-workflow-document.mjs +57 -10
  38. package/dist/es/test-runner/engine/run-workflow-document.mjs.map +1 -1
  39. package/dist/es/test-runner/errors.mjs +26 -13
  40. package/dist/es/test-runner/errors.mjs.map +1 -1
  41. package/dist/es/test-runner/execution-record.mjs +2 -0
  42. package/dist/es/test-runner/execution-record.mjs.map +1 -1
  43. package/dist/es/test-runner/index.mjs +3 -0
  44. package/dist/es/test-runner/reporting/agent-report.mjs +2 -7
  45. package/dist/es/test-runner/reporting/agent-report.mjs.map +1 -1
  46. package/dist/es/test-runner/reporting/merge-report.mjs +207 -6
  47. package/dist/es/test-runner/reporting/merge-report.mjs.map +1 -1
  48. package/dist/es/test-runner/reporting/metrics.mjs +77 -0
  49. package/dist/es/test-runner/reporting/metrics.mjs.map +1 -0
  50. package/dist/es/test-runner/reporting/sanitize.mjs +92 -16
  51. package/dist/es/test-runner/reporting/sanitize.mjs.map +1 -1
  52. package/dist/es/test-runner/reporting/test-plan.mjs +56 -0
  53. package/dist/es/test-runner/reporting/test-plan.mjs.map +1 -0
  54. package/dist/es/test-runner/reporting/test-run-report.mjs +208 -21
  55. package/dist/es/test-runner/reporting/test-run-report.mjs.map +1 -1
  56. package/dist/es/types.mjs.map +1 -1
  57. package/dist/es/utils.mjs +1 -1
  58. package/dist/es/yaml/legacy-yaml-runtime.mjs +3 -3
  59. package/dist/es/yaml/legacy-yaml-runtime.mjs.map +1 -1
  60. package/dist/lib/agent/action-readiness.js +6 -3
  61. package/dist/lib/agent/action-readiness.js.map +1 -1
  62. package/dist/lib/agent/agent.js +4 -2
  63. package/dist/lib/agent/agent.js.map +1 -1
  64. package/dist/lib/agent/execution-session.js.map +1 -1
  65. package/dist/lib/agent/task-builder.js +42 -23
  66. package/dist/lib/agent/task-builder.js.map +1 -1
  67. package/dist/lib/agent/tasks.js +35 -12
  68. package/dist/lib/agent/tasks.js.map +1 -1
  69. package/dist/lib/agent/utils.js +1 -1
  70. package/dist/lib/device/index.js +7 -6
  71. package/dist/lib/device/index.js.map +1 -1
  72. package/dist/lib/report-generator.js +30 -14
  73. package/dist/lib/report-generator.js.map +1 -1
  74. package/dist/lib/report-html-template.js +1 -1
  75. package/dist/lib/report.js +121 -44
  76. package/dist/lib/report.js.map +1 -1
  77. package/dist/lib/service/index.js.map +1 -1
  78. package/dist/lib/task-runner.js +22 -12
  79. package/dist/lib/task-runner.js.map +1 -1
  80. package/dist/lib/test-run-report.js.map +1 -1
  81. package/dist/lib/test-runner/engine/case-runner.js +1 -1
  82. package/dist/lib/test-runner/engine/case-runner.js.map +1 -1
  83. package/dist/lib/test-runner/engine/document-runtime.js +41 -11
  84. package/dist/lib/test-runner/engine/document-runtime.js.map +1 -1
  85. package/dist/lib/test-runner/engine/execute-step.js +131 -10
  86. package/dist/lib/test-runner/engine/execute-step.js.map +1 -1
  87. package/dist/lib/test-runner/engine/index.js +9 -2
  88. package/dist/lib/test-runner/engine/index.js.map +1 -1
  89. package/dist/lib/test-runner/engine/project-runtime.js +13 -4
  90. package/dist/lib/test-runner/engine/project-runtime.js.map +1 -1
  91. package/dist/lib/test-runner/engine/resource-operations.js +319 -38
  92. package/dist/lib/test-runner/engine/resource-operations.js.map +1 -1
  93. package/dist/lib/test-runner/engine/result-metadata.js +58 -0
  94. package/dist/lib/test-runner/engine/result-metadata.js.map +1 -0
  95. package/dist/lib/test-runner/engine/run-collected-case.js +29 -8
  96. package/dist/lib/test-runner/engine/run-collected-case.js.map +1 -1
  97. package/dist/lib/test-runner/engine/run-workflow-document.js +57 -10
  98. package/dist/lib/test-runner/engine/run-workflow-document.js.map +1 -1
  99. package/dist/lib/test-runner/errors.js +42 -23
  100. package/dist/lib/test-runner/errors.js.map +1 -1
  101. package/dist/lib/test-runner/execution-record.js +2 -0
  102. package/dist/lib/test-runner/execution-record.js.map +1 -1
  103. package/dist/lib/test-runner/index.js +88 -16
  104. package/dist/lib/test-runner/index.js.map +1 -1
  105. package/dist/lib/test-runner/node/index.js +2 -2
  106. package/dist/lib/test-runner/reporting/agent-report.js +2 -7
  107. package/dist/lib/test-runner/reporting/agent-report.js.map +1 -1
  108. package/dist/lib/test-runner/reporting/merge-report.js +207 -6
  109. package/dist/lib/test-runner/reporting/merge-report.js.map +1 -1
  110. package/dist/lib/test-runner/reporting/metrics.js +114 -0
  111. package/dist/lib/test-runner/reporting/metrics.js.map +1 -0
  112. package/dist/lib/test-runner/reporting/sanitize.js +94 -15
  113. package/dist/lib/test-runner/reporting/sanitize.js.map +1 -1
  114. package/dist/lib/test-runner/reporting/test-plan.js +90 -0
  115. package/dist/lib/test-runner/reporting/test-plan.js.map +1 -0
  116. package/dist/lib/test-runner/reporting/test-run-report.js +208 -21
  117. package/dist/lib/test-runner/reporting/test-run-report.js.map +1 -1
  118. package/dist/lib/types.js.map +1 -1
  119. package/dist/lib/utils.js +1 -1
  120. package/dist/lib/yaml/legacy-yaml-runtime.js +2 -2
  121. package/dist/lib/yaml/legacy-yaml-runtime.js.map +1 -1
  122. package/dist/types/agent/action-readiness.d.ts +1 -1
  123. package/dist/types/agent/action-readiness.d.ts.map +1 -1
  124. package/dist/types/agent/agent.d.ts +1 -1
  125. package/dist/types/agent/agent.d.ts.map +1 -1
  126. package/dist/types/agent/execution-session.d.ts +1 -1
  127. package/dist/types/agent/execution-session.d.ts.map +1 -1
  128. package/dist/types/agent/task-builder.d.ts +4 -2
  129. package/dist/types/agent/task-builder.d.ts.map +1 -1
  130. package/dist/types/agent/tasks.d.ts +3 -0
  131. package/dist/types/agent/tasks.d.ts.map +1 -1
  132. package/dist/types/device/index.d.ts +3 -3
  133. package/dist/types/device/index.d.ts.map +1 -1
  134. package/dist/types/report-generator.d.ts +4 -2
  135. package/dist/types/report-generator.d.ts.map +1 -1
  136. package/dist/types/report.d.ts.map +1 -1
  137. package/dist/types/service/index.d.ts +2 -2
  138. package/dist/types/service/index.d.ts.map +1 -1
  139. package/dist/types/task-runner.d.ts +1 -1
  140. package/dist/types/task-runner.d.ts.map +1 -1
  141. package/dist/types/test-run-report.d.ts +157 -8
  142. package/dist/types/test-run-report.d.ts.map +1 -1
  143. package/dist/types/test-runner/engine/document-runtime.d.ts.map +1 -1
  144. package/dist/types/test-runner/engine/execute-step.d.ts +1 -0
  145. package/dist/types/test-runner/engine/execute-step.d.ts.map +1 -1
  146. package/dist/types/test-runner/engine/index.d.ts +1 -0
  147. package/dist/types/test-runner/engine/index.d.ts.map +1 -1
  148. package/dist/types/test-runner/engine/project-runtime.d.ts.map +1 -1
  149. package/dist/types/test-runner/engine/resource-operations.d.ts +41 -3
  150. package/dist/types/test-runner/engine/resource-operations.d.ts.map +1 -1
  151. package/dist/types/test-runner/engine/result-metadata.d.ts +18 -0
  152. package/dist/types/test-runner/engine/result-metadata.d.ts.map +1 -0
  153. package/dist/types/test-runner/engine/run-collected-case.d.ts.map +1 -1
  154. package/dist/types/test-runner/engine/run-workflow-document.d.ts.map +1 -1
  155. package/dist/types/test-runner/engine/types.d.ts +47 -8
  156. package/dist/types/test-runner/engine/types.d.ts.map +1 -1
  157. package/dist/types/test-runner/errors.d.ts +7 -0
  158. package/dist/types/test-runner/errors.d.ts.map +1 -1
  159. package/dist/types/test-runner/execution-record.d.ts.map +1 -1
  160. package/dist/types/test-runner/index.d.ts +2 -0
  161. package/dist/types/test-runner/index.d.ts.map +1 -1
  162. package/dist/types/test-runner/node/types.d.ts +9 -1
  163. package/dist/types/test-runner/node/types.d.ts.map +1 -1
  164. package/dist/types/test-runner/parser/types.d.ts +5 -0
  165. package/dist/types/test-runner/parser/types.d.ts.map +1 -1
  166. package/dist/types/test-runner/reporting/agent-report.d.ts.map +1 -1
  167. package/dist/types/test-runner/reporting/merge-report.d.ts +1 -1
  168. package/dist/types/test-runner/reporting/merge-report.d.ts.map +1 -1
  169. package/dist/types/test-runner/reporting/metrics.d.ts +7 -0
  170. package/dist/types/test-runner/reporting/metrics.d.ts.map +1 -0
  171. package/dist/types/test-runner/reporting/sanitize.d.ts +1 -0
  172. package/dist/types/test-runner/reporting/sanitize.d.ts.map +1 -1
  173. package/dist/types/test-runner/reporting/test-plan.d.ts +8 -0
  174. package/dist/types/test-runner/reporting/test-plan.d.ts.map +1 -0
  175. package/dist/types/test-runner/reporting/test-run-report.d.ts.map +1 -1
  176. package/dist/types/test-runner/reporting/types.d.ts +6 -1
  177. package/dist/types/test-runner/reporting/types.d.ts.map +1 -1
  178. package/dist/types/types.d.ts +3 -1
  179. package/dist/types/types.d.ts.map +1 -1
  180. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"test-runner/engine/run-workflow-document.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../../src/test-runner/engine/run-workflow-document.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 type { CollectedCase, CollectedWorkflowDocument } from '../parser/types';\nimport { createDocumentRuntime } from './document-runtime';\nimport {\n WorkflowExecutionFailure,\n asExecutionError,\n} from './execution-failure';\nimport { runCollectedCase } from './run-collected-case';\nimport type {\n CaseRunOutcome,\n CaseRunResult,\n RunWorkflowDocumentOptions,\n WorkflowDocumentExecutionResult,\n WorkflowDocumentRunResult,\n} from './types';\n\nconst asNotRun = (\n collectedCase: CollectedCase,\n projectName: string,\n reason: NonNullable<CaseRunOutcome['notRunReason']>,\n): CaseRunOutcome => ({\n caseId: collectedCase.caseId,\n projectName,\n name: collectedCase.definition.name,\n sourcePath: collectedCase.sourcePath,\n caseIndex: collectedCase.caseIndex,\n ...(collectedCase.definition.onFailure\n ? { onFailure: collectedCase.definition.onFailure }\n : {}),\n status: 'not-run',\n notRunReason: reason,\n});\n\nexport async function runWorkflowDocument<TContext = undefined>(\n document: CollectedWorkflowDocument,\n options: RunWorkflowDocumentOptions<TContext>,\n): Promise<WorkflowDocumentExecutionResult> {\n const signal = options.signal ?? new AbortController().signal;\n const createDocumentRunId = options.createDocumentRunId;\n const createCaseRunId = options.createCaseRunId;\n const projectName = options.project?.name ?? document.projectId;\n const retry = options.retry ?? options.project?.retry ?? 0;\n if (!Number.isInteger(retry) || retry < 0) {\n throw new TypeError(\n 'Workflow document retry must be a non-negative integer.',\n );\n }\n const runtime = createDocumentRuntime(document, {\n documentSetup: options.documentSetup,\n documentAttemptIndex: options.documentAttemptIndex,\n resolveNode: options.resolveNode,\n project: options.project,\n projectContext: options.projectContext,\n signal,\n defaultTimeoutMs: options.defaultTimeoutMs,\n onStepStart: options.onStepStart,\n onStepResult: options.onStepResult,\n onResult: async (result) => {\n await options.documentSetup?.onDocumentResult?.(result, runtime.context);\n await options.onDocumentResult?.(result);\n },\n createDocumentRunId: createDocumentRunId\n ? () => createDocumentRunId(document)\n : undefined,\n });\n const cases: CaseRunOutcome[] = [];\n let runtimeStarted = false;\n let documentResult: WorkflowDocumentRunResult | undefined;\n const executionErrors: unknown[] = [];\n let fatalError = false;\n let stoppedByCase = false;\n\n try {\n runtimeStarted = true;\n const startedDocument = await runtime.start();\n\n if (!runtime.canRunCases) {\n const reason = signal.aborted\n ? (options.stopReason?.() ?? 'interrupted')\n : 'document-start-failed';\n cases.push(\n ...document.cases.map((collectedCase) =>\n asNotRun(collectedCase, projectName, reason),\n ),\n );\n } else {\n for (const collectedCase of document.cases) {\n if (\n stoppedByCase ||\n fatalError ||\n signal.aborted ||\n options.shouldStop?.()\n ) {\n const outcome = asNotRun(\n collectedCase,\n projectName,\n signal.aborted\n ? (options.stopReason?.() ?? 'interrupted')\n : fatalError\n ? 'fatal-error'\n : stoppedByCase\n ? 'bail'\n : (options.stopReason?.() ?? 'interrupted'),\n );\n cases.push(outcome);\n await options.onCaseOutcome?.(outcome);\n continue;\n }\n\n await options.onCaseStart?.(collectedCase);\n const attempts = [];\n for (let attemptIndex = 0; attemptIndex <= retry; attemptIndex += 1) {\n let attemptFailure:\n | WorkflowExecutionFailure<CaseRunResult>\n | undefined;\n const run = await runCollectedCase(collectedCase, {\n resolveNode: options.resolveNode,\n beforeEach: document.lifecycle.beforeEach,\n afterEach: document.lifecycle.afterEach,\n context: runtime.context,\n projectName,\n attemptIndex,\n signal: runtime.signal,\n defaultTimeoutMs: options.defaultTimeoutMs,\n onStepStart: options.onStepStart,\n onStepResult: options.onStepResult,\n onResult: options.onCaseResult,\n reportScopeId: options.resolveCaseReportScopeId?.(\n collectedCase,\n attemptIndex,\n startedDocument.documentRunId,\n ),\n createRunId: createCaseRunId\n ? () => createCaseRunId(collectedCase, attemptIndex)\n : undefined,\n }).catch((error: unknown) => {\n if (!(error instanceof WorkflowExecutionFailure)) throw error;\n attemptFailure = error as WorkflowExecutionFailure<CaseRunResult>;\n return attemptFailure.result;\n });\n attempts.push(run);\n if (attemptFailure) {\n cases.push({\n caseId: collectedCase.caseId,\n projectName,\n name: collectedCase.definition.name,\n sourcePath: collectedCase.sourcePath,\n caseIndex: collectedCase.caseIndex,\n ...(collectedCase.definition.onFailure\n ? { onFailure: collectedCase.definition.onFailure }\n : {}),\n status: 'failed',\n run,\n attempts,\n });\n throw attemptFailure;\n }\n fatalError = options.isFatalError?.(run) ?? false;\n if (\n run.status === 'success' ||\n // Retrying cannot repair cleanup/report publication and would\n // replay actions that may already have completed successfully.\n !!run.teardownErrors?.length ||\n fatalError ||\n signal.aborted ||\n options.shouldStop?.()\n )\n break;\n }\n const run = attempts.at(-1)!;\n const outcome: CaseRunOutcome = {\n caseId: collectedCase.caseId,\n projectName,\n name: collectedCase.definition.name,\n sourcePath: collectedCase.sourcePath,\n caseIndex: collectedCase.caseIndex,\n ...(collectedCase.definition.onFailure\n ? { onFailure: collectedCase.definition.onFailure }\n : {}),\n status: run.status,\n run,\n attempts,\n };\n cases.push(outcome);\n stoppedByCase =\n outcome.status === 'failed' &&\n collectedCase.definition.onFailure === 'stop-document';\n await options.onCaseOutcome?.(outcome);\n }\n }\n } catch (error) {\n executionErrors.push(\n ...(error instanceof WorkflowExecutionFailure ? error.errors : [error]),\n );\n } finally {\n if (runtimeStarted) {\n try {\n documentResult = await runtime.finish();\n } catch (error) {\n if (error instanceof WorkflowExecutionFailure) {\n documentResult = error.result as WorkflowDocumentRunResult;\n for (const failure of error.errors)\n if (!executionErrors.includes(failure))\n executionErrors.push(failure);\n } else executionErrors.push(error);\n }\n }\n }\n\n if (!documentResult) {\n if (executionErrors.length)\n throw new AggregateError(\n executionErrors,\n 'Workflow execution did not produce a document result.',\n );\n throw new Error(\n `Workflow document \"${document.sourcePath}\" did not produce a result.`,\n );\n }\n if (executionErrors.length) {\n const completed = new Set(cases.map((outcome) => outcome.caseId));\n cases.push(\n ...document.cases\n .filter((item) => !completed.has(item.caseId))\n .map((item) => asNotRun(item, projectName, 'interrupted')),\n );\n documentResult.status = 'failed';\n documentResult.executionErrors = executionErrors.map(asExecutionError);\n throw new WorkflowExecutionFailure(\n { document: documentResult, cases },\n executionErrors,\n );\n }\n return { document: documentResult, cases };\n}\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","asNotRun","collectedCase","projectName","reason","runWorkflowDocument","document","options","signal","AbortController","createDocumentRunId","createCaseRunId","retry","Number","TypeError","runtime","createDocumentRuntime","result","undefined","cases","runtimeStarted","documentResult","executionErrors","fatalError","stoppedByCase","startedDocument","outcome","attempts","attemptIndex","attemptFailure","run","runCollectedCase","error","WorkflowExecutionFailure","failure","A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AS,UAAU,CAAC,2BAA2B,CAAC;IAE1E;IACA,IAAIgB,gBAAgB,MAAM,EAAE;QAC1B,MAAMe,YAAY,IAAIC,IAAInB,MAAM,GAAG,CAAC,CAACO,UAAYA,QAAQ,MAAM;QAC/DP,MAAM,IAAI,IACLb,SAAS,KAAK,CACd,MAAM,CAAC,CAACiC,OAAS,CAACF,UAAU,GAAG,CAACE,KAAK,MAAM,GAC3C,GAAG,CAAC,CAACA,OAAStC,SAASsC,MAAMpC,aAAa;QAE/CkB,eAAe,MAAM,GAAG;QACxBA,eAAe,eAAe,GAAGC,gBAAgB,GAAG,CAACkB,8CAAAA,gBAAgBA;QACrE,MAAM,IAAIP,8CAAAA,wBAAwBA,CAChC;YAAE,UAAUZ;YAAgBF;QAAM,GAClCG;IAEJ;IACA,OAAO;QAAE,UAAUD;QAAgBF;IAAM;AAC3C"}
1
+ {"version":3,"file":"test-runner/engine/run-workflow-document.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../../src/test-runner/engine/run-workflow-document.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 { isResourceRecoveryError } from '../errors';\nimport type { CollectedCase, CollectedWorkflowDocument } from '../parser/types';\nimport { buildTestRunReportPlan } from '../reporting/test-plan';\nimport { createDocumentRuntime } from './document-runtime';\nimport {\n WorkflowExecutionFailure,\n asExecutionError,\n} from './execution-failure';\nimport { decideRetry } from './result-metadata';\nimport { runCollectedCase } from './run-collected-case';\nimport type {\n CaseRunOutcome,\n CaseRunResult,\n RunWorkflowDocumentOptions,\n WorkflowDocumentExecutionResult,\n WorkflowDocumentRunResult,\n} from './types';\n\nconst asNotRun = (\n collectedCase: CollectedCase,\n projectName: string,\n reason: NonNullable<CaseRunOutcome['notRunReason']>,\n): CaseRunOutcome => ({\n caseId: collectedCase.caseId,\n projectName,\n name: collectedCase.definition.name,\n sourcePath: collectedCase.sourcePath,\n caseIndex: collectedCase.caseIndex,\n ...(collectedCase.definition.onFailure\n ? { onFailure: collectedCase.definition.onFailure }\n : {}),\n status: 'not-run',\n notRunReason: reason,\n});\n\nexport async function runWorkflowDocument<TContext = undefined>(\n document: CollectedWorkflowDocument,\n options: RunWorkflowDocumentOptions<TContext>,\n): Promise<WorkflowDocumentExecutionResult> {\n const signal = options.signal ?? new AbortController().signal;\n const createDocumentRunId = options.createDocumentRunId;\n const createCaseRunId = options.createCaseRunId;\n const projectName = options.project?.name ?? document.projectId;\n const retry = options.retry ?? options.project?.retry ?? 0;\n if (!Number.isInteger(retry) || retry < 0) {\n throw new TypeError(\n 'Workflow document retry must be a non-negative integer.',\n );\n }\n const runtime = createDocumentRuntime(document, {\n plan:\n options.plan ??\n buildTestRunReportPlan(document, {\n defaultTimeoutMs: options.defaultTimeoutMs,\n retry: { scope: 'case', count: retry },\n }),\n documentSetup: options.documentSetup,\n documentAttemptIndex: options.documentAttemptIndex,\n resolveNode: options.resolveNode,\n project: options.project,\n projectContext: options.projectContext,\n signal,\n defaultTimeoutMs: options.defaultTimeoutMs,\n onStepStart: options.onStepStart,\n onStepResult: options.onStepResult,\n onResult: async (result) => {\n await options.documentSetup?.onDocumentResult?.(result, runtime.context);\n await options.onDocumentResult?.(result);\n },\n createDocumentRunId: createDocumentRunId\n ? () => createDocumentRunId(document)\n : undefined,\n });\n const cases: CaseRunOutcome[] = [];\n let runtimeStarted = false;\n let documentResult: WorkflowDocumentRunResult | undefined;\n const executionErrors: unknown[] = [];\n let fatalError = false;\n let documentStopReason: CaseRunOutcome['notRunReason'];\n\n try {\n runtimeStarted = true;\n const startedDocument = await runtime.start();\n\n if (!runtime.canRunCases) {\n const reason = signal.aborted\n ? (options.stopReason?.() ?? 'interrupted')\n : 'document-start-failed';\n cases.push(\n ...document.cases.map((collectedCase) =>\n asNotRun(collectedCase, projectName, reason),\n ),\n );\n } else {\n for (const collectedCase of document.cases) {\n if (\n documentStopReason ||\n fatalError ||\n signal.aborted ||\n options.shouldStop?.()\n ) {\n const outcome = asNotRun(\n collectedCase,\n projectName,\n signal.aborted\n ? (options.stopReason?.() ?? 'interrupted')\n : fatalError\n ? 'fatal-error'\n : (documentStopReason ??\n options.stopReason?.() ??\n 'interrupted'),\n );\n cases.push(outcome);\n await options.onCaseOutcome?.(outcome);\n continue;\n }\n\n await options.onCaseStart?.(collectedCase);\n const attempts = [];\n for (let attemptIndex = 0; attemptIndex <= retry; attemptIndex += 1) {\n let attemptFatalError = false;\n let attemptFailure:\n | WorkflowExecutionFailure<CaseRunResult>\n | undefined;\n const run = await runCollectedCase(collectedCase, {\n resolveNode: options.resolveNode,\n beforeEach: document.lifecycle.beforeEach,\n afterEach: document.lifecycle.afterEach,\n context: runtime.context,\n projectName,\n attemptIndex,\n signal: runtime.signal,\n defaultTimeoutMs: options.defaultTimeoutMs,\n onStepStart: options.onStepStart,\n onStepResult: options.onStepResult,\n onResult: async (result) => {\n attemptFatalError = options.isFatalError?.(result) ?? false;\n result.retryDecision = decideRetry({\n scope: 'case',\n retryCount: retry,\n attemptIndex,\n status: result.status,\n cleanupPending: result.cleanup?.status === 'pending',\n operationPending: !!result.pendingOperations?.length,\n cleanupFailed:\n result.cleanup?.status === 'failed' ||\n !!result.teardownErrors?.length,\n infrastructureError: result.executionErrors?.some(\n (error) => !isResourceRecoveryError(error),\n ),\n fatalError: attemptFatalError,\n interrupted: signal.aborted,\n shouldStop: options.shouldStop?.(),\n });\n await options.onCaseResult?.(result);\n },\n reportScopeId: options.resolveCaseReportScopeId?.(\n collectedCase,\n attemptIndex,\n startedDocument.documentRunId,\n ),\n createRunId: createCaseRunId\n ? () => createCaseRunId(collectedCase, attemptIndex)\n : undefined,\n }).catch((error: unknown) => {\n if (!(error instanceof WorkflowExecutionFailure)) throw error;\n attemptFailure = error as WorkflowExecutionFailure<CaseRunResult>;\n return attemptFailure.result;\n });\n attempts.push(run);\n if (\n attemptFailure &&\n !attemptFailure.errors.every(isResourceRecoveryError)\n ) {\n run.retryDecision = decideRetry({\n scope: 'case',\n retryCount: retry,\n attemptIndex,\n status: run.status,\n infrastructureError: true,\n });\n cases.push({\n caseId: collectedCase.caseId,\n projectName,\n name: collectedCase.definition.name,\n sourcePath: collectedCase.sourcePath,\n caseIndex: collectedCase.caseIndex,\n ...(collectedCase.definition.onFailure\n ? { onFailure: collectedCase.definition.onFailure }\n : {}),\n status: 'failed',\n run,\n attempts,\n });\n throw attemptFailure;\n }\n fatalError = attemptFatalError;\n // Result callbacks can interrupt execution or trigger bail. Observe\n // that boundary again before admitting another attempt.\n run.retryDecision = decideRetry({\n scope: 'case',\n retryCount: retry,\n attemptIndex,\n status: run.status,\n cleanupPending: run.cleanup?.status === 'pending',\n cleanupFailed:\n run.cleanup?.status === 'failed' || !!run.teardownErrors?.length,\n operationPending: !!run.pendingOperations?.length,\n fatalError:\n fatalError ||\n !!run.executionErrors?.some(isResourceRecoveryError),\n interrupted: signal.aborted,\n shouldStop: options.shouldStop?.(),\n });\n if (run.retryDecision?.decision !== 'retry') break;\n }\n const run = attempts.at(-1)!;\n const outcome: CaseRunOutcome = {\n caseId: collectedCase.caseId,\n projectName,\n name: collectedCase.definition.name,\n sourcePath: collectedCase.sourcePath,\n caseIndex: collectedCase.caseIndex,\n ...(collectedCase.definition.onFailure\n ? { onFailure: collectedCase.definition.onFailure }\n : {}),\n status: run.status,\n run,\n attempts,\n };\n cases.push(outcome);\n const retryStopReason = run.retryDecision?.reason;\n documentStopReason =\n retryStopReason === 'cleanup-pending' ||\n retryStopReason === 'cleanup-failed' ||\n retryStopReason === 'operation-pending' ||\n retryStopReason === 'fatal-error'\n ? retryStopReason\n : outcome.status === 'failed' &&\n collectedCase.definition.onFailure === 'stop-document'\n ? 'bail'\n : undefined;\n await options.onCaseOutcome?.(outcome);\n }\n }\n } catch (error) {\n executionErrors.push(\n ...(error instanceof WorkflowExecutionFailure ? error.errors : [error]),\n );\n } finally {\n if (runtimeStarted) {\n try {\n documentResult = await runtime.finish();\n } catch (error) {\n if (error instanceof WorkflowExecutionFailure) {\n documentResult = error.result as WorkflowDocumentRunResult;\n for (const failure of error.errors)\n if (!executionErrors.includes(failure))\n executionErrors.push(failure);\n } else executionErrors.push(error);\n }\n }\n }\n\n if (!documentResult) {\n if (executionErrors.length)\n throw new AggregateError(\n executionErrors,\n 'Workflow execution did not produce a document result.',\n );\n throw new Error(\n `Workflow document \"${document.sourcePath}\" did not produce a result.`,\n );\n }\n if (executionErrors.length) {\n const completed = new Set(cases.map((outcome) => outcome.caseId));\n cases.push(\n ...document.cases\n .filter((item) => !completed.has(item.caseId))\n .map((item) =>\n asNotRun(\n item,\n projectName,\n executionErrors.every(isResourceRecoveryError)\n ? 'operation-pending'\n : 'interrupted',\n ),\n ),\n );\n documentResult.status = 'failed';\n documentResult.executionErrors = executionErrors\n .filter(\n (error) =>\n !documentResult.hostErrors?.some((host) => host.error === error),\n )\n .map(asExecutionError);\n throw new WorkflowExecutionFailure(\n { document: documentResult, cases },\n executionErrors,\n );\n }\n return { document: documentResult, cases };\n}\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","asNotRun","collectedCase","projectName","reason","runWorkflowDocument","document","options","signal","AbortController","createDocumentRunId","createCaseRunId","retry","Number","TypeError","runtime","createDocumentRuntime","buildTestRunReportPlan","result","undefined","cases","runtimeStarted","documentResult","executionErrors","fatalError","documentStopReason","startedDocument","outcome","attempts","attemptIndex","attemptFatalError","attemptFailure","run","runCollectedCase","decideRetry","error","isResourceRecoveryError","WorkflowExecutionFailure","retrySt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,QAAQ,CAACgB,UAC5BhB,gBAAgB,IAAI,CAACgB;YAC3B,OAAOhB,gBAAgB,IAAI,CAACY;QAC9B;IAEJ;IAEA,IAAI,CAACb,gBAAgB;QACnB,IAAIC,gBAAgB,MAAM,EACxB,MAAM,IAAIiB,eACRjB,iBACA;QAEJ,MAAM,IAAIkB,MACR,CAAC,mBAAmB,EAAEnC,SAAS,UAAU,CAAC,2BAA2B,CAAC;IAE1E;IACA,IAAIiB,gBAAgB,MAAM,EAAE;QAC1B,MAAMmB,YAAY,IAAIC,IAAIvB,MAAM,GAAG,CAAC,CAACO,UAAYA,QAAQ,MAAM;QAC/DP,MAAM,IAAI,IACLd,SAAS,KAAK,CACd,MAAM,CAAC,CAACsC,OAAS,CAACF,UAAU,GAAG,CAACE,KAAK,MAAM,GAC3C,GAAG,CAAC,CAACA,OACJ3C,SACE2C,MACAzC,aACAoB,gBAAgB,KAAK,CAACa,mCAAAA,uBAAuBA,IACzC,sBACA;QAIZd,eAAe,MAAM,GAAG;QACxBA,eAAe,eAAe,GAAGC,gBAC9B,MAAM,CACL,CAACY,QACC,CAACb,eAAe,UAAU,EAAE,KAAK,CAACuB,OAASA,KAAK,KAAK,KAAKV,QAE7D,GAAG,CAACW,8CAAAA,gBAAgBA;QACvB,MAAM,IAAIT,8CAAAA,wBAAwBA,CAChC;YAAE,UAAUf;YAAgBF;QAAM,GAClCG;IAEJ;IACA,OAAO;QAAE,UAAUD;QAAgBF;IAAM;AAC3C"}
@@ -24,24 +24,27 @@ var __webpack_require__ = {};
24
24
  var __webpack_exports__ = {};
25
25
  __webpack_require__.r(__webpack_exports__);
26
26
  __webpack_require__.d(__webpack_exports__, {
27
- CaseExecutionError: ()=>CaseExecutionError,
28
- DuplicateNodeError: ()=>DuplicateNodeError,
29
- FatalDeviceError: ()=>FatalDeviceError,
30
- NodeDefinitionError: ()=>NodeDefinitionError,
31
- NodeExecutionError: ()=>NodeExecutionError,
32
27
  NodeInputValidationError: ()=>NodeInputValidationError,
33
28
  NodeNotFoundError: ()=>NodeNotFoundError,
34
- NodeScopeTeardownError: ()=>NodeScopeTeardownError,
35
29
  ProjectSetupError: ()=>ProjectSetupError,
36
- ProjectTeardownError: ()=>ProjectTeardownError,
37
- StepTimeoutError: ()=>StepTimeoutError,
38
- WorkflowDocumentExecutionError: ()=>WorkflowDocumentExecutionError,
39
30
  WorkflowError: ()=>WorkflowError,
40
31
  WorkflowLifecycleError: ()=>WorkflowLifecycleError,
41
- WorkflowParseError: ()=>WorkflowParseError,
32
+ DuplicateNodeError: ()=>DuplicateNodeError,
42
33
  isFatalDeviceError: ()=>isFatalDeviceError,
43
- normalizeNodeExecutionError: ()=>normalizeNodeExecutionError
34
+ isWorkflowError: ()=>isWorkflowError,
35
+ FatalDeviceError: ()=>FatalDeviceError,
36
+ StepTimeoutError: ()=>StepTimeoutError,
37
+ WorkflowParseError: ()=>WorkflowParseError,
38
+ NodeScopeTeardownError: ()=>NodeScopeTeardownError,
39
+ WorkflowDocumentExecutionError: ()=>WorkflowDocumentExecutionError,
40
+ ProjectTeardownError: ()=>ProjectTeardownError,
41
+ NodeDefinitionError: ()=>NodeDefinitionError,
42
+ isResourceRecoveryError: ()=>isResourceRecoveryError,
43
+ normalizeNodeExecutionError: ()=>normalizeNodeExecutionError,
44
+ NodeExecutionError: ()=>NodeExecutionError,
45
+ CaseExecutionError: ()=>CaseExecutionError
44
46
  });
47
+ const sanitize_js_namespaceObject = require("./reporting/sanitize.js");
45
48
  function _define_property(obj, key, value) {
46
49
  if (key in obj) Object.defineProperty(obj, key, {
47
50
  value: value,
@@ -52,21 +55,18 @@ function _define_property(obj, key, value) {
52
55
  else obj[key] = value;
53
56
  return obj;
54
57
  }
58
+ const workflowErrorKey = Symbol.for('@midscene/core/workflow-error');
59
+ let _workflowErrorKey = workflowErrorKey;
55
60
  class WorkflowError extends Error {
56
61
  toJSON() {
57
62
  return {
58
- name: this.name,
59
- message: this.message,
60
- code: this.code,
61
- ...void 0 === this.details ? {} : {
62
- details: this.details
63
- }
63
+ ...(0, sanitize_js_namespaceObject.sanitizeReportError)(this)
64
64
  };
65
65
  }
66
66
  constructor(message, options = {}){
67
67
  super(message, {
68
68
  cause: options.cause
69
- }), _define_property(this, "code", void 0), _define_property(this, "details", void 0);
69
+ }), _define_property(this, _workflowErrorKey, true), _define_property(this, "code", void 0), _define_property(this, "details", void 0);
70
70
  this.name = new.target.name;
71
71
  this.code = options.code ?? 'WORKFLOW_ERROR';
72
72
  this.details = options.details;
@@ -208,10 +208,21 @@ class FatalDeviceError extends WorkflowError {
208
208
  }
209
209
  }
210
210
  const isFatalDeviceError = (error)=>{
211
- if (error instanceof FatalDeviceError) return true;
212
- if (error instanceof WorkflowError && 'FATAL_DEVICE_ERROR' === error.code) return true;
213
- if (error instanceof Error && /device offline|device not found|(?:adb|bdc|device) connection (?:was )?closed/i.test(error.message)) return true;
214
- return error instanceof Error && void 0 !== error.cause ? isFatalDeviceError(error.cause) : false;
211
+ const seen = new Set();
212
+ const pending = [
213
+ error
214
+ ];
215
+ while(pending.length && seen.size < 50){
216
+ const current = pending.pop();
217
+ if ('object' != typeof current || null === current || seen.has(current)) continue;
218
+ seen.add(current);
219
+ if (current instanceof FatalDeviceError || 'FATAL_DEVICE_ERROR' === current.code) return true;
220
+ if (current instanceof Error && /device offline|device not found|(?:adb|bdc|device) connection (?:was )?closed/i.test(current.message)) return true;
221
+ const nested = current;
222
+ if (void 0 !== nested.cause) pending.push(nested.cause);
223
+ if (Array.isArray(nested.errors)) pending.push(...nested.errors.slice(0, 50));
224
+ }
225
+ return false;
215
226
  };
216
227
  class CaseExecutionError extends WorkflowError {
217
228
  constructor(result){
@@ -238,8 +249,12 @@ class WorkflowDocumentExecutionError extends WorkflowError {
238
249
  }
239
250
  }
240
251
  function normalizeNodeExecutionError(error, node) {
241
- return error instanceof WorkflowError ? error : new NodeExecutionError(node, error);
252
+ return isWorkflowError(error) ? error : new NodeExecutionError(node, error);
253
+ }
254
+ function isWorkflowError(error) {
255
+ return 'object' == typeof error && null !== error && true === error[workflowErrorKey];
242
256
  }
257
+ const isResourceRecoveryError = (error)=>isWorkflowError(error) && 'RESOURCE_RECOVERY_TIMEOUT' === error.code;
243
258
  exports.CaseExecutionError = __webpack_exports__.CaseExecutionError;
244
259
  exports.DuplicateNodeError = __webpack_exports__.DuplicateNodeError;
245
260
  exports.FatalDeviceError = __webpack_exports__.FatalDeviceError;
@@ -256,6 +271,8 @@ exports.WorkflowError = __webpack_exports__.WorkflowError;
256
271
  exports.WorkflowLifecycleError = __webpack_exports__.WorkflowLifecycleError;
257
272
  exports.WorkflowParseError = __webpack_exports__.WorkflowParseError;
258
273
  exports.isFatalDeviceError = __webpack_exports__.isFatalDeviceError;
274
+ exports.isResourceRecoveryError = __webpack_exports__.isResourceRecoveryError;
275
+ exports.isWorkflowError = __webpack_exports__.isWorkflowError;
259
276
  exports.normalizeNodeExecutionError = __webpack_exports__.normalizeNodeExecutionError;
260
277
  for(var __rspack_i in __webpack_exports__)if (-1 === [
261
278
  "CaseExecutionError",
@@ -274,6 +291,8 @@ for(var __rspack_i in __webpack_exports__)if (-1 === [
274
291
  "WorkflowLifecycleError",
275
292
  "WorkflowParseError",
276
293
  "isFatalDeviceError",
294
+ "isResourceRecoveryError",
295
+ "isWorkflowError",
277
296
  "normalizeNodeExecutionError"
278
297
  ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
279
298
  Object.defineProperty(exports, '__esModule', {
@@ -1 +1 @@
1
- {"version":3,"file":"test-runner/errors.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../src/test-runner/errors.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 type { z } from 'zod/v4';\n\nexport interface WorkflowErrorOptions {\n code?: string;\n details?: unknown;\n cause?: unknown;\n}\n\nexport class WorkflowError extends Error {\n readonly code: string;\n readonly details?: unknown;\n\n constructor(message: string, options: WorkflowErrorOptions = {}) {\n super(message, { cause: options.cause });\n this.name = new.target.name;\n this.code = options.code ?? 'WORKFLOW_ERROR';\n this.details = options.details;\n }\n\n toJSON(): Record<string, unknown> {\n return {\n name: this.name,\n message: this.message,\n code: this.code,\n ...(this.details === undefined ? {} : { details: this.details }),\n };\n }\n}\n\nexport class WorkflowParseError extends WorkflowError {\n constructor(message: string, details?: unknown, cause?: unknown) {\n super(message, { code: 'WORKFLOW_PARSE_ERROR', details, cause });\n }\n}\n\nexport class NodeDefinitionError extends WorkflowError {\n constructor(message: string, details?: unknown) {\n super(message, { code: 'NODE_DEFINITION_ERROR', details });\n }\n}\n\nexport class DuplicateNodeError extends WorkflowError {\n readonly node: string;\n\n constructor(node: string) {\n super(`Node \"${node}\" is already registered.`, {\n code: 'DUPLICATE_NODE',\n details: { node },\n });\n this.node = node;\n }\n}\n\nexport class NodeNotFoundError extends WorkflowError {\n readonly node: string;\n\n constructor(node: string) {\n super(`Node \"${node}\" is not registered.`, {\n code: 'NODE_NOT_FOUND',\n details: { node },\n });\n this.node = node;\n }\n}\n\nexport class NodeInputValidationError extends WorkflowError {\n constructor(message: string, details?: unknown) {\n super(message, { code: 'NODE_INPUT_VALIDATION_ERROR', details });\n }\n\n static fromZod(node: string, error: z.ZodError): NodeInputValidationError {\n const issues = error.issues.map((issue) => ({\n code: issue.code,\n path: issue.path.map(String).join('.'),\n message: issue.message,\n }));\n const firstIssue = issues[0];\n const path = firstIssue?.path || '<root>';\n const message = firstIssue?.message ?? 'invalid input';\n return new NodeInputValidationError(\n `Node \"${node}\" input validation failed at \"${path}\": ${message}`,\n { node, issues },\n );\n }\n}\n\nexport class StepTimeoutError extends WorkflowError {\n readonly timeoutMs: number;\n readonly node?: string;\n\n constructor(timeoutMs: number, node?: string) {\n super(\n node\n ? `Node \"${node}\" timed out after ${timeoutMs}ms.`\n : `Step timed out after ${timeoutMs}ms.`,\n {\n code: 'STEP_TIMEOUT',\n details: { timeoutMs, ...(node === undefined ? {} : { node }) },\n },\n );\n this.timeoutMs = timeoutMs;\n this.node = node;\n }\n}\n\nexport class NodeExecutionError extends WorkflowError {\n readonly node: string;\n\n constructor(\n node: string,\n cause: unknown,\n /** Failed actions can still produce useful, JSON-compatible diagnostic data. */\n readonly output?: import('./node/types').NodeResult,\n ) {\n const causeMessage =\n cause instanceof Error ? cause.message : String(cause ?? 'Unknown error');\n super(`Node \"${node}\" failed: ${causeMessage}`, {\n code: 'NODE_EXECUTION_ERROR',\n details: { node },\n cause,\n });\n this.node = node;\n }\n}\n\nexport class WorkflowLifecycleError extends WorkflowError {\n constructor(message: string, details?: unknown) {\n super(message, { code: 'WORKFLOW_LIFECYCLE_ERROR', details });\n }\n}\n\nexport class ProjectSetupError extends WorkflowError {\n constructor(cause: unknown, details: { projectName: string }) {\n const causeMessage =\n cause instanceof Error ? cause.message : String(cause ?? 'Unknown error');\n super(`Project \"${details.projectName}\" setup failed: ${causeMessage}`, {\n code: 'PROJECT_SETUP_ERROR',\n details,\n cause,\n });\n }\n}\n\nexport class ProjectTeardownError extends WorkflowError {\n constructor(\n cause: unknown,\n details: { projectName: string; registrationIndex: number },\n ) {\n const causeMessage =\n cause instanceof Error ? cause.message : String(cause ?? 'Unknown error');\n super(`Project \"${details.projectName}\" teardown failed: ${causeMessage}`, {\n code: 'PROJECT_TEARDOWN_ERROR',\n details,\n cause,\n });\n }\n}\n\nexport class NodeScopeTeardownError extends WorkflowError {\n constructor(\n cause: unknown,\n details: {\n scope: 'case' | 'document';\n scopeId: string;\n node: string;\n registrationIndex: number;\n },\n ) {\n const causeMessage =\n cause instanceof Error ? cause.message : String(cause ?? 'Unknown error');\n super(\n `${details.scope === 'case' ? 'Case attempt' : 'Workflow document'} node teardown failed for \"${details.node}\": ${causeMessage}`,\n { code: 'NODE_SCOPE_TEARDOWN_ERROR', details, cause },\n );\n }\n}\n\nexport class FatalDeviceError extends WorkflowError {\n constructor(message: string, cause?: unknown) {\n super(message, { code: 'FATAL_DEVICE_ERROR', cause });\n }\n}\n\nexport const isFatalDeviceError = (error: unknown): boolean => {\n if (error instanceof FatalDeviceError) return true;\n if (error instanceof WorkflowError && error.code === 'FATAL_DEVICE_ERROR') {\n return true;\n }\n if (\n error instanceof Error &&\n /device offline|device not found|(?:adb|bdc|device) connection (?:was )?closed/i.test(\n error.message,\n )\n ) {\n return true;\n }\n return error instanceof Error && error.cause !== undefined\n ? isFatalDeviceError(error.cause)\n : false;\n};\n\nexport class CaseExecutionError extends WorkflowError {\n readonly result: import('./engine/types').CaseRunResult;\n\n constructor(result: import('./engine/types').CaseRunResult) {\n super(`Case \"${result.name}\" failed.`, {\n code: 'CASE_EXECUTION_FAILED',\n details: { caseId: result.caseId, runId: result.runId },\n });\n this.result = result;\n }\n}\n\nexport class WorkflowDocumentExecutionError extends WorkflowError {\n readonly result: import('./engine/types').WorkflowDocumentRunResult;\n\n constructor(result: import('./engine/types').WorkflowDocumentRunResult) {\n super(`Workflow document \"${result.sourcePath}\" failed.`, {\n code: 'WORKFLOW_DOCUMENT_EXECUTION_FAILED',\n details: {\n documentId: result.documentId,\n documentRunId: result.documentRunId,\n },\n });\n this.result = result;\n }\n}\n\nexport function normalizeNodeExecutionError(\n error: unknown,\n node: string,\n): WorkflowError {\n return error instanceof WorkflowError\n ? error\n : new NodeExecutionError(node, error);\n}\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","WorkflowError","Error","undefined","message","options","WorkflowParseError","details","cause","NodeDefinitionError","DuplicateNodeError","node","NodeNotFoundError","NodeInputValidationError","error","issues","issue","String","firstIssue","path","StepTimeoutError","timeoutMs","NodeExecutionError","output","causeMessage","WorkflowLifecycleError","ProjectSetupError","ProjectTeardownError","NodeScopeTeardownError","FatalDeviceError","isFatalDeviceError","CaseExecutionError","result","WorkflowDocumentExecutionError","normalizeNodeExecutionError"],"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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACEO,MAAMI,sBAAsBC;IAWjC,SAAkC;QAChC,OAAO;YACL,MAAM,IAAI,CAAC,IAAI;YACf,SAAS,IAAI,CAAC,OAAO;YACrB,MAAM,IAAI,CAAC,IAAI;YACf,GAAI,AAAiBC,WAAjB,IAAI,CAAC,OAAO,GAAiB,CAAC,IAAI;gBAAE,SAAS,IAAI,CAAC,OAAO;YAAC,CAAC;QACjE;IACF;IAdA,YAAYC,OAAe,EAAEC,UAAgC,CAAC,CAAC,CAAE;QAC/D,KAAK,CAACD,SAAS;YAAE,OAAOC,QAAQ,KAAK;QAAC,IAJxC,uBAAS,QAAT,SACA,uBAAS,WAAT;QAIE,IAAI,CAAC,IAAI,GA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AAI,CAAC,SAAS,CAAC,EAAE;YACrC,MAAM;YACN,SAAS;gBAAE,QAAQA,OAAO,MAAM;gBAAE,OAAOA,OAAO,KAAK;YAAC;QACxD,IANF,uBAAS,UAAT;QAOE,IAAI,CAAC,MAAM,GAAGA;IAChB;AACF;AAEO,MAAMC,uCAAuChC;IAGlD,YAAY+B,MAA0D,CAAE;QACtE,KAAK,CAAC,CAAC,mBAAmB,EAAEA,OAAO,UAAU,CAAC,SAAS,CAAC,EAAE;YACxD,MAAM;YACN,SAAS;gBACP,YAAYA,OAAO,UAAU;gBAC7B,eAAeA,OAAO,aAAa;YACrC;QACF,IATF,uBAAS,UAAT;QAUE,IAAI,CAAC,MAAM,GAAGA;IAChB;AACF;AAEO,SAASE,4BACdpB,KAAc,EACdH,IAAY;IAEZ,OAAOG,iBAAiBb,gBACpBa,QACA,IAAIQ,mBAAmBX,MAAMG;AACnC"}
1
+ {"version":3,"file":"test-runner/errors.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../src/test-runner/errors.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 type { z } from 'zod/v4';\nimport { sanitizeReportError } from './reporting/sanitize';\n\nconst workflowErrorKey = Symbol.for('@midscene/core/workflow-error');\n\nexport interface WorkflowErrorOptions {\n code?: string;\n details?: unknown;\n cause?: unknown;\n}\n\nexport class WorkflowError extends Error {\n readonly [workflowErrorKey] = true;\n readonly code: string;\n readonly details?: unknown;\n\n constructor(message: string, options: WorkflowErrorOptions = {}) {\n super(message, { cause: options.cause });\n this.name = new.target.name;\n this.code = options.code ?? 'WORKFLOW_ERROR';\n this.details = options.details;\n }\n\n toJSON(): Record<string, unknown> {\n return { ...sanitizeReportError(this) };\n }\n}\n\nexport class WorkflowParseError extends WorkflowError {\n constructor(message: string, details?: unknown, cause?: unknown) {\n super(message, { code: 'WORKFLOW_PARSE_ERROR', details, cause });\n }\n}\n\nexport class NodeDefinitionError extends WorkflowError {\n constructor(message: string, details?: unknown) {\n super(message, { code: 'NODE_DEFINITION_ERROR', details });\n }\n}\n\nexport class DuplicateNodeError extends WorkflowError {\n readonly node: string;\n\n constructor(node: string) {\n super(`Node \"${node}\" is already registered.`, {\n code: 'DUPLICATE_NODE',\n details: { node },\n });\n this.node = node;\n }\n}\n\nexport class NodeNotFoundError extends WorkflowError {\n readonly node: string;\n\n constructor(node: string) {\n super(`Node \"${node}\" is not registered.`, {\n code: 'NODE_NOT_FOUND',\n details: { node },\n });\n this.node = node;\n }\n}\n\nexport class NodeInputValidationError extends WorkflowError {\n constructor(message: string, details?: unknown) {\n super(message, { code: 'NODE_INPUT_VALIDATION_ERROR', details });\n }\n\n static fromZod(node: string, error: z.ZodError): NodeInputValidationError {\n const issues = error.issues.map((issue) => ({\n code: issue.code,\n path: issue.path.map(String).join('.'),\n message: issue.message,\n }));\n const firstIssue = issues[0];\n const path = firstIssue?.path || '<root>';\n const message = firstIssue?.message ?? 'invalid input';\n return new NodeInputValidationError(\n `Node \"${node}\" input validation failed at \"${path}\": ${message}`,\n { node, issues },\n );\n }\n}\n\nexport class StepTimeoutError extends WorkflowError {\n readonly timeoutMs: number;\n readonly node?: string;\n\n constructor(timeoutMs: number, node?: string) {\n super(\n node\n ? `Node \"${node}\" timed out after ${timeoutMs}ms.`\n : `Step timed out after ${timeoutMs}ms.`,\n {\n code: 'STEP_TIMEOUT',\n details: { timeoutMs, ...(node === undefined ? {} : { node }) },\n },\n );\n this.timeoutMs = timeoutMs;\n this.node = node;\n }\n}\n\nexport class NodeExecutionError extends WorkflowError {\n readonly node: string;\n\n constructor(\n node: string,\n cause: unknown,\n /** Failed actions can still produce useful, JSON-compatible diagnostic data. */\n readonly output?: import('./node/types').NodeResult,\n ) {\n const causeMessage =\n cause instanceof Error ? cause.message : String(cause ?? 'Unknown error');\n super(`Node \"${node}\" failed: ${causeMessage}`, {\n code: 'NODE_EXECUTION_ERROR',\n details: { node },\n cause,\n });\n this.node = node;\n }\n}\n\nexport class WorkflowLifecycleError extends WorkflowError {\n constructor(message: string, details?: unknown) {\n super(message, { code: 'WORKFLOW_LIFECYCLE_ERROR', details });\n }\n}\n\nexport class ProjectSetupError extends WorkflowError {\n constructor(cause: unknown, details: { projectName: string }) {\n const causeMessage =\n cause instanceof Error ? cause.message : String(cause ?? 'Unknown error');\n super(`Project \"${details.projectName}\" setup failed: ${causeMessage}`, {\n code: 'PROJECT_SETUP_ERROR',\n details,\n cause,\n });\n }\n}\n\nexport class ProjectTeardownError extends WorkflowError {\n constructor(\n cause: unknown,\n details: { projectName: string; registrationIndex: number },\n ) {\n const causeMessage =\n cause instanceof Error ? cause.message : String(cause ?? 'Unknown error');\n super(`Project \"${details.projectName}\" teardown failed: ${causeMessage}`, {\n code: 'PROJECT_TEARDOWN_ERROR',\n details,\n cause,\n });\n }\n}\n\nexport class NodeScopeTeardownError extends WorkflowError {\n constructor(\n cause: unknown,\n details: {\n scope: 'case' | 'document';\n scopeId: string;\n node: string;\n registrationIndex: number;\n },\n ) {\n const causeMessage =\n cause instanceof Error ? cause.message : String(cause ?? 'Unknown error');\n super(\n `${details.scope === 'case' ? 'Case attempt' : 'Workflow document'} node teardown failed for \"${details.node}\": ${causeMessage}`,\n { code: 'NODE_SCOPE_TEARDOWN_ERROR', details, cause },\n );\n }\n}\n\nexport class FatalDeviceError extends WorkflowError {\n constructor(message: string, cause?: unknown) {\n super(message, { code: 'FATAL_DEVICE_ERROR', cause });\n }\n}\n\nexport const isFatalDeviceError = (error: unknown): boolean => {\n const seen = new Set<object>();\n const pending: unknown[] = [error];\n while (pending.length && seen.size < 50) {\n const current = pending.pop();\n if (typeof current !== 'object' || current === null || seen.has(current))\n continue;\n seen.add(current);\n if (\n current instanceof FatalDeviceError ||\n (current as { code?: unknown }).code === 'FATAL_DEVICE_ERROR'\n )\n return true;\n if (\n current instanceof Error &&\n /device offline|device not found|(?:adb|bdc|device) connection (?:was )?closed/i.test(\n current.message,\n )\n )\n return true;\n const nested = current as { cause?: unknown; errors?: unknown };\n if (nested.cause !== undefined) pending.push(nested.cause);\n if (Array.isArray(nested.errors))\n pending.push(...nested.errors.slice(0, 50));\n }\n return false;\n};\n\nexport class CaseExecutionError extends WorkflowError {\n readonly result: import('./engine/types').CaseRunResult;\n\n constructor(result: import('./engine/types').CaseRunResult) {\n super(`Case \"${result.name}\" failed.`, {\n code: 'CASE_EXECUTION_FAILED',\n details: { caseId: result.caseId, runId: result.runId },\n });\n this.result = result;\n }\n}\n\nexport class WorkflowDocumentExecutionError extends WorkflowError {\n readonly result: import('./engine/types').WorkflowDocumentRunResult;\n\n constructor(result: import('./engine/types').WorkflowDocumentRunResult) {\n super(`Workflow document \"${result.sourcePath}\" failed.`, {\n code: 'WORKFLOW_DOCUMENT_EXECUTION_FAILED',\n details: {\n documentId: result.documentId,\n documentRunId: result.documentRunId,\n },\n });\n this.result = result;\n }\n}\n\nexport function normalizeNodeExecutionError(\n error: unknown,\n node: string,\n): WorkflowError {\n return isWorkflowError(error) ? error : new NodeExecutionError(node, error);\n}\n\n/** CJS and ESM integrations share error identity without wrapping it twice. */\nexport function isWorkflowError(error: unknown): error is WorkflowError {\n return (\n typeof error === 'object' &&\n error !== null &&\n (error as WorkflowError)[workflowErrorKey] === true\n );\n}\n\n/** A cancelled operation exhausted its recovery budget within its owning scope. */\nexport const isResourceRecoveryError = (error: unknown): boolean =>\n isWorkflowError(error) && error.code === 'RESOURCE_RECOVERY_TIMEOUT';\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","workflowErrorKey","_workflowErrorKey","WorkflowError","Error","sanitizeReportError","message","options","WorkflowParseError","details","cause","NodeDefinitionError","DuplicateNodeError","node","NodeNotFoundError","NodeInputValidationError","error","issues","issue","String","firstIssue","path","StepTimeoutError","timeoutMs","undefined","NodeExecutionError","output","causeMessage","WorkflowLifecycleError","ProjectSetupError","ProjectTeardownError","NodeScopeTeardownError","FatalDeviceError","isFatalDeviceError","seen","Set","pending","current","nested","Array","CaseExecutionError","result","WorkflowDocumentExecutionError","normalizeNodeExecutionError","isWorkflowError","isResourceRecoveryError"],"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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACHA,MAAMI,mBAAmBD,OAAO,GAAG,CAAC;IASxBE,oBAAAA;AADL,MAAMC,sBAAsBC;IAYjC,SAAkC;QAChC,OAAO;YAAE,GAAGC,AAAAA,IAAAA,4BAAAA,mBAAAA,AAAAA,EAAoB,IAAI,CAAC;QAAC;IACxC;IATA,YAAYC,OAAe,EAAEC,UAAgC,CAAC,CAAC,CAAE;Q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QACtC4B,gBAAgB5B,UAAUA,AAAe,gCAAfA,MAAM,IAAI"}
@@ -28,6 +28,7 @@ __webpack_require__.d(__webpack_exports__, {
28
28
  serializeWorkflowExecutionRecord: ()=>serializeWorkflowExecutionRecord,
29
29
  serializeWorkflowValue: ()=>serializeWorkflowValue
30
30
  });
31
+ const test_plan_js_namespaceObject = require("./reporting/test-plan.js");
31
32
  function executionRecordToResult(record) {
32
33
  const execution = record.execution?.document;
33
34
  const hostErrors = [
@@ -48,6 +49,7 @@ function executionRecordToResult(record) {
48
49
  const projectName = record.projectName ?? execution?.projectName ?? record.platform;
49
50
  return {
50
51
  document: {
52
+ plan: execution?.plan ?? (0, test_plan_js_namespaceObject.buildTestRunReportPlan)(record.document),
51
53
  documentId: record.document.documentId,
52
54
  documentRunId: record.runId,
53
55
  attemptIndex: record.attemptIndex,
@@ -1 +1 @@
1
- {"version":3,"file":"test-runner/execution-record.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../src/test-runner/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 type {\n WorkflowDocumentExecutionResult,\n WorkflowHostError,\n WorkflowReportSource,\n} from './engine/types';\nimport type { CollectedWorkflowDocument } from './parser/types';\n\n/**\n * One complete document invocation, including work outside the pure kernel.\n * The entry adapter owns resources and records their lifecycle here. A failed\n * setup has a record even though no document could be executed.\n *\n * runId identifies this invocation, not an Agent/report resource. File retries\n * create new records; they do not become per-Case retries. Report projection\n * must not mutate these records or redact the original API output.\n */\nexport interface WorkflowExecutionRecord {\n readonly runId: string;\n readonly attemptIndex: number;\n readonly sourcePath: string;\n readonly platform: string;\n readonly projectName?: string;\n readonly document: CollectedWorkflowDocument;\n readonly status: 'success' | 'failed';\n readonly startedAt: string;\n readonly endedAt: string;\n readonly durationMs: number;\n readonly execution?: WorkflowDocumentExecutionResult;\n readonly setupError?: unknown;\n readonly executionError?: unknown;\n readonly cleanupErrors: readonly unknown[];\n readonly outputs: Readonly<Record<string, unknown>>;\n readonly reportPaths: readonly string[];\n readonly reportSources?: readonly WorkflowReportSource[];\n readonly children?: readonly WorkflowExecutionRecord[];\n readonly reportError?: unknown;\n /** Entry-owned report copies or result files failed after execution finished. */\n readonly publicationErrors?: readonly unknown[];\n /** Entry progress/result observers failed, independently of action outcomes. */\n readonly observerErrors?: readonly unknown[];\n}\n\n/** Complete host facts as a kernel result. Report and summary consume this view. */\nexport function executionRecordToResult(\n record: WorkflowExecutionRecord,\n): WorkflowDocumentExecutionResult {\n const execution = record.execution?.document;\n const hostErrors: WorkflowHostError[] = [...(execution?.hostErrors ?? [])];\n const add = (phase: WorkflowHostError['phase'], error: unknown) => {\n if (error !== undefined) hostErrors.push({ phase, error });\n };\n add('setup', record.setupError);\n add('execution', record.executionError);\n for (const error of record.cleanupErrors) add('cleanup', error);\n add('report', record.reportError);\n for (const error of record.publicationErrors ?? []) add('publication', error);\n for (const error of record.observerErrors ?? []) add('observer', error);\n const projectName =\n record.projectName ?? execution?.projectName ?? record.platform;\n return {\n document: {\n documentId: record.document.documentId,\n documentRunId: record.runId,\n attemptIndex: record.attemptIndex,\n projectId: record.document.projectId,\n projectName,\n sourcePath: record.sourcePath,\n // Case failures are counted separately; host failures must not convert\n // successful Cases into retryable action failures.\n status:\n hostErrors.length || execution?.status === 'failed'\n ? 'failed'\n : 'success',\n startedAt: record.startedAt,\n endedAt: record.endedAt,\n durationMs: record.durationMs,\n beforeAll: execution?.beforeAll ?? [],\n afterAll: execution?.afterAll ?? [],\n ...(hostErrors.length ? { hostErrors } : {}),\n ...(execution?.executionErrors?.length\n ? { executionErrors: execution.executionErrors }\n : {}),\n ...(execution?.teardownErrors?.length\n ? { teardownErrors: execution.teardownErrors }\n : {}),\n reportScopeId: execution?.reportScopeId ?? record.runId,\n reportPaths: [...record.reportPaths],\n ...(record.reportSources?.length\n ? { reportSources: [...record.reportSources] }\n : {}),\n },\n cases:\n record.execution?.cases ??\n record.document.cases.map((item) => ({\n caseId: item.caseId,\n projectName,\n name: item.definition.name,\n sourcePath: item.sourcePath,\n caseIndex: item.caseIndex,\n status: 'not-run' as const,\n notRunReason: 'document-start-failed' as const,\n })),\n };\n}\n\n/** Persist execution facts across workers without dropping native Error fields. */\nexport function serializeWorkflowExecutionRecord(\n record: WorkflowExecutionRecord,\n): string {\n return serializeWorkflowValue(record);\n}\n\n/** The same error-preserving encoding for entry results and worker envelopes. */\nexport function serializeWorkflowValue(value: unknown): string {\n return JSON.stringify(\n value,\n (_key, value) =>\n value instanceof Error\n ? {\n name: value.name,\n message: value.message,\n ...('code' in value ? { code: value.code } : {}),\n ...('details' in value ? { details: value.details } : {}),\n ...(value instanceof AggregateError\n ? { errors: value.errors }\n : {}),\n }\n : value,\n 2,\n );\n}\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","executionRecordToResult","record","execution","hostErrors","add","phase","error","undefined","projectName","item","serializeWorkflowExecutionRecord","serializeWorkflowValue","value","JSON","_key","Error","AggregateError"],"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,KA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property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../src/test-runner/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 type {\n WorkflowDocumentExecutionResult,\n WorkflowHostError,\n WorkflowReportSource,\n} from './engine/types';\nimport type { CollectedWorkflowDocument } from './parser/types';\nimport { buildTestRunReportPlan } from './reporting/test-plan';\n\n/**\n * One complete document invocation, including work outside the pure kernel.\n * The entry adapter owns resources and records their lifecycle here. A failed\n * setup has a record even though no document could be executed.\n *\n * runId identifies this invocation, not an Agent/report resource. File retries\n * create new records; they do not become per-Case retries. Report projection\n * must not mutate these records or redact the original API output.\n */\nexport interface WorkflowExecutionRecord {\n readonly runId: string;\n readonly attemptIndex: number;\n readonly sourcePath: string;\n readonly platform: string;\n readonly projectName?: string;\n readonly document: CollectedWorkflowDocument;\n readonly status: 'success' | 'failed';\n readonly startedAt: string;\n readonly endedAt: string;\n readonly durationMs: number;\n readonly execution?: WorkflowDocumentExecutionResult;\n readonly setupError?: unknown;\n readonly executionError?: unknown;\n readonly cleanupErrors: readonly unknown[];\n readonly outputs: Readonly<Record<string, unknown>>;\n readonly reportPaths: readonly string[];\n readonly reportSources?: readonly WorkflowReportSource[];\n readonly children?: readonly WorkflowExecutionRecord[];\n readonly reportError?: unknown;\n /** Entry-owned report copies or result files failed after execution finished. */\n readonly publicationErrors?: readonly unknown[];\n /** Entry progress/result observers failed, independently of action outcomes. */\n readonly observerErrors?: readonly unknown[];\n}\n\n/** Complete host facts as a kernel result. Report and summary consume this view. */\nexport function executionRecordToResult(\n record: WorkflowExecutionRecord,\n): WorkflowDocumentExecutionResult {\n const execution = record.execution?.document;\n const hostErrors: WorkflowHostError[] = [...(execution?.hostErrors ?? [])];\n const add = (phase: WorkflowHostError['phase'], error: unknown) => {\n if (error !== undefined) hostErrors.push({ phase, error });\n };\n add('setup', record.setupError);\n add('execution', record.executionError);\n for (const error of record.cleanupErrors) add('cleanup', error);\n add('report', record.reportError);\n for (const error of record.publicationErrors ?? []) add('publication', error);\n for (const error of record.observerErrors ?? []) add('observer', error);\n const projectName =\n record.projectName ?? execution?.projectName ?? record.platform;\n return {\n document: {\n plan: execution?.plan ?? buildTestRunReportPlan(record.document),\n documentId: record.document.documentId,\n documentRunId: record.runId,\n attemptIndex: record.attemptIndex,\n projectId: record.document.projectId,\n projectName,\n sourcePath: record.sourcePath,\n // Case failures are counted separately; host failures must not convert\n // successful Cases into retryable action failures.\n status:\n hostErrors.length || execution?.status === 'failed'\n ? 'failed'\n : 'success',\n startedAt: record.startedAt,\n endedAt: record.endedAt,\n durationMs: record.durationMs,\n beforeAll: execution?.beforeAll ?? [],\n afterAll: execution?.afterAll ?? [],\n ...(hostErrors.length ? { hostErrors } : {}),\n ...(execution?.executionErrors?.length\n ? { executionErrors: execution.executionErrors }\n : {}),\n ...(execution?.teardownErrors?.length\n ? { teardownErrors: execution.teardownErrors }\n : {}),\n reportScopeId: execution?.reportScopeId ?? record.runId,\n reportPaths: [...record.reportPaths],\n ...(record.reportSources?.length\n ? { reportSources: [...record.reportSources] }\n : {}),\n },\n cases:\n record.execution?.cases ??\n record.document.cases.map((item) => ({\n caseId: item.caseId,\n projectName,\n name: item.definition.name,\n sourcePath: item.sourcePath,\n caseIndex: item.caseIndex,\n status: 'not-run' as const,\n notRunReason: 'document-start-failed' as const,\n })),\n };\n}\n\n/** Persist execution facts across workers without dropping native Error fields. */\nexport function serializeWorkflowExecutionRecord(\n record: WorkflowExecutionRecord,\n): string {\n return serializeWorkflowValue(record);\n}\n\n/** The same error-preserving encoding for entry results and worker envelopes. */\nexport function serializeWorkflowValue(value: unknown): string {\n return JSON.stringify(\n value,\n (_key, value) =>\n value instanceof Error\n ? {\n name: value.name,\n message: value.message,\n ...('code' in value ? { code: value.code } : {}),\n ...('details' in value ? { details: value.details } : {}),\n ...(value instanceof AggregateError\n ? { errors: value.errors }\n : {}),\n }\n : value,\n 2,\n );\n}\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","executionRecordToResult","record","execution","hostErrors","add","phase","error","undefined","projectName","buildTestRunReportPlan","item","serializeWorkflowExecutionRecord","serializeWorkflowValue","value","JSON","_key","Error","AggregateError"],"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;;;;;;;;;;ACsCO,SAASI,wBACdC,MAA+B;IAE/B,MAAMC,YAAYD,OAAO,SAAS,EAAE;IACpC,MAAME,aAAkC;WAAKD,WAAW,cAAc,EAAE;KAAE;IAC1E,MAAME,MAAM,CAACC,OAAmCC;QAC9C,IAAIA,AAAUC,WAAVD,OAAqBH,WAAW,IAAI,CAAC;YA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AAa;iBAAC;YAAC,IAC3C,CAAC,CAAC;QACR;QACA,OACEA,OAAO,SAAS,EAAE,SAClBA,OAAO,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAACS,OAAU;gBACnC,QAAQA,KAAK,MAAM;gBACnBF;gBACA,MAAME,KAAK,UAAU,CAAC,IAAI;gBAC1B,YAAYA,KAAK,UAAU;gBAC3B,WAAWA,KAAK,SAAS;gBACzB,QAAQ;gBACR,cAAc;YAChB;IACJ;AACF;AAGO,SAASC,iCACdV,MAA+B;IAE/B,OAAOW,uBAAuBX;AAChC;AAGO,SAASW,uBAAuBC,KAAc;IACnD,OAAOC,KAAK,SAAS,CACnBD,OACA,CAACE,MAAMF,QACLA,iBAAiBG,QACb;YACE,MAAMH,MAAM,IAAI;YAChB,SAASA,MAAM,OAAO;YACtB,GAAI,UAAUA,QAAQ;gBAAE,MAAMA,MAAM,IAAI;YAAC,IAAI,CAAC,CAAC;YAC/C,GAAI,aAAaA,QAAQ;gBAAE,SAASA,MAAM,OAAO;YAAC,IAAI,CAAC,CAAC;YACxD,GAAIA,iBAAiBI,iBACjB;gBAAE,QAAQJ,MAAM,MAAM;YAAC,IACvB,CAAC,CAAC;QACR,IACAA,OACN;AAEJ"}
@@ -27,9 +27,15 @@ var __webpack_modules__ = {
27
27
  "./reporting/execution-record" (module) {
28
28
  module.exports = require("./reporting/execution-record.js");
29
29
  },
30
+ "./reporting/metrics" (module) {
31
+ module.exports = require("./reporting/metrics.js");
32
+ },
30
33
  "./reporting/sanitize" (module) {
31
34
  module.exports = require("./reporting/sanitize.js");
32
35
  },
36
+ "./reporting/test-plan" (module) {
37
+ module.exports = require("./reporting/test-plan.js");
38
+ },
33
39
  "./reporting/test-run-report" (module) {
34
40
  module.exports = require("./reporting/test-run-report.js");
35
41
  },
@@ -80,56 +86,122 @@ function __webpack_require__(moduleId) {
80
86
  var __webpack_exports__ = {};
81
87
  (()=>{
82
88
  __webpack_require__.r(__webpack_exports__);
89
+ __webpack_require__.d(__webpack_exports__, {
90
+ collectTestRunReportMetrics: ()=>_reporting_metrics__rspack_import_12.collectTestRunReportMetrics,
91
+ sumTestRunReportMetrics: ()=>_reporting_metrics__rspack_import_12.sumTestRunReportMetrics
92
+ });
83
93
  var _engine__rspack_import_0 = __webpack_require__("./engine");
84
94
  var __rspack_reexport = {};
85
- for(const __rspack_import_key in _engine__rspack_import_0)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_engine__rspack_import_0[__rspack_import_key];
95
+ for(const __rspack_import_key in _engine__rspack_import_0)if ([
96
+ "default",
97
+ "sumTestRunReportMetrics",
98
+ "collectTestRunReportMetrics"
99
+ ].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_engine__rspack_import_0[__rspack_import_key];
86
100
  __webpack_require__.d(__webpack_exports__, __rspack_reexport);
87
101
  var _errors__rspack_import_1 = __webpack_require__("./errors");
88
102
  var __rspack_reexport = {};
89
- for(const __rspack_import_key in _errors__rspack_import_1)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_errors__rspack_import_1[__rspack_import_key];
103
+ for(const __rspack_import_key in _errors__rspack_import_1)if ([
104
+ "default",
105
+ "sumTestRunReportMetrics",
106
+ "collectTestRunReportMetrics"
107
+ ].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_errors__rspack_import_1[__rspack_import_key];
90
108
  __webpack_require__.d(__webpack_exports__, __rspack_reexport);
91
109
  var _execution_record__rspack_import_2 = __webpack_require__("./execution-record");
92
110
  var __rspack_reexport = {};
93
- for(const __rspack_import_key in _execution_record__rspack_import_2)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_execution_record__rspack_import_2[__rspack_import_key];
111
+ for(const __rspack_import_key in _execution_record__rspack_import_2)if ([
112
+ "default",
113
+ "sumTestRunReportMetrics",
114
+ "collectTestRunReportMetrics"
115
+ ].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_execution_record__rspack_import_2[__rspack_import_key];
94
116
  __webpack_require__.d(__webpack_exports__, __rspack_reexport);
95
117
  var _node__rspack_import_3 = __webpack_require__("./node");
96
118
  var __rspack_reexport = {};
97
- for(const __rspack_import_key in _node__rspack_import_3)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_node__rspack_import_3[__rspack_import_key];
119
+ for(const __rspack_import_key in _node__rspack_import_3)if ([
120
+ "default",
121
+ "sumTestRunReportMetrics",
122
+ "collectTestRunReportMetrics"
123
+ ].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_node__rspack_import_3[__rspack_import_key];
98
124
  __webpack_require__.d(__webpack_exports__, __rspack_reexport);
99
125
  var _parser_normalize__rspack_import_4 = __webpack_require__("./parser/normalize");
100
126
  var __rspack_reexport = {};
101
- for(const __rspack_import_key in _parser_normalize__rspack_import_4)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_parser_normalize__rspack_import_4[__rspack_import_key];
127
+ for(const __rspack_import_key in _parser_normalize__rspack_import_4)if ([
128
+ "default",
129
+ "sumTestRunReportMetrics",
130
+ "collectTestRunReportMetrics"
131
+ ].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_parser_normalize__rspack_import_4[__rspack_import_key];
102
132
  __webpack_require__.d(__webpack_exports__, __rspack_reexport);
103
133
  var _parser_document_format__rspack_import_5 = __webpack_require__("./parser/document-format");
104
134
  var __rspack_reexport = {};
105
- for(const __rspack_import_key in _parser_document_format__rspack_import_5)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_parser_document_format__rspack_import_5[__rspack_import_key];
135
+ for(const __rspack_import_key in _parser_document_format__rspack_import_5)if ([
136
+ "default",
137
+ "sumTestRunReportMetrics",
138
+ "collectTestRunReportMetrics"
139
+ ].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_parser_document_format__rspack_import_5[__rspack_import_key];
106
140
  __webpack_require__.d(__webpack_exports__, __rspack_reexport);
107
141
  var _parser_types__rspack_import_6 = __webpack_require__("./parser/types");
108
142
  var __rspack_reexport = {};
109
- for(const __rspack_import_key in _parser_types__rspack_import_6)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_parser_types__rspack_import_6[__rspack_import_key];
143
+ for(const __rspack_import_key in _parser_types__rspack_import_6)if ([
144
+ "default",
145
+ "sumTestRunReportMetrics",
146
+ "collectTestRunReportMetrics"
147
+ ].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_parser_types__rspack_import_6[__rspack_import_key];
110
148
  __webpack_require__.d(__webpack_exports__, __rspack_reexport);
111
149
  var _project__rspack_import_7 = __webpack_require__("./project");
112
150
  var __rspack_reexport = {};
113
- for(const __rspack_import_key in _project__rspack_import_7)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_project__rspack_import_7[__rspack_import_key];
151
+ for(const __rspack_import_key in _project__rspack_import_7)if ([
152
+ "default",
153
+ "sumTestRunReportMetrics",
154
+ "collectTestRunReportMetrics"
155
+ ].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_project__rspack_import_7[__rspack_import_key];
114
156
  __webpack_require__.d(__webpack_exports__, __rspack_reexport);
115
157
  var _reporting_types__rspack_import_8 = __webpack_require__("./reporting/types");
116
158
  var __rspack_reexport = {};
117
- for(const __rspack_import_key in _reporting_types__rspack_import_8)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_reporting_types__rspack_import_8[__rspack_import_key];
159
+ for(const __rspack_import_key in _reporting_types__rspack_import_8)if ([
160
+ "default",
161
+ "sumTestRunReportMetrics",
162
+ "collectTestRunReportMetrics"
163
+ ].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_reporting_types__rspack_import_8[__rspack_import_key];
164
+ __webpack_require__.d(__webpack_exports__, __rspack_reexport);
165
+ var _reporting_test_plan__rspack_import_9 = __webpack_require__("./reporting/test-plan");
166
+ var __rspack_reexport = {};
167
+ for(const __rspack_import_key in _reporting_test_plan__rspack_import_9)if ([
168
+ "default",
169
+ "sumTestRunReportMetrics",
170
+ "collectTestRunReportMetrics"
171
+ ].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_reporting_test_plan__rspack_import_9[__rspack_import_key];
118
172
  __webpack_require__.d(__webpack_exports__, __rspack_reexport);
119
- var _reporting_sanitize__rspack_import_9 = __webpack_require__("./reporting/sanitize");
173
+ var _reporting_sanitize__rspack_import_10 = __webpack_require__("./reporting/sanitize");
120
174
  var __rspack_reexport = {};
121
- for(const __rspack_import_key in _reporting_sanitize__rspack_import_9)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_reporting_sanitize__rspack_import_9[__rspack_import_key];
175
+ for(const __rspack_import_key in _reporting_sanitize__rspack_import_10)if ([
176
+ "default",
177
+ "sumTestRunReportMetrics",
178
+ "collectTestRunReportMetrics"
179
+ ].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_reporting_sanitize__rspack_import_10[__rspack_import_key];
122
180
  __webpack_require__.d(__webpack_exports__, __rspack_reexport);
123
- var _reporting_test_run_report__rspack_import_10 = __webpack_require__("./reporting/test-run-report");
181
+ var _reporting_test_run_report__rspack_import_11 = __webpack_require__("./reporting/test-run-report");
124
182
  var __rspack_reexport = {};
125
- for(const __rspack_import_key in _reporting_test_run_report__rspack_import_10)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_reporting_test_run_report__rspack_import_10[__rspack_import_key];
183
+ for(const __rspack_import_key in _reporting_test_run_report__rspack_import_11)if ([
184
+ "default",
185
+ "sumTestRunReportMetrics",
186
+ "collectTestRunReportMetrics"
187
+ ].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_reporting_test_run_report__rspack_import_11[__rspack_import_key];
126
188
  __webpack_require__.d(__webpack_exports__, __rspack_reexport);
127
- var _reporting_execution_record__rspack_import_11 = __webpack_require__("./reporting/execution-record");
189
+ var _reporting_metrics__rspack_import_12 = __webpack_require__("./reporting/metrics");
190
+ var _reporting_execution_record__rspack_import_13 = __webpack_require__("./reporting/execution-record");
128
191
  var __rspack_reexport = {};
129
- for(const __rspack_import_key in _reporting_execution_record__rspack_import_11)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_reporting_execution_record__rspack_import_11[__rspack_import_key];
192
+ for(const __rspack_import_key in _reporting_execution_record__rspack_import_13)if ([
193
+ "default",
194
+ "sumTestRunReportMetrics",
195
+ "collectTestRunReportMetrics"
196
+ ].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_reporting_execution_record__rspack_import_13[__rspack_import_key];
130
197
  __webpack_require__.d(__webpack_exports__, __rspack_reexport);
131
198
  })();
132
- for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
199
+ exports.collectTestRunReportMetrics = __webpack_exports__.collectTestRunReportMetrics;
200
+ exports.sumTestRunReportMetrics = __webpack_exports__.sumTestRunReportMetrics;
201
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
202
+ "collectTestRunReportMetrics",
203
+ "sumTestRunReportMetrics"
204
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
133
205
  Object.defineProperty(exports, '__esModule', {
134
206
  value: true
135
207
  });
@@ -1 +1 @@
1
- {"version":3,"file":"test-runner/index.js","sources":["webpack/runtime/compat_get_default_export","webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object"],"sourcesContent":["// getDefaultExport function for compatibility with non-ESM modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};\n","__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};"],"names":["__webpack_require__","module","getter","definition","key","Object","obj","prop","Symbol"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IACAA,oBAAoB,CAAC,GAAG,CAACC;QACxB,IAAIC,SAASD,UAAUA,OAAO,UAAU,GACvC,IAAOA,MAAM,CAAC,UAAU,GACxB,IAAOA;QACRD,oBAAoB,CAAC,CAACE,QAAQ;YAAE,GAAGA;QAAO;QAC1C,OAAOA;IACR;;;ICPAF,oBAAoB,CAAC,GAAG,CAAC,UAASG;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGH,oBAAoB,CAAC,CAACG,YAAYC,QAAQ,CAACJ,oBAAoB,CAAC,CAAC,UAASI,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAJ,oBAAoB,CAAC,GAAG,CAACM,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFP,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,eAAlB,OAAOQ,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D"}
1
+ {"version":3,"file":"test-runner/index.js","sources":["webpack/runtime/compat_get_default_export","webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object"],"sourcesContent":["// getDefaultExport function for compatibility with non-ESM modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};\n","__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};"],"names":["__webpack_require__","module","getter","definition","key","Object","obj","prop","Symbol"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IACAA,oBAAoB,CAAC,GAAG,CAACC;QACxB,IAAIC,SAASD,UAAUA,OAAO,UAAU,GACvC,IAAOA,MAAM,CAAC,UAAU,GACxB,IAAOA;QACRD,oBAAoB,CAAC,CAACE,QAAQ;YAAE,GAAGA;QAAO;QAC1C,OAAOA;IACR;;;ICPAF,oBAAoB,CAAC,GAAG,CAAC,UAASG;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGH,oBAAoB,CAAC,CAACG,YAAYC,QAAQ,CAACJ,oBAAoB,CAAC,CAAC,UAASI,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAJ,oBAAoB,CAAC,GAAG,CAACM,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFP,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,eAAlB,OAAOQ,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D"}
@@ -3,7 +3,7 @@ var __webpack_modules__ = {
3
3
  "./define-node" (module) {
4
4
  module.exports = require("./define-node.js");
5
5
  },
6
- "@/types" (module) {
6
+ "./types" (module) {
7
7
  module.exports = require("./types.js");
8
8
  }
9
9
  };
@@ -54,7 +54,7 @@ var __webpack_exports__ = {};
54
54
  var __rspack_reexport = {};
55
55
  for(const __rspack_import_key in _define_node__rspack_import_0)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_define_node__rspack_import_0[__rspack_import_key];
56
56
  __webpack_require__.d(__webpack_exports__, __rspack_reexport);
57
- var _types__rspack_import_1 = __webpack_require__("@/types");
57
+ var _types__rspack_import_1 = __webpack_require__("./types");
58
58
  var __rspack_reexport = {};
59
59
  for(const __rspack_import_key in _types__rspack_import_1)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_types__rspack_import_1[__rspack_import_key];
60
60
  __webpack_require__.d(__webpack_exports__, __rspack_reexport);
@@ -26,10 +26,9 @@ __webpack_require__.r(__webpack_exports__);
26
26
  __webpack_require__.d(__webpack_exports__, {
27
27
  buildAgentTestRunReportDump: ()=>buildAgentTestRunReportDump
28
28
  });
29
- const external_report_stats_js_namespaceObject = require("../../report-stats.js");
29
+ const external_metrics_js_namespaceObject = require("./metrics.js");
30
30
  const external_test_run_report_js_namespaceObject = require("./test-run-report.js");
31
31
  function buildAgentTestRunReportDump(input, agentDump, source) {
32
- const summary = (0, external_report_stats_js_namespaceObject.collectReportSummary)(agentDump);
33
32
  return (0, external_test_run_report_js_namespaceObject.buildTestRunReportDump)(input, {
34
33
  sources: agentDump.executions.length ? [
35
34
  {
@@ -39,11 +38,7 @@ function buildAgentTestRunReportDump(input, agentDump, source) {
39
38
  ] : [])
40
39
  }
41
40
  ] : [],
42
- metrics: {
43
- modelCallCount: summary.timing.modelCallCount,
44
- modelTimeMs: summary.timing.modelCallTimeMs,
45
- ...summary.tokens
46
- }
41
+ metrics: (0, external_metrics_js_namespaceObject.collectTestRunReportMetrics)(agentDump)
47
42
  });
48
43
  }
49
44
  exports.buildAgentTestRunReportDump = __webpack_exports__.buildAgentTestRunReportDump;
@@ -1 +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"}
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 type { TestRunReportDump } from '../../test-run-report';\nimport type { ReportActionDump } from '../../types';\nimport { collectTestRunReportMetrics } from './metrics';\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 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: collectTestRunReportMetrics(agentDump),\n });\n}\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","buildAgentTestRunReportDump","input","agentDump","source","buildTestRunReportDump","execution","collectTestRunReportMetrics"],"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,OAAOC,AAAAA,IAAAA,4CAAAA,sBAAAA,AAAAA,EAAuBH,OAAO;QACnC,SAASC,UAAU,UAAU,CAAC,MAAM,GAChC;YACE;gBACE,GAAGC,MAAM;gBACT,cAAcD,UAAU,UAAU,CAAC,OAAO,CAAC,CAACG,YAC1CA,UAAU,EAAE,GAAG;wBAACA,UAAU,EAAE;qBAAC,GAAG,EAAE;YAEtC;SACD,GACD,EAAE;QACN,SAASC,AAAAA,IAAAA,oCAAAA,2BAAAA,AAAAA,EAA4BJ;IACvC;AACF"}