@midscene/core 1.12.10-beta-20260920031616.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/agent/agent.mjs +103 -6
- package/dist/es/agent/agent.mjs.map +1 -1
- package/dist/es/agent/index.mjs +4 -3
- package/dist/es/agent/tasks.mjs +2 -2
- package/dist/es/agent/tasks.mjs.map +1 -1
- package/dist/es/agent/test-runner-nodes.mjs +291 -40
- package/dist/es/agent/test-runner-nodes.mjs.map +1 -1
- package/dist/es/agent/utils.mjs +1 -1
- package/dist/es/device/index.mjs +15 -2
- package/dist/es/device/index.mjs.map +1 -1
- package/dist/es/dump/html-utils.mjs +37 -4
- package/dist/es/dump/html-utils.mjs.map +1 -1
- package/dist/es/dump/screenshot-store.mjs +8 -1
- package/dist/es/dump/screenshot-store.mjs.map +1 -1
- package/dist/es/report-cli.mjs +9 -4
- package/dist/es/report-cli.mjs.map +1 -1
- package/dist/es/report-generator.mjs +117 -4
- package/dist/es/report-generator.mjs.map +1 -1
- package/dist/es/report-html-template.mjs +1 -1
- package/dist/es/report.mjs +190 -41
- package/dist/es/report.mjs.map +1 -1
- package/dist/es/test-run-report.mjs.map +1 -1
- package/dist/es/test-runner/engine/case-runner.mjs +52 -0
- package/dist/es/test-runner/engine/case-runner.mjs.map +1 -0
- package/dist/es/test-runner/engine/document-runtime.mjs +273 -0
- package/dist/es/test-runner/engine/document-runtime.mjs.map +1 -0
- package/dist/es/test-runner/engine/execute-step.mjs +177 -0
- package/dist/es/test-runner/engine/execute-step.mjs.map +1 -0
- package/dist/es/test-runner/engine/execution-failure.mjs +39 -0
- package/dist/es/test-runner/engine/execution-failure.mjs.map +1 -0
- package/dist/es/test-runner/engine/index.mjs +12 -0
- package/dist/es/test-runner/engine/project-runtime.mjs +142 -0
- package/dist/es/test-runner/engine/project-runtime.mjs.map +1 -0
- package/dist/es/test-runner/engine/registry.mjs +61 -0
- package/dist/es/test-runner/engine/registry.mjs.map +1 -0
- package/dist/es/test-runner/engine/resource-operations.mjs +211 -0
- package/dist/es/test-runner/engine/resource-operations.mjs.map +1 -0
- package/dist/es/test-runner/engine/run-collected-case.mjs +193 -0
- package/dist/es/test-runner/engine/run-collected-case.mjs.map +1 -0
- package/dist/es/test-runner/engine/run-workflow-document.mjs +155 -0
- package/dist/es/test-runner/engine/run-workflow-document.mjs.map +1 -0
- package/dist/es/test-runner/engine/scheduler.mjs +27 -0
- package/dist/es/test-runner/engine/scheduler.mjs.map +1 -0
- package/dist/es/test-runner/engine/scope-teardown.mjs +16 -0
- package/dist/es/test-runner/engine/scope-teardown.mjs.map +1 -0
- package/dist/es/test-runner/engine/types.mjs +0 -0
- package/dist/es/test-runner/errors.mjs +201 -0
- package/dist/es/test-runner/errors.mjs.map +1 -0
- package/dist/es/test-runner/execution-record.mjs +83 -0
- package/dist/es/test-runner/execution-record.mjs.map +1 -0
- package/dist/es/test-runner/index.mjs +12 -0
- package/dist/es/test-runner/node/define-node.mjs +44 -0
- package/dist/es/test-runner/node/define-node.mjs.map +1 -0
- package/dist/es/test-runner/node/index.mjs +2 -0
- package/dist/es/test-runner/node/types.mjs +0 -0
- package/dist/es/test-runner/parser/document-format.mjs +21 -0
- package/dist/es/test-runner/parser/document-format.mjs.map +1 -0
- package/dist/es/test-runner/parser/normalize.mjs +87 -0
- package/dist/es/test-runner/parser/normalize.mjs.map +1 -0
- package/dist/es/test-runner/parser/types.mjs +0 -0
- package/dist/es/test-runner/project.mjs +0 -0
- package/dist/es/test-runner/reporting/agent-report.mjs +23 -0
- package/dist/es/test-runner/reporting/agent-report.mjs.map +1 -0
- package/dist/es/test-runner/reporting/execution-record.mjs +73 -0
- package/dist/es/test-runner/reporting/execution-record.mjs.map +1 -0
- package/dist/es/test-runner/reporting/merge-report.mjs +231 -0
- package/dist/es/test-runner/reporting/merge-report.mjs.map +1 -0
- package/dist/es/test-runner/reporting/sanitize.mjs +162 -0
- package/dist/es/test-runner/reporting/sanitize.mjs.map +1 -0
- package/dist/es/test-runner/reporting/test-run-report.mjs +327 -0
- package/dist/es/test-runner/reporting/test-run-report.mjs.map +1 -0
- package/dist/es/test-runner/reporting/types.mjs +0 -0
- package/dist/es/utils.mjs +1 -1
- package/dist/es/yaml/execution-context.node.mjs +6 -0
- package/dist/es/yaml/execution-context.node.mjs.map +1 -0
- package/dist/es/yaml/execution-context.stub.mjs +8 -0
- package/dist/es/yaml/execution-context.stub.mjs.map +1 -0
- package/dist/es/yaml/execution-session.mjs +90 -0
- package/dist/es/yaml/execution-session.mjs.map +1 -0
- package/dist/es/yaml/index.mjs +2 -1
- package/dist/es/yaml/legacy-yaml-execution-record.mjs +47 -0
- package/dist/es/yaml/legacy-yaml-execution-record.mjs.map +1 -0
- package/dist/es/yaml/legacy-yaml-report.mjs +52 -0
- package/dist/es/yaml/legacy-yaml-report.mjs.map +1 -0
- package/dist/es/yaml/legacy-yaml-runtime.mjs +119 -0
- package/dist/es/yaml/legacy-yaml-runtime.mjs.map +1 -0
- package/dist/es/yaml/player-state.mjs +15 -0
- package/dist/es/yaml/player-state.mjs.map +1 -0
- package/dist/es/yaml/player.mjs +214 -348
- package/dist/es/yaml/player.mjs.map +1 -1
- package/dist/es/yaml/report-policy.mjs +7 -0
- package/dist/es/yaml/report-policy.mjs.map +1 -0
- package/dist/es/yaml/test-runner-compat.mjs +301 -0
- package/dist/es/yaml/test-runner-compat.mjs.map +1 -0
- package/dist/es/yaml/test-runner-nodes.mjs +147 -0
- package/dist/es/yaml/test-runner-nodes.mjs.map +1 -0
- package/dist/es/yaml/utils.mjs +12 -1
- package/dist/es/yaml/utils.mjs.map +1 -1
- package/dist/es/yaml-runtime.mjs +7 -0
- package/dist/es/yaml.mjs.map +1 -1
- package/dist/lib/agent/agent.js +103 -6
- package/dist/lib/agent/agent.js.map +1 -1
- package/dist/lib/agent/index.js +37 -3
- package/dist/lib/agent/tasks.js +2 -2
- package/dist/lib/agent/tasks.js.map +1 -1
- package/dist/lib/agent/test-runner-nodes.js +329 -45
- package/dist/lib/agent/test-runner-nodes.js.map +1 -1
- package/dist/lib/agent/utils.js +1 -1
- package/dist/lib/device/index.js +15 -2
- package/dist/lib/device/index.js.map +1 -1
- package/dist/lib/dump/html-utils.js +43 -4
- package/dist/lib/dump/html-utils.js.map +1 -1
- package/dist/lib/dump/screenshot-store.js +8 -1
- package/dist/lib/dump/screenshot-store.js.map +1 -1
- package/dist/lib/report-cli.js +8 -3
- package/dist/lib/report-cli.js.map +1 -1
- package/dist/lib/report-generator.js +114 -1
- package/dist/lib/report-generator.js.map +1 -1
- package/dist/lib/report-html-template.js +1 -1
- package/dist/lib/report.js +187 -38
- package/dist/lib/report.js.map +1 -1
- package/dist/lib/test-run-report.js.map +1 -1
- package/dist/lib/test-runner/engine/case-runner.js +89 -0
- package/dist/lib/test-runner/engine/case-runner.js.map +1 -0
- package/dist/lib/test-runner/engine/document-runtime.js +307 -0
- package/dist/lib/test-runner/engine/document-runtime.js.map +1 -0
- package/dist/lib/test-runner/engine/execute-step.js +211 -0
- package/dist/lib/test-runner/engine/execute-step.js.map +1 -0
- package/dist/lib/test-runner/engine/execution-failure.js +79 -0
- package/dist/lib/test-runner/engine/execution-failure.js.map +1 -0
- package/dist/lib/test-runner/engine/index.js +137 -0
- package/dist/lib/test-runner/engine/index.js.map +1 -0
- package/dist/lib/test-runner/engine/project-runtime.js +176 -0
- package/dist/lib/test-runner/engine/project-runtime.js.map +1 -0
- package/dist/lib/test-runner/engine/registry.js +95 -0
- package/dist/lib/test-runner/engine/registry.js.map +1 -0
- package/dist/lib/test-runner/engine/resource-operations.js +272 -0
- package/dist/lib/test-runner/engine/resource-operations.js.map +1 -0
- package/dist/lib/test-runner/engine/run-collected-case.js +227 -0
- package/dist/lib/test-runner/engine/run-collected-case.js.map +1 -0
- package/dist/lib/test-runner/engine/run-workflow-document.js +189 -0
- package/dist/lib/test-runner/engine/run-workflow-document.js.map +1 -0
- package/dist/lib/test-runner/engine/scheduler.js +64 -0
- package/dist/lib/test-runner/engine/scheduler.js.map +1 -0
- package/dist/lib/test-runner/engine/scope-teardown.js +50 -0
- package/dist/lib/test-runner/engine/scope-teardown.js.map +1 -0
- package/dist/lib/test-runner/engine/types.js +20 -0
- package/dist/lib/test-runner/engine/types.js.map +1 -0
- package/dist/lib/test-runner/errors.js +283 -0
- package/dist/lib/test-runner/errors.js.map +1 -0
- package/dist/lib/test-runner/execution-record.js +123 -0
- package/dist/lib/test-runner/execution-record.js.map +1 -0
- package/dist/lib/test-runner/index.js +137 -0
- package/dist/lib/test-runner/index.js.map +1 -0
- package/dist/lib/test-runner/node/define-node.js +78 -0
- package/dist/lib/test-runner/node/define-node.js.map +1 -0
- package/dist/lib/test-runner/node/index.js +67 -0
- package/dist/lib/test-runner/node/index.js.map +1 -0
- package/dist/lib/test-runner/node/types.js +20 -0
- package/dist/lib/test-runner/node/types.js.map +1 -0
- package/dist/lib/test-runner/parser/document-format.js +58 -0
- package/dist/lib/test-runner/parser/document-format.js.map +1 -0
- package/dist/lib/test-runner/parser/normalize.js +124 -0
- package/dist/lib/test-runner/parser/normalize.js.map +1 -0
- package/dist/lib/test-runner/parser/types.js +20 -0
- package/dist/lib/test-runner/parser/types.js.map +1 -0
- package/dist/lib/test-runner/project.js +20 -0
- package/dist/lib/test-runner/project.js.map +1 -0
- package/dist/lib/test-runner/reporting/agent-report.js +57 -0
- package/dist/lib/test-runner/reporting/agent-report.js.map +1 -0
- package/dist/lib/test-runner/reporting/execution-record.js +107 -0
- package/dist/lib/test-runner/reporting/execution-record.js.map +1 -0
- package/dist/lib/test-runner/reporting/merge-report.js +265 -0
- package/dist/lib/test-runner/reporting/merge-report.js.map +1 -0
- package/dist/lib/test-runner/reporting/sanitize.js +202 -0
- package/dist/lib/test-runner/reporting/sanitize.js.map +1 -0
- package/dist/lib/test-runner/reporting/test-run-report.js +364 -0
- package/dist/lib/test-runner/reporting/test-run-report.js.map +1 -0
- package/dist/lib/test-runner/reporting/types.js +20 -0
- package/dist/lib/test-runner/reporting/types.js.map +1 -0
- package/dist/lib/utils.js +1 -1
- package/dist/lib/yaml/execution-context.node.js +43 -0
- package/dist/lib/yaml/execution-context.node.js.map +1 -0
- package/dist/lib/yaml/execution-context.stub.js +45 -0
- package/dist/lib/yaml/execution-context.stub.js.map +1 -0
- package/dist/lib/yaml/execution-session.js +136 -0
- package/dist/lib/yaml/execution-session.js.map +1 -0
- package/dist/lib/yaml/index.js +49 -7
- package/dist/lib/yaml/legacy-yaml-execution-record.js +81 -0
- package/dist/lib/yaml/legacy-yaml-execution-record.js.map +1 -0
- package/dist/lib/yaml/legacy-yaml-report.js +86 -0
- package/dist/lib/yaml/legacy-yaml-report.js.map +1 -0
- package/dist/lib/yaml/legacy-yaml-runtime.js +156 -0
- package/dist/lib/yaml/legacy-yaml-runtime.js.map +1 -0
- package/dist/lib/yaml/player-state.js +52 -0
- package/dist/lib/yaml/player-state.js.map +1 -0
- package/dist/lib/yaml/player.js +213 -347
- package/dist/lib/yaml/player.js.map +1 -1
- package/dist/lib/yaml/report-policy.js +41 -0
- package/dist/lib/yaml/report-policy.js.map +1 -0
- package/dist/lib/yaml/test-runner-compat.js +344 -0
- package/dist/lib/yaml/test-runner-compat.js.map +1 -0
- package/dist/lib/yaml/test-runner-nodes.js +184 -0
- package/dist/lib/yaml/test-runner-nodes.js.map +1 -0
- package/dist/lib/yaml/utils.js +18 -1
- package/dist/lib/yaml/utils.js.map +1 -1
- package/dist/lib/yaml-runtime.js +67 -0
- package/dist/lib/yaml-runtime.js.map +1 -0
- package/dist/lib/yaml.js.map +1 -1
- package/dist/types/agent/agent.d.ts +14 -1
- package/dist/types/agent/agent.d.ts.map +1 -1
- package/dist/types/agent/index.d.ts +4 -3
- package/dist/types/agent/index.d.ts.map +1 -1
- package/dist/types/agent/tasks.d.ts +1 -1
- package/dist/types/agent/tasks.d.ts.map +1 -1
- package/dist/types/agent/test-runner-nodes.d.ts +226 -0
- package/dist/types/agent/test-runner-nodes.d.ts.map +1 -1
- package/dist/types/device/index.d.ts +1 -1
- package/dist/types/device/index.d.ts.map +1 -1
- package/dist/types/dump/html-utils.d.ts +4 -0
- package/dist/types/dump/html-utils.d.ts.map +1 -1
- package/dist/types/dump/screenshot-store.d.ts +2 -1
- package/dist/types/dump/screenshot-store.d.ts.map +1 -1
- package/dist/types/report-cli.d.ts.map +1 -1
- package/dist/types/report-generator.d.ts +10 -0
- package/dist/types/report-generator.d.ts.map +1 -1
- package/dist/types/report.d.ts +3 -1
- package/dist/types/report.d.ts.map +1 -1
- package/dist/types/test-run-report.d.ts +18 -2
- package/dist/types/test-run-report.d.ts.map +1 -1
- package/dist/types/test-runner/engine/case-runner.d.ts +13 -0
- package/dist/types/test-runner/engine/case-runner.d.ts.map +1 -0
- package/dist/types/test-runner/engine/document-runtime.d.ts +4 -0
- package/dist/types/test-runner/engine/document-runtime.d.ts.map +1 -0
- package/dist/types/test-runner/engine/execute-step.d.ts +17 -0
- package/dist/types/test-runner/engine/execute-step.d.ts.map +1 -0
- package/dist/types/test-runner/engine/execution-failure.d.ts +13 -0
- package/dist/types/test-runner/engine/execution-failure.d.ts.map +1 -0
- package/dist/types/test-runner/engine/index.d.ts +13 -0
- package/dist/types/test-runner/engine/index.d.ts.map +1 -0
- package/dist/types/test-runner/engine/project-runtime.d.ts +3 -0
- package/dist/types/test-runner/engine/project-runtime.d.ts.map +1 -0
- package/dist/types/test-runner/engine/registry.d.ts +12 -0
- package/dist/types/test-runner/engine/registry.d.ts.map +1 -0
- package/dist/types/test-runner/engine/resource-operations.d.ts +32 -0
- package/dist/types/test-runner/engine/resource-operations.d.ts.map +1 -0
- package/dist/types/test-runner/engine/run-collected-case.d.ts +4 -0
- package/dist/types/test-runner/engine/run-collected-case.d.ts.map +1 -0
- package/dist/types/test-runner/engine/run-workflow-document.d.ts +4 -0
- package/dist/types/test-runner/engine/run-workflow-document.d.ts.map +1 -0
- package/dist/types/test-runner/engine/scheduler.d.ts +12 -0
- package/dist/types/test-runner/engine/scheduler.d.ts.map +1 -0
- package/dist/types/test-runner/engine/scope-teardown.d.ts +3 -0
- package/dist/types/test-runner/engine/scope-teardown.d.ts.map +1 -0
- package/dist/types/test-runner/engine/types.d.ts +226 -0
- package/dist/types/test-runner/engine/types.d.ts.map +1 -0
- package/dist/types/test-runner/errors.d.ts +79 -0
- package/dist/types/test-runner/errors.d.ts.map +1 -0
- package/dist/types/test-runner/execution-record.d.ts +43 -0
- package/dist/types/test-runner/execution-record.d.ts.map +1 -0
- package/dist/types/test-runner/index.d.ts +20 -0
- package/dist/types/test-runner/index.d.ts.map +1 -0
- package/dist/types/test-runner/node/define-node.d.ts +4 -0
- package/dist/types/test-runner/node/define-node.d.ts.map +1 -0
- package/dist/types/test-runner/node/index.d.ts +3 -0
- package/dist/types/test-runner/node/index.d.ts.map +1 -0
- package/dist/types/test-runner/node/types.d.ts +66 -0
- package/dist/types/test-runner/node/types.d.ts.map +1 -0
- package/dist/types/test-runner/parser/document-format.d.ts +8 -0
- package/dist/types/test-runner/parser/document-format.d.ts.map +1 -0
- package/dist/types/test-runner/parser/normalize.d.ts +9 -0
- package/dist/types/test-runner/parser/normalize.d.ts.map +1 -0
- package/dist/types/test-runner/parser/types.d.ts +69 -0
- package/dist/types/test-runner/parser/types.d.ts.map +1 -0
- package/dist/types/test-runner/project.d.ts +75 -0
- package/dist/types/test-runner/project.d.ts.map +1 -0
- package/dist/types/test-runner/reporting/agent-report.d.ts +9 -0
- package/dist/types/test-runner/reporting/agent-report.d.ts.map +1 -0
- package/dist/types/test-runner/reporting/execution-record.d.ts +9 -0
- package/dist/types/test-runner/reporting/execution-record.d.ts.map +1 -0
- package/dist/types/test-runner/reporting/merge-report.d.ts +15 -0
- package/dist/types/test-runner/reporting/merge-report.d.ts.map +1 -0
- package/dist/types/test-runner/reporting/sanitize.d.ts +6 -0
- package/dist/types/test-runner/reporting/sanitize.d.ts.map +1 -0
- package/dist/types/test-runner/reporting/test-run-report.d.ts +5 -0
- package/dist/types/test-runner/reporting/test-run-report.d.ts.map +1 -0
- package/dist/types/test-runner/reporting/types.d.ts +34 -0
- package/dist/types/test-runner/reporting/types.d.ts.map +1 -0
- package/dist/types/yaml/execution-context.node.d.ts +4 -0
- package/dist/types/yaml/execution-context.node.d.ts.map +1 -0
- package/dist/types/yaml/execution-context.stub.d.ts +6 -0
- package/dist/types/yaml/execution-context.stub.d.ts.map +1 -0
- package/dist/types/yaml/execution-session.d.ts +17 -0
- package/dist/types/yaml/execution-session.d.ts.map +1 -0
- package/dist/types/yaml/index.d.ts +1 -1
- package/dist/types/yaml/index.d.ts.map +1 -1
- package/dist/types/yaml/legacy-yaml-execution-record.d.ts +24 -0
- package/dist/types/yaml/legacy-yaml-execution-record.d.ts.map +1 -0
- package/dist/types/yaml/legacy-yaml-report.d.ts +19 -0
- package/dist/types/yaml/legacy-yaml-report.d.ts.map +1 -0
- package/dist/types/yaml/legacy-yaml-runtime.d.ts +23 -0
- package/dist/types/yaml/legacy-yaml-runtime.d.ts.map +1 -0
- package/dist/types/yaml/player-state.d.ts +11 -0
- package/dist/types/yaml/player-state.d.ts.map +1 -0
- package/dist/types/yaml/player.d.ts +11 -3
- package/dist/types/yaml/player.d.ts.map +1 -1
- package/dist/types/yaml/report-policy.d.ts +4 -0
- package/dist/types/yaml/report-policy.d.ts.map +1 -0
- package/dist/types/yaml/test-runner-compat.d.ts +17 -0
- package/dist/types/yaml/test-runner-compat.d.ts.map +1 -0
- package/dist/types/yaml/test-runner-nodes.d.ts +6 -0
- package/dist/types/yaml/test-runner-nodes.d.ts.map +1 -0
- package/dist/types/yaml/utils.d.ts +9 -0
- package/dist/types/yaml/utils.d.ts.map +1 -1
- package/dist/types/yaml-runtime.d.ts +13 -0
- package/dist/types/yaml-runtime.d.ts.map +1 -0
- package/dist/types/yaml.d.ts +25 -7
- package/dist/types/yaml.d.ts.map +1 -1
- package/package.json +28 -2
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
legacyYamlOutcomeError: ()=>legacyYamlOutcomeError,
|
|
28
|
+
createLegacyYamlRuntime: ()=>createLegacyYamlRuntime
|
|
29
|
+
});
|
|
30
|
+
const task_status_js_namespaceObject = require("../dump/task-status.js");
|
|
31
|
+
const logger_namespaceObject = require("@midscene/shared/logger");
|
|
32
|
+
const utils_namespaceObject = require("@midscene/shared/utils");
|
|
33
|
+
const index_js_namespaceObject = require("../test-runner/index.js");
|
|
34
|
+
const external_execution_session_js_namespaceObject = require("./execution-session.js");
|
|
35
|
+
const external_test_runner_compat_js_namespaceObject = require("./test-runner-compat.js");
|
|
36
|
+
const external_test_runner_nodes_js_namespaceObject = require("./test-runner-nodes.js");
|
|
37
|
+
const debug = (0, logger_namespaceObject.getDebug)('yaml-player');
|
|
38
|
+
const hasFailedReportExecutionSince = (agent, executionCountBefore)=>'failed' === (0, task_status_js_namespaceObject.deriveCaseStatus)((agent.dump?.executions ?? []).slice(executionCountBefore));
|
|
39
|
+
const recordYamlTaskError = async (agent, task, flowItemIndex, error)=>{
|
|
40
|
+
const recordErrorToReport = agent.recordErrorToReport;
|
|
41
|
+
if ('function' != typeof recordErrorToReport) return;
|
|
42
|
+
try {
|
|
43
|
+
await recordErrorToReport.call(agent, `YAML task failed - ${task.name}`, {
|
|
44
|
+
error,
|
|
45
|
+
content: `Step ${flowItemIndex} failed while running YAML task "${task.name}".`
|
|
46
|
+
});
|
|
47
|
+
} catch (reportError) {
|
|
48
|
+
debug('failed to record yaml error to report', reportError);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const createLegacyYamlNodeResolver = (options, resolveTask, recordTaskErrors, captureReportTraces)=>{
|
|
52
|
+
const definitions = new Map(external_test_runner_nodes_js_namespaceObject.legacyAgentTestRunnerNodeDefinitions.map((definition)=>[
|
|
53
|
+
definition.name,
|
|
54
|
+
definition
|
|
55
|
+
]));
|
|
56
|
+
const nodes = new Map();
|
|
57
|
+
return (name)=>{
|
|
58
|
+
const existing = nodes.get(name);
|
|
59
|
+
if (existing) return existing;
|
|
60
|
+
const definition = definitions.get(name);
|
|
61
|
+
(0, utils_namespaceObject.assert)(definition, `Unknown Agent Node: ${name}`);
|
|
62
|
+
const node = (0, index_js_namespaceObject.defineNode)({
|
|
63
|
+
name,
|
|
64
|
+
inputSchema: definition.inputSchema,
|
|
65
|
+
execute: (ctx)=>(0, external_execution_session_js_namespaceObject.runInYamlExecutionContext)(async ()=>{
|
|
66
|
+
ctx.signal.throwIfAborted();
|
|
67
|
+
(0, index_js_namespaceObject.assertResourceAvailable)(options.agent, false, ctx.signal);
|
|
68
|
+
(0, utils_namespaceObject.assert)('case' === ctx.scope, 'YAML task requires a Case scope');
|
|
69
|
+
const taskIndex = ctx.case.caseIndex;
|
|
70
|
+
const flowItemIndex = ctx.case.stepIndex;
|
|
71
|
+
const task = resolveTask(taskIndex);
|
|
72
|
+
(0, utils_namespaceObject.assert)(task, `missing YAML task at index ${taskIndex}`);
|
|
73
|
+
(0, utils_namespaceObject.assert)(task.flow, 'missing flow in task');
|
|
74
|
+
const executionCountBeforeStep = options.agent.dump?.executions?.length ?? 0;
|
|
75
|
+
const addDumpUpdateListener = captureReportTraces ? options.agent.addDumpUpdateListener : void 0;
|
|
76
|
+
const removeDumpListener = 'function' == typeof addDumpUpdateListener ? addDumpUpdateListener.call(options.agent, (_dump, execution)=>{
|
|
77
|
+
if (!ctx.signal.aborted && execution?.id) ctx.report.addTrace({
|
|
78
|
+
type: 'midscene-execution',
|
|
79
|
+
executionId: execution.id
|
|
80
|
+
});
|
|
81
|
+
}) : void 0;
|
|
82
|
+
let listening = true;
|
|
83
|
+
const removeListener = ()=>{
|
|
84
|
+
if (!listening) return;
|
|
85
|
+
listening = false;
|
|
86
|
+
removeDumpListener?.();
|
|
87
|
+
};
|
|
88
|
+
const operation = (0, index_js_namespaceObject.trackResourceOperation)(options.agent, Promise.resolve().then(()=>{
|
|
89
|
+
ctx.signal.throwIfAborted();
|
|
90
|
+
return definition.execute(options.agent, ctx.input, {
|
|
91
|
+
signal: ctx.signal
|
|
92
|
+
});
|
|
93
|
+
}), ctx.signal);
|
|
94
|
+
const leaveAction = (0, external_execution_session_js_namespaceObject.enterYamlAction)(options.agent, ctx.signal);
|
|
95
|
+
const onAbort = ()=>{
|
|
96
|
+
removeListener();
|
|
97
|
+
};
|
|
98
|
+
ctx.signal.addEventListener('abort', onAbort, {
|
|
99
|
+
once: true
|
|
100
|
+
});
|
|
101
|
+
try {
|
|
102
|
+
return await operation;
|
|
103
|
+
} catch (error) {
|
|
104
|
+
const reportAlreadyContainsFailure = hasFailedReportExecutionSince(options.agent, executionCountBeforeStep);
|
|
105
|
+
if (!ctx.signal.aborted && recordTaskErrors && !reportAlreadyContainsFailure) await recordYamlTaskError(options.agent, task, flowItemIndex, error);
|
|
106
|
+
throw error;
|
|
107
|
+
} finally{
|
|
108
|
+
ctx.signal.removeEventListener('abort', onAbort);
|
|
109
|
+
removeListener();
|
|
110
|
+
leaveAction();
|
|
111
|
+
}
|
|
112
|
+
})
|
|
113
|
+
});
|
|
114
|
+
nodes.set(name, node);
|
|
115
|
+
return node;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
const runLegacyYamlDocument = (document, options, resolveTask, recordTaskErrors, captureReportTraces, runOptions)=>(0, index_js_namespaceObject.runWorkflowDocument)(document, {
|
|
119
|
+
...runOptions ?? {},
|
|
120
|
+
onStepResult: async (info, result)=>{
|
|
121
|
+
if (result.meta.captureResult && result.output && Object.hasOwn(result.output, 'data')) await options.setResult(result.meta.resultName, (0, external_test_runner_nodes_js_namespaceObject.getLegacyYamlResultData)(result.node, result.output));
|
|
122
|
+
await runOptions?.onStepResult?.(info, result);
|
|
123
|
+
},
|
|
124
|
+
resolveNode: createLegacyYamlNodeResolver(options, resolveTask, recordTaskErrors, captureReportTraces),
|
|
125
|
+
projectContext: options.agent,
|
|
126
|
+
retry: 0,
|
|
127
|
+
resolveCaseReportScopeId: (_collectedCase, _attemptIndex, documentRunId)=>documentRunId
|
|
128
|
+
});
|
|
129
|
+
const createLegacyYamlRuntime = (options)=>{
|
|
130
|
+
const sourcePath = options.sourcePath ?? '<inline-yaml>';
|
|
131
|
+
return {
|
|
132
|
+
waitForIdle: ()=>(0, index_js_namespaceObject.waitForResourceIdle)(options.agent),
|
|
133
|
+
runScript: (script, runOptions)=>runLegacyYamlDocument(runOptions?.document ?? (0, external_test_runner_compat_js_namespaceObject.collectLegacyYamlDocument)(script, sourcePath, options.actionSpace), options, (taskIndex)=>script.tasks?.[taskIndex], true, true, runOptions),
|
|
134
|
+
runTask: (task, taskIndex, runOptions)=>runLegacyYamlDocument((0, external_test_runner_compat_js_namespaceObject.collectLegacyYamlTaskDocument)(task, taskIndex, sourcePath, options.actionSpace), options, ()=>task, false, false, runOptions)
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
const legacyYamlOutcomeError = (outcome)=>{
|
|
138
|
+
const failedStep = [
|
|
139
|
+
...outcome.run?.beforeEach ?? [],
|
|
140
|
+
...outcome.run?.steps ?? [],
|
|
141
|
+
...outcome.run?.afterEach ?? []
|
|
142
|
+
].find((step)=>'failed' === step.status);
|
|
143
|
+
const error = failedStep?.error;
|
|
144
|
+
return error?.code === 'NODE_EXECUTION_ERROR' && error.cause instanceof Error ? error.cause : error ?? new Error(`Task "${outcome.name}" failed`);
|
|
145
|
+
};
|
|
146
|
+
exports.createLegacyYamlRuntime = __webpack_exports__.createLegacyYamlRuntime;
|
|
147
|
+
exports.legacyYamlOutcomeError = __webpack_exports__.legacyYamlOutcomeError;
|
|
148
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
149
|
+
"createLegacyYamlRuntime",
|
|
150
|
+
"legacyYamlOutcomeError"
|
|
151
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
152
|
+
Object.defineProperty(exports, '__esModule', {
|
|
153
|
+
value: true
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
//# sourceMappingURL=legacy-yaml-runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"yaml/legacy-yaml-runtime.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../src/yaml/legacy-yaml-runtime.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 { Agent } from '@/agent/agent';\nimport { deriveCaseStatus } from '@/dump/task-status';\nimport type {\n DeviceAction,\n MidsceneYamlScript,\n MidsceneYamlTask,\n} from '@/types';\nimport { getDebug } from '@midscene/shared/logger';\nimport { assert } from '@midscene/shared/utils';\nimport {\n type CaseRunOutcome,\n type CollectedWorkflowDocument,\n type NodeDefinition,\n type RunWorkflowDocumentOptions,\n type WorkflowDocumentExecutionResult,\n assertResourceAvailable,\n defineNode,\n runWorkflowDocument,\n trackResourceOperation,\n waitForResourceIdle,\n} from '../test-runner';\nimport {\n enterYamlAction,\n runInYamlExecutionContext,\n} from './execution-session';\nimport {\n collectLegacyYamlDocument,\n collectLegacyYamlTaskDocument,\n} from './test-runner-compat';\nimport {\n getLegacyYamlResultData,\n legacyAgentTestRunnerNodeDefinitions,\n} from './test-runner-nodes';\nconst debug = getDebug('yaml-player');\n\ntype SetLegacyYamlResult = (\n key: string | undefined,\n value: any,\n) => void | Promise<void>;\n\nexport type LegacyYamlRuntimeRunOptions = Omit<\n RunWorkflowDocumentOptions<Agent>,\n 'projectContext' | 'resolveCaseReportScopeId' | 'resolveNode' | 'retry'\n> & { document?: CollectedWorkflowDocument };\n\nexport interface LegacyYamlRuntimeOptions {\n agent: Agent;\n actionSpace: readonly DeviceAction[];\n sourcePath?: string;\n setResult: SetLegacyYamlResult;\n}\n\nexport interface LegacyYamlRuntime {\n /** Wait before releasing an Agent whose non-cooperative action was aborted. */\n waitForIdle(): Promise<void>;\n runScript(\n script: MidsceneYamlScript,\n options?: LegacyYamlRuntimeRunOptions,\n ): Promise<WorkflowDocumentExecutionResult>;\n runTask(\n task: MidsceneYamlTask,\n taskIndex: number,\n options?: LegacyYamlRuntimeRunOptions,\n ): Promise<WorkflowDocumentExecutionResult>;\n}\n\nconst hasFailedReportExecutionSince = (\n agent: Agent,\n executionCountBefore: number,\n): boolean =>\n deriveCaseStatus(\n (agent.dump?.executions ?? []).slice(executionCountBefore),\n ) === 'failed';\n\nconst recordYamlTaskError = async (\n agent: Agent,\n task: MidsceneYamlTask,\n flowItemIndex: number,\n error: Error,\n): Promise<void> => {\n const recordErrorToReport = (agent as any).recordErrorToReport;\n if (typeof recordErrorToReport !== 'function') return;\n\n try {\n await recordErrorToReport.call(agent, `YAML task failed - ${task.name}`, {\n error,\n content: `Step ${flowItemIndex} failed while running YAML task \"${task.name}\".`,\n });\n } catch (reportError) {\n debug('failed to record yaml error to report', reportError);\n }\n};\n\nconst createLegacyYamlNodeResolver = (\n options: LegacyYamlRuntimeOptions,\n resolveTask: (taskIndex: number) => MidsceneYamlTask | undefined,\n recordTaskErrors: boolean,\n captureReportTraces: boolean,\n): ((\n name: string,\n) => NodeDefinition<Record<string, unknown>, unknown, Agent>) => {\n const definitions = new Map(\n legacyAgentTestRunnerNodeDefinitions.map((definition) => [\n definition.name,\n definition,\n ]),\n );\n const nodes = new Map<\n string,\n NodeDefinition<Record<string, unknown>, unknown, Agent>\n >();\n\n return (name) => {\n const existing = nodes.get(name);\n if (existing) return existing;\n\n const definition = definitions.get(name);\n assert(definition, `Unknown Agent Node: ${name}`);\n const node = defineNode<Record<string, unknown>, unknown, Agent>({\n name,\n inputSchema: definition.inputSchema,\n execute: (ctx) =>\n runInYamlExecutionContext(async () => {\n ctx.signal.throwIfAborted();\n assertResourceAvailable(options.agent, false, ctx.signal);\n assert(ctx.scope === 'case', 'YAML task requires a Case scope');\n const taskIndex = ctx.case.caseIndex;\n const flowItemIndex = ctx.case.stepIndex;\n const task = resolveTask(taskIndex);\n assert(task, `missing YAML task at index ${taskIndex}`);\n assert(task.flow, 'missing flow in task');\n\n const executionCountBeforeStep =\n options.agent.dump?.executions?.length ?? 0;\n const addDumpUpdateListener = captureReportTraces\n ? (options.agent as any).addDumpUpdateListener\n : undefined;\n const removeDumpListener =\n typeof addDumpUpdateListener === 'function'\n ? addDumpUpdateListener.call(\n options.agent,\n (_dump: string, execution?: { id?: string }) => {\n if (!ctx.signal.aborted && execution?.id) {\n ctx.report.addTrace({\n type: 'midscene-execution',\n executionId: execution.id,\n });\n }\n },\n )\n : undefined;\n\n let listening = true;\n const removeListener = () => {\n if (!listening) return;\n listening = false;\n removeDumpListener?.();\n };\n const operation = trackResourceOperation(\n options.agent,\n Promise.resolve().then(() => {\n ctx.signal.throwIfAborted();\n return definition.execute(options.agent, ctx.input, {\n signal: ctx.signal,\n });\n }),\n ctx.signal,\n );\n const leaveAction = enterYamlAction(options.agent, ctx.signal);\n const onAbort = () => {\n removeListener();\n };\n ctx.signal.addEventListener('abort', onAbort, { once: true });\n\n try {\n return await operation;\n } catch (error) {\n const reportAlreadyContainsFailure = hasFailedReportExecutionSince(\n options.agent,\n executionCountBeforeStep,\n );\n if (\n !ctx.signal.aborted &&\n recordTaskErrors &&\n !reportAlreadyContainsFailure\n ) {\n await recordYamlTaskError(\n options.agent,\n task,\n flowItemIndex,\n error as Error,\n );\n }\n throw error;\n } finally {\n ctx.signal.removeEventListener('abort', onAbort);\n removeListener();\n leaveAction();\n }\n }),\n });\n nodes.set(name, node);\n return node;\n };\n};\n\nconst runLegacyYamlDocument = (\n document: CollectedWorkflowDocument,\n options: LegacyYamlRuntimeOptions,\n resolveTask: (taskIndex: number) => MidsceneYamlTask | undefined,\n recordTaskErrors: boolean,\n captureReportTraces: boolean,\n runOptions?: LegacyYamlRuntimeRunOptions,\n): Promise<WorkflowDocumentExecutionResult> => {\n return runWorkflowDocument(document, {\n ...(runOptions ?? {}),\n onStepResult: async (info, result) => {\n if (\n result.meta.captureResult &&\n result.output &&\n Object.hasOwn(result.output, 'data')\n ) {\n // Publication follows the recorded action. The Node result is never mutated.\n await options.setResult(\n result.meta.resultName,\n getLegacyYamlResultData(result.node, result.output),\n );\n }\n await runOptions?.onStepResult?.(info, result);\n },\n resolveNode: createLegacyYamlNodeResolver(\n options,\n resolveTask,\n recordTaskErrors,\n captureReportTraces,\n ),\n projectContext: options.agent,\n // Legacy CLI retry recreates the whole player and Agent outside this\n // runtime, so the shared kernel must not retry a Case here.\n retry: 0,\n // One legacy YAML file owns one Agent report shared by all of its tasks.\n resolveCaseReportScopeId: (_collectedCase, _attemptIndex, documentRunId) =>\n documentRunId,\n });\n};\n\nexport const createLegacyYamlRuntime = (\n options: LegacyYamlRuntimeOptions,\n): LegacyYamlRuntime => {\n const sourcePath = options.sourcePath ?? '<inline-yaml>';\n return {\n waitForIdle: () => waitForResourceIdle(options.agent),\n runScript: (script, runOptions) =>\n runLegacyYamlDocument(\n runOptions?.document ??\n collectLegacyYamlDocument(script, sourcePath, options.actionSpace),\n options,\n (taskIndex) => script.tasks?.[taskIndex],\n true,\n true,\n runOptions,\n ),\n runTask: (task, taskIndex, runOptions) =>\n runLegacyYamlDocument(\n collectLegacyYamlTaskDocument(\n task,\n taskIndex,\n sourcePath,\n options.actionSpace,\n ),\n options,\n () => task,\n false,\n false,\n runOptions,\n ),\n };\n};\n\nexport const legacyYamlOutcomeError = (outcome: CaseRunOutcome): Error => {\n const failedStep = [\n ...(outcome.run?.beforeEach ?? []),\n ...(outcome.run?.steps ?? []),\n ...(outcome.run?.afterEach ?? []),\n ].find((step) => step.status === 'failed');\n const error = failedStep?.error;\n return error?.code === 'NODE_EXECUTION_ERROR' && error.cause instanceof Error\n ? error.cause\n : (error ?? new Error(`Task \"${outcome.name}\" failed`));\n};\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","debug","getDebug","hasFailedReportExecutionSince","agent","executionCountBefore","deriveCaseStatus","recordYamlTaskError","task","flowItemIndex","error","recordErrorToReport","reportError","createLegacyYamlNodeResolver","options","resolveTask","recordTaskErrors","captureReportTraces","definitions","Map","legacyAgentTestRunnerNodeDefinitions","nodes","name","existing","assert","node","defineNode","ctx","runInYamlExecutionContext","assertResourceAvailable","taskIndex","executionCountBeforeStep","addDumpUpdateListener","undefined","removeDumpListener","_dump","execution","listening","removeListener","operation","trackResourceOperation","Promise","leaveAction","enterYamlAction","onAbort","reportAlreadyContainsFailure","runLegacyYamlDocument","document","runOptions","runWorkflowDocument","info","result","getLegacyYamlResultData","_collectedCase","_attemptIndex","documentRunId","createLegacyYamlRuntime","sourcePath","waitForResourceIdle","script","collectLegacyYamlDocument","collectLegacyYamlTaskDocument","legacyYamlOutcomeError","outcome","failedStep","step","Error"],"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;;;;;;;;;;;;;;;AC2BA,MAAMI,QAAQC,AAAAA,IAAAA,uBAAAA,QAAAA,AAAAA,EAAS;AAiCvB,MAAMC,gCAAgC,CACpCC,OACAC,uBAEAC,AAEM,aAFNA,AAAAA,IAAAA,+BAAAA,gBAAAA,AAAAA,EACGF,AAAAA,CAAAA,MAAM,IAAI,EAAE,cAAc,EAAC,EAAG,KAAK,CAACC;AAGzC,MAAME,sBAAsB,OAC1BH,OACAI,MACAC,eACAC;IAEA,MAAMC,sBAAuBP,MAAc,mBAAmB;IAC9D,IAAI,AAA+B,cAA/B,OAAOO,qBAAoC;IAE/C,IAAI;QACF,MAAMA,oBAAoB,IAAI,CAACP,OAAO,CAAC,mBAAmB,EAAEI,KAAK,IAAI,EAAE,EAAE;YACvEE;YACA,SAAS,CAAC,KAAK,EAAED,cAAc,iCAAi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BAAyB,CAACC;IACrC,MAAMC,aAAa;WACbD,QAAQ,GAAG,EAAE,cAAc,EAAE;WAC7BA,QAAQ,GAAG,EAAE,SAAS,EAAE;WACxBA,QAAQ,GAAG,EAAE,aAAa,EAAE;KACjC,CAAC,IAAI,CAAC,CAACE,OAASA,AAAgB,aAAhBA,KAAK,MAAM;IAC5B,MAAMvD,QAAQsD,YAAY;IAC1B,OAAOtD,OAAO,SAAS,0BAA0BA,MAAM,KAAK,YAAYwD,QACpExD,MAAM,KAAK,GACVA,SAAS,IAAIwD,MAAM,CAAC,MAAM,EAAEH,QAAQ,IAAI,CAAC,QAAQ,CAAC;AACzD"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
getLegacyYamlPlayerState: ()=>getLegacyYamlPlayerState,
|
|
28
|
+
initializeLegacyYamlPlayerState: ()=>initializeLegacyYamlPlayerState
|
|
29
|
+
});
|
|
30
|
+
const stateKey = Symbol.for('@midscene/core/yaml-player-state/v1');
|
|
31
|
+
const host = globalThis;
|
|
32
|
+
host[stateKey] ??= new WeakMap();
|
|
33
|
+
const states = host[stateKey];
|
|
34
|
+
function initializeLegacyYamlPlayerState(player) {
|
|
35
|
+
states.set(player, {});
|
|
36
|
+
}
|
|
37
|
+
function getLegacyYamlPlayerState(player) {
|
|
38
|
+
const state = states.get(player);
|
|
39
|
+
if (!state) throw new Error('Expected an initialized YAML ScriptPlayer.');
|
|
40
|
+
return state;
|
|
41
|
+
}
|
|
42
|
+
exports.getLegacyYamlPlayerState = __webpack_exports__.getLegacyYamlPlayerState;
|
|
43
|
+
exports.initializeLegacyYamlPlayerState = __webpack_exports__.initializeLegacyYamlPlayerState;
|
|
44
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
45
|
+
"getLegacyYamlPlayerState",
|
|
46
|
+
"initializeLegacyYamlPlayerState"
|
|
47
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
48
|
+
Object.defineProperty(exports, '__esModule', {
|
|
49
|
+
value: true
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=player-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"yaml/player-state.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../src/yaml/player-state.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 WorkflowExecutionRecord,\n} from '../test-runner';\n\ninterface LegacyYamlPlayerState {\n executionResult?: WorkflowDocumentExecutionResult;\n executionRecord?: WorkflowExecutionRecord;\n fallbackReportFileName?: string;\n}\n\n// Hosts can load the public player through CJS and internal integration through ESM.\nconst stateKey = Symbol.for('@midscene/core/yaml-player-state/v1');\nconst host = globalThis as typeof globalThis & {\n [stateKey]?: WeakMap<object, LegacyYamlPlayerState>;\n};\nhost[stateKey] ??= new WeakMap();\nconst states = host[stateKey];\n\nexport function initializeLegacyYamlPlayerState(player: object): void {\n states.set(player, {});\n}\n\n/** Package integration only; do not expose host controls on ScriptPlayer. */\nexport function getLegacyYamlPlayerState(\n player: object,\n): LegacyYamlPlayerState {\n const state = states.get(player);\n if (!state) throw new Error('Expected an initialized YAML ScriptPlayer.');\n return state;\n}\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","stateKey","host","globalThis","WeakMap","states","initializeLegacyYamlPlayerState","player","getLegacyYamlPlayerState","state","Error"],"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;;;;;;;;ACMA,MAAMI,WAAWD,OAAO,GAAG,CAAC;AAC5B,MAAME,OAAOC;AAGbD,IAAI,CAACD,SAAS,KAAK,IAAIG;AACvB,MAAMC,SAASH,IAAI,CAACD,SAAS;AAEtB,SAASK,gCAAgCC,MAAc;IAC5DF,OAAO,GAAG,CAACE,QAAQ,CAAC;AACtB;AAGO,SAASC,yBACdD,MAAc;IAEd,MAAME,QAAQJ,OAAO,GAAG,CAACE;IACzB,IAAI,CAACE,OAAO,MAAM,IAAIC,MAAM;IAC5B,OAAOD;AACT"}
|