@midscene/core 1.16.0 → 1.16.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.
- package/dist/es/agent/agent-options.mjs +36 -0
- package/dist/es/agent/agent-options.mjs.map +1 -0
- package/dist/es/agent/agent-report-manager.mjs +323 -0
- package/dist/es/agent/agent-report-manager.mjs.map +1 -0
- package/dist/es/agent/agent.mjs +112 -228
- package/dist/es/agent/agent.mjs.map +1 -1
- package/dist/es/agent/cache-config.mjs +21 -1
- package/dist/es/agent/cache-config.mjs.map +1 -1
- package/dist/es/agent/tasks.mjs +3 -1
- package/dist/es/agent/tasks.mjs.map +1 -1
- package/dist/es/agent/utils.mjs +4 -4
- package/dist/es/agent/utils.mjs.map +1 -1
- package/dist/es/ai-model/models/auto-glm/parser.mjs +1 -1
- package/dist/es/ai-model/models/auto-glm/parser.mjs.map +1 -1
- package/dist/es/ai-model/models/kimi.mjs +1 -1
- package/dist/es/ai-model/models/kimi.mjs.map +1 -1
- package/dist/es/ai-model/service-caller/call-ai.mjs +10 -1
- package/dist/es/ai-model/service-caller/call-ai.mjs.map +1 -1
- package/dist/es/ai-model/service-caller/openai/call-openai.mjs +7 -2
- package/dist/es/ai-model/service-caller/openai/call-openai.mjs.map +1 -1
- package/dist/es/ai-model/shared/model-locate-result/errors.mjs +1 -1
- package/dist/es/ai-model/shared/model-locate-result/errors.mjs.map +1 -1
- package/dist/es/ai-model/shared/model-locate-result/parse.mjs +6 -2
- package/dist/es/ai-model/shared/model-locate-result/parse.mjs.map +1 -1
- package/dist/es/device/index.mjs +9 -8
- package/dist/es/device/index.mjs.map +1 -1
- package/dist/es/report-generator.mjs +76 -36
- package/dist/es/report-generator.mjs.map +1 -1
- package/dist/es/report-html-template.mjs +1 -1
- package/dist/es/test-run-report.mjs.map +1 -1
- package/dist/es/test-runner/engine/document-runtime.mjs +30 -24
- package/dist/es/test-runner/engine/document-runtime.mjs.map +1 -1
- package/dist/es/test-runner/engine/project-runtime.mjs +17 -11
- package/dist/es/test-runner/engine/project-runtime.mjs.map +1 -1
- package/dist/es/test-runner/engine/resource-operations.mjs +33 -8
- package/dist/es/test-runner/engine/resource-operations.mjs.map +1 -1
- package/dist/es/test-runner/engine/run-collected-case.mjs +1 -0
- package/dist/es/test-runner/engine/run-collected-case.mjs.map +1 -1
- package/dist/es/test-runner/engine/run-workflow-document.mjs +3 -0
- package/dist/es/test-runner/engine/run-workflow-document.mjs.map +1 -1
- package/dist/es/test-runner/engine/setup-timeout.mjs +37 -0
- package/dist/es/test-runner/engine/setup-timeout.mjs.map +1 -0
- package/dist/es/test-runner/reporting/merge-report.mjs +3 -1
- package/dist/es/test-runner/reporting/merge-report.mjs.map +1 -1
- package/dist/es/test-runner/reporting/metrics.mjs +39 -2
- package/dist/es/test-runner/reporting/metrics.mjs.map +1 -1
- package/dist/es/utils.mjs +1 -1
- package/dist/es/yaml/execution-session.mjs +2 -1
- package/dist/es/yaml/execution-session.mjs.map +1 -1
- package/dist/es/yaml/legacy-yaml-report.mjs +1 -1
- package/dist/es/yaml/legacy-yaml-report.mjs.map +1 -1
- package/dist/es/yaml/player.mjs +17 -3
- package/dist/es/yaml/player.mjs.map +1 -1
- package/dist/lib/agent/agent-options.js +73 -0
- package/dist/lib/agent/agent-options.js.map +1 -0
- package/dist/lib/agent/agent-report-manager.js +357 -0
- package/dist/lib/agent/agent-report-manager.js.map +1 -0
- package/dist/lib/agent/agent.js +110 -226
- package/dist/lib/agent/agent.js.map +1 -1
- package/dist/lib/agent/cache-config.js +23 -0
- package/dist/lib/agent/cache-config.js.map +1 -1
- package/dist/lib/agent/tasks.js +3 -1
- package/dist/lib/agent/tasks.js.map +1 -1
- package/dist/lib/agent/utils.js +2 -2
- package/dist/lib/agent/utils.js.map +1 -1
- package/dist/lib/ai-model/models/auto-glm/parser.js +1 -1
- package/dist/lib/ai-model/models/auto-glm/parser.js.map +1 -1
- package/dist/lib/ai-model/models/kimi.js +1 -1
- package/dist/lib/ai-model/models/kimi.js.map +1 -1
- package/dist/lib/ai-model/service-caller/call-ai.js +10 -1
- package/dist/lib/ai-model/service-caller/call-ai.js.map +1 -1
- package/dist/lib/ai-model/service-caller/openai/call-openai.js +7 -2
- package/dist/lib/ai-model/service-caller/openai/call-openai.js.map +1 -1
- package/dist/lib/ai-model/shared/model-locate-result/errors.js +1 -1
- package/dist/lib/ai-model/shared/model-locate-result/errors.js.map +1 -1
- package/dist/lib/ai-model/shared/model-locate-result/parse.js +6 -2
- package/dist/lib/ai-model/shared/model-locate-result/parse.js.map +1 -1
- package/dist/lib/device/index.js +9 -8
- package/dist/lib/device/index.js.map +1 -1
- package/dist/lib/report-generator.js +75 -35
- package/dist/lib/report-generator.js.map +1 -1
- package/dist/lib/report-html-template.js +1 -1
- package/dist/lib/test-run-report.js.map +1 -1
- package/dist/lib/test-runner/engine/document-runtime.js +30 -24
- package/dist/lib/test-runner/engine/document-runtime.js.map +1 -1
- package/dist/lib/test-runner/engine/project-runtime.js +17 -11
- package/dist/lib/test-runner/engine/project-runtime.js.map +1 -1
- package/dist/lib/test-runner/engine/resource-operations.js +36 -8
- package/dist/lib/test-runner/engine/resource-operations.js.map +1 -1
- package/dist/lib/test-runner/engine/run-collected-case.js +1 -0
- package/dist/lib/test-runner/engine/run-collected-case.js.map +1 -1
- package/dist/lib/test-runner/engine/run-workflow-document.js +3 -0
- package/dist/lib/test-runner/engine/run-workflow-document.js.map +1 -1
- package/dist/lib/test-runner/engine/setup-timeout.js +71 -0
- package/dist/lib/test-runner/engine/setup-timeout.js.map +1 -0
- package/dist/lib/test-runner/reporting/merge-report.js +3 -1
- package/dist/lib/test-runner/reporting/merge-report.js.map +1 -1
- package/dist/lib/test-runner/reporting/metrics.js +39 -2
- package/dist/lib/test-runner/reporting/metrics.js.map +1 -1
- package/dist/lib/utils.js +1 -1
- package/dist/lib/yaml/execution-session.js +4 -0
- package/dist/lib/yaml/execution-session.js.map +1 -1
- package/dist/lib/yaml/legacy-yaml-report.js +1 -1
- package/dist/lib/yaml/legacy-yaml-report.js.map +1 -1
- package/dist/lib/yaml/player.js +16 -2
- package/dist/lib/yaml/player.js.map +1 -1
- package/dist/types/agent/agent-options.d.ts +4 -0
- package/dist/types/agent/agent-options.d.ts.map +1 -0
- package/dist/types/agent/agent-report-manager.d.ts +92 -0
- package/dist/types/agent/agent-report-manager.d.ts.map +1 -0
- package/dist/types/agent/agent.d.ts +31 -24
- package/dist/types/agent/agent.d.ts.map +1 -1
- package/dist/types/agent/cache-config.d.ts +10 -0
- package/dist/types/agent/cache-config.d.ts.map +1 -1
- package/dist/types/agent/tasks.d.ts +1 -0
- package/dist/types/agent/tasks.d.ts.map +1 -1
- package/dist/types/ai-model/models/auto-glm/parser.d.ts.map +1 -1
- package/dist/types/ai-model/service-caller/openai/call-openai.d.ts.map +1 -1
- package/dist/types/ai-model/shared/model-locate-result/errors.d.ts +1 -1
- package/dist/types/ai-model/shared/model-locate-result/errors.d.ts.map +1 -1
- package/dist/types/ai-model/shared/model-locate-result/parse.d.ts.map +1 -1
- package/dist/types/device/index.d.ts +7 -7
- package/dist/types/device/index.d.ts.map +1 -1
- package/dist/types/report-generator.d.ts +5 -1
- package/dist/types/report-generator.d.ts.map +1 -1
- package/dist/types/test-run-report.d.ts +4 -1
- package/dist/types/test-run-report.d.ts.map +1 -1
- package/dist/types/test-runner/engine/document-runtime.d.ts.map +1 -1
- package/dist/types/test-runner/engine/project-runtime.d.ts.map +1 -1
- package/dist/types/test-runner/engine/resource-operations.d.ts +5 -0
- package/dist/types/test-runner/engine/resource-operations.d.ts.map +1 -1
- package/dist/types/test-runner/engine/run-collected-case.d.ts.map +1 -1
- package/dist/types/test-runner/engine/run-workflow-document.d.ts.map +1 -1
- package/dist/types/test-runner/engine/setup-timeout.d.ts +3 -0
- package/dist/types/test-runner/engine/setup-timeout.d.ts.map +1 -0
- package/dist/types/test-runner/engine/types.d.ts +7 -0
- package/dist/types/test-runner/engine/types.d.ts.map +1 -1
- package/dist/types/test-runner/parser/types.d.ts +5 -0
- package/dist/types/test-runner/parser/types.d.ts.map +1 -1
- package/dist/types/test-runner/project.d.ts +22 -0
- package/dist/types/test-runner/project.d.ts.map +1 -1
- package/dist/types/test-runner/reporting/merge-report.d.ts.map +1 -1
- package/dist/types/test-runner/reporting/metrics.d.ts.map +1 -1
- package/dist/types/yaml/execution-session.d.ts +2 -0
- package/dist/types/yaml/execution-session.d.ts.map +1 -1
- package/dist/types/yaml/player.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
withAgentDefaults: ()=>withAgentDefaults,
|
|
28
|
+
normalizeAgentOptions: ()=>normalizeAgentOptions
|
|
29
|
+
});
|
|
30
|
+
const agent_context_namespaceObject = require("@midscene/shared/agent-tools/agent-context");
|
|
31
|
+
const external_report_generator_js_namespaceObject = require("../report-generator.js");
|
|
32
|
+
function withAgentDefaults(opts) {
|
|
33
|
+
const options = Object.assign({
|
|
34
|
+
generateReport: true,
|
|
35
|
+
persistExecutionDump: false,
|
|
36
|
+
autoPrintReportMsg: true,
|
|
37
|
+
groupName: 'Midscene Report',
|
|
38
|
+
groupDescription: ''
|
|
39
|
+
}, opts || {});
|
|
40
|
+
(0, external_report_generator_js_namespaceObject.assertReportGenerationOptions)(options);
|
|
41
|
+
return options;
|
|
42
|
+
}
|
|
43
|
+
function normalizeAgentOptions(options, warn) {
|
|
44
|
+
if (void 0 !== options.aiContexts && ('object' != typeof options.aiContexts || null === options.aiContexts || Array.isArray(options.aiContexts))) throw new TypeError('opts.aiContexts must be a plain object');
|
|
45
|
+
for (const [key, value] of Object.entries(options.aiContexts ?? {})){
|
|
46
|
+
if (!(0, agent_context_namespaceObject.isAgentAIContextKey)(key)) throw new TypeError(`Unknown Agent context key: ${key}`);
|
|
47
|
+
if (void 0 !== value && 'string' != typeof value) throw new TypeError(`Agent context "${key}" must be a string`);
|
|
48
|
+
}
|
|
49
|
+
const deprecatedAiActContextOption = void 0 !== options.aiActContext ? 'aiActContext' : void 0 !== options.aiActionContext ? 'aiActionContext' : void 0;
|
|
50
|
+
if (deprecatedAiActContextOption) warn(`Agent option "${deprecatedAiActContextOption}" is deprecated; use "aiContexts.aiAct" instead. When both are provided, "aiContexts.aiAct" takes precedence.`);
|
|
51
|
+
const normalizedAIContexts = {
|
|
52
|
+
...options.aiContexts
|
|
53
|
+
};
|
|
54
|
+
const resolvedAiActContext = normalizedAIContexts.aiAct ?? options.aiActContext ?? options.aiActionContext;
|
|
55
|
+
if (void 0 !== resolvedAiActContext) {
|
|
56
|
+
normalizedAIContexts.aiAct = resolvedAiActContext;
|
|
57
|
+
options.aiActContext = resolvedAiActContext;
|
|
58
|
+
options.aiActionContext = resolvedAiActContext;
|
|
59
|
+
}
|
|
60
|
+
options.aiContexts = normalizedAIContexts;
|
|
61
|
+
if (options.modelConfig && ('object' != typeof options.modelConfig || Array.isArray(options.modelConfig))) throw new Error(`opts.modelConfig must be a plain object map of env keys to values, but got ${typeof options.modelConfig}`);
|
|
62
|
+
}
|
|
63
|
+
exports.normalizeAgentOptions = __webpack_exports__.normalizeAgentOptions;
|
|
64
|
+
exports.withAgentDefaults = __webpack_exports__.withAgentDefaults;
|
|
65
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
66
|
+
"normalizeAgentOptions",
|
|
67
|
+
"withAgentDefaults"
|
|
68
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
69
|
+
Object.defineProperty(exports, '__esModule', {
|
|
70
|
+
value: true
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
//# sourceMappingURL=agent-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent/agent-options.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../src/agent/agent-options.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 { isAgentAIContextKey } from '@midscene/shared/agent-tools/agent-context';\nimport { assertReportGenerationOptions } from '../report-generator';\nimport type { AgentAIContexts, AgentOpt } from '../types';\n\nexport function withAgentDefaults(opts?: AgentOpt): AgentOpt {\n const options = Object.assign(\n {\n generateReport: true,\n persistExecutionDump: false,\n autoPrintReportMsg: true,\n groupName: 'Midscene Report',\n groupDescription: '',\n },\n opts || {},\n );\n assertReportGenerationOptions(options);\n return options;\n}\n\nexport function normalizeAgentOptions(\n options: AgentOpt,\n warn: (message: string) => void,\n): void {\n if (\n options.aiContexts !== undefined &&\n (typeof options.aiContexts !== 'object' ||\n options.aiContexts === null ||\n Array.isArray(options.aiContexts))\n ) {\n throw new TypeError('opts.aiContexts must be a plain object');\n }\n\n for (const [key, value] of Object.entries(options.aiContexts ?? {})) {\n if (!isAgentAIContextKey(key)) {\n throw new TypeError(`Unknown Agent context key: ${key}`);\n }\n if (value !== undefined && typeof value !== 'string') {\n throw new TypeError(`Agent context \"${key}\" must be a string`);\n }\n }\n\n const deprecatedAiActContextOption =\n options.aiActContext !== undefined\n ? 'aiActContext'\n : options.aiActionContext !== undefined\n ? 'aiActionContext'\n : undefined;\n if (deprecatedAiActContextOption) {\n warn(\n `Agent option \"${deprecatedAiActContextOption}\" is deprecated; use \"aiContexts.aiAct\" instead. When both are provided, \"aiContexts.aiAct\" takes precedence.`,\n );\n }\n\n const normalizedAIContexts: AgentAIContexts = { ...options.aiContexts };\n const resolvedAiActContext =\n normalizedAIContexts.aiAct ??\n options.aiActContext ??\n options.aiActionContext;\n if (resolvedAiActContext !== undefined) {\n normalizedAIContexts.aiAct = resolvedAiActContext;\n options.aiActContext = resolvedAiActContext;\n options.aiActionContext = resolvedAiActContext;\n }\n options.aiContexts = normalizedAIContexts;\n\n if (\n options.modelConfig &&\n (typeof options.modelConfig !== 'object' ||\n Array.isArray(options.modelConfig))\n ) {\n throw new Error(\n `opts.modelConfig must be a plain object map of env keys to values, but got ${typeof options.modelConfig}`,\n );\n }\n}\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","withAgentDefaults","opts","options","assertReportGenerationOptions","normalizeAgentOptions","warn","undefined","Array","TypeError","value","isAgentAIContextKey","deprecatedAiActContextOption","normalizedAIContexts","resolvedAiActContext","Error"],"mappings":";;;IAAAA,oBAAoB,CAAC,GAAG,CAAC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VG,SAAuB,AAAiB,YAAjB,OAAOA,OAChC,MAAM,IAAID,UAAU,CAAC,eAAe,EAAEb,IAAI,kBAAkB,CAAC;IAEjE;IAEA,MAAMgB,+BACJT,AAAyBI,WAAzBJ,QAAQ,YAAY,GAChB,iBACAA,AAA4BI,WAA5BJ,QAAQ,eAAe,GACrB,oBACAI;IACR,IAAIK,8BACFN,KACE,CAAC,cAAc,EAAEM,6BAA6B,6GAA6G,CAAC;IAIhK,MAAMC,uBAAwC;QAAE,GAAGV,QAAQ,UAAU;IAAC;IACtE,MAAMW,uBACJD,qBAAqB,KAAK,IAC1BV,QAAQ,YAAY,IACpBA,QAAQ,eAAe;IACzB,IAAIW,AAAyBP,WAAzBO,sBAAoC;QACtCD,qBAAqB,KAAK,GAAGC;QAC7BX,QAAQ,YAAY,GAAGW;QACvBX,QAAQ,eAAe,GAAGW;IAC5B;IACAX,QAAQ,UAAU,GAAGU;IAErB,IACEV,QAAQ,WAAW,IAClB,CAA+B,YAA/B,OAAOA,QAAQ,WAAW,IACzBK,MAAM,OAAO,CAACL,QAAQ,WAAW,IAEnC,MAAM,IAAIY,MACR,CAAC,2EAA2E,EAAE,OAAOZ,QAAQ,WAAW,EAAE;AAGhH"}
|
|
@@ -0,0 +1,357 @@
|
|
|
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
|
+
AgentReportManager: ()=>AgentReportManager
|
|
28
|
+
});
|
|
29
|
+
const logger_namespaceObject = require("@midscene/shared/logger");
|
|
30
|
+
const utils_namespaceObject = require("@midscene/shared/utils");
|
|
31
|
+
const external_constants_js_namespaceObject = require("../constants.js");
|
|
32
|
+
const html_utils_js_namespaceObject = require("../dump/html-utils.js");
|
|
33
|
+
const external_report_generator_js_namespaceObject = require("../report-generator.js");
|
|
34
|
+
const errors_js_namespaceObject = require("../test-runner/errors.js");
|
|
35
|
+
const agent_report_js_namespaceObject = require("../test-runner/reporting/agent-report.js");
|
|
36
|
+
const execution_record_js_namespaceObject = require("../test-runner/reporting/execution-record.js");
|
|
37
|
+
const external_types_js_namespaceObject = require("../types.js");
|
|
38
|
+
const external_utils_js_namespaceObject = require("../utils.js");
|
|
39
|
+
const external_utils_js_namespaceObject_1 = require("./utils.js");
|
|
40
|
+
function _define_property(obj, key, value) {
|
|
41
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
42
|
+
value: value,
|
|
43
|
+
enumerable: true,
|
|
44
|
+
configurable: true,
|
|
45
|
+
writable: true
|
|
46
|
+
});
|
|
47
|
+
else obj[key] = value;
|
|
48
|
+
return obj;
|
|
49
|
+
}
|
|
50
|
+
const warn = (0, logger_namespaceObject.getDebug)('agent', {
|
|
51
|
+
console: true
|
|
52
|
+
});
|
|
53
|
+
class AgentReportManager {
|
|
54
|
+
get opts() {
|
|
55
|
+
return this.context.getOptions();
|
|
56
|
+
}
|
|
57
|
+
get dump() {
|
|
58
|
+
return this.reportState.dump;
|
|
59
|
+
}
|
|
60
|
+
set dump(value) {
|
|
61
|
+
this.reportState.dump = value;
|
|
62
|
+
}
|
|
63
|
+
get reportFile() {
|
|
64
|
+
return this.reportState.file;
|
|
65
|
+
}
|
|
66
|
+
set reportFile(value) {
|
|
67
|
+
this.reportState.file = value;
|
|
68
|
+
}
|
|
69
|
+
get reportFileName() {
|
|
70
|
+
return this.reportState.fileName;
|
|
71
|
+
}
|
|
72
|
+
set reportFileName(value) {
|
|
73
|
+
this.reportState.fileName = value;
|
|
74
|
+
}
|
|
75
|
+
_prepareForTestRunner() {
|
|
76
|
+
this.reportState.generator.enableSourceSnapshots?.();
|
|
77
|
+
}
|
|
78
|
+
async _createReportSource(scopeId, executionIds) {
|
|
79
|
+
return this.reportState.generator.createSourceSnapshot?.(scopeId, executionIds);
|
|
80
|
+
}
|
|
81
|
+
async _writeYamlExecutionReport(record) {
|
|
82
|
+
const report = this.reportState;
|
|
83
|
+
const existingIndex = report.yamlRecords.findIndex((entry)=>entry.runId === record.runId);
|
|
84
|
+
const recordIndex = existingIndex < 0 ? report.yamlRecords.length : existingIndex;
|
|
85
|
+
report.yamlRecords[recordIndex] = record;
|
|
86
|
+
try {
|
|
87
|
+
const path = await report.generator.writeRunnerReport?.(this.buildYamlReportInput(), report.yamlScopeId, this.getReportMeta());
|
|
88
|
+
report.file = path ?? report.file;
|
|
89
|
+
return path;
|
|
90
|
+
} catch (error) {
|
|
91
|
+
report.yamlRecords[recordIndex] = Object.freeze({
|
|
92
|
+
...record,
|
|
93
|
+
status: 'failed',
|
|
94
|
+
reportError: error
|
|
95
|
+
});
|
|
96
|
+
throw error;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
buildYamlReportInput() {
|
|
100
|
+
const scopedRecords = this.reportState.yamlRecords.map((entry)=>({
|
|
101
|
+
...entry,
|
|
102
|
+
...entry.execution ? {
|
|
103
|
+
execution: {
|
|
104
|
+
document: {
|
|
105
|
+
...entry.execution.document,
|
|
106
|
+
reportScopeId: this.reportState.yamlScopeId
|
|
107
|
+
},
|
|
108
|
+
cases: entry.execution.cases.map((outcome)=>({
|
|
109
|
+
...outcome,
|
|
110
|
+
...outcome.run ? {
|
|
111
|
+
run: {
|
|
112
|
+
...outcome.run,
|
|
113
|
+
reportScopeId: this.reportState.yamlScopeId
|
|
114
|
+
}
|
|
115
|
+
} : {},
|
|
116
|
+
...outcome.attempts ? {
|
|
117
|
+
attempts: outcome.attempts.map((attempt)=>({
|
|
118
|
+
...attempt,
|
|
119
|
+
reportScopeId: this.reportState.yamlScopeId
|
|
120
|
+
}))
|
|
121
|
+
} : {}
|
|
122
|
+
}))
|
|
123
|
+
}
|
|
124
|
+
} : {}
|
|
125
|
+
}));
|
|
126
|
+
return (0, execution_record_js_namespaceObject.executionRecordsToReportInput)(scopedRecords, {
|
|
127
|
+
runId: this.reportState.yamlScopeId
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
createEmptyDump() {
|
|
131
|
+
return new external_types_js_namespaceObject.ReportActionDump({
|
|
132
|
+
sdkVersion: (0, external_utils_js_namespaceObject.getVersion)(),
|
|
133
|
+
groupName: this.opts.groupName,
|
|
134
|
+
groupDescription: this.opts.groupDescription,
|
|
135
|
+
executions: [],
|
|
136
|
+
modelBriefs: [],
|
|
137
|
+
deviceType: this.context.getDeviceType()
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
createReportState(fileName, reuseExistingReport = false) {
|
|
141
|
+
return {
|
|
142
|
+
dump: this.createEmptyDump(),
|
|
143
|
+
fileName,
|
|
144
|
+
generator: external_report_generator_js_namespaceObject.ReportGenerator.create(fileName, {
|
|
145
|
+
generateReport: this.opts.generateReport,
|
|
146
|
+
persistExecutionDump: this.opts.persistExecutionDump,
|
|
147
|
+
outputFormat: this.opts.outputFormat,
|
|
148
|
+
autoPrintReportMsg: this.opts.autoPrintReportMsg,
|
|
149
|
+
reuseExistingReport
|
|
150
|
+
}),
|
|
151
|
+
executionIndexByRunner: new WeakMap(),
|
|
152
|
+
yamlScopeId: (0, utils_namespaceObject.uuid)(),
|
|
153
|
+
yamlRecords: [],
|
|
154
|
+
activeOperations: new Set()
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
clearDumpInMemory(report = this.reportState) {
|
|
158
|
+
report.dump = this.createEmptyDump();
|
|
159
|
+
report.executionIndexByRunner = new WeakMap();
|
|
160
|
+
report.lastExecution = void 0;
|
|
161
|
+
report.yamlRecords.length = 0;
|
|
162
|
+
}
|
|
163
|
+
assertReportIdle() {
|
|
164
|
+
(0, utils_namespaceObject.assert)(!this.reportState.activeOperations.size && !this.context.isExternallyBusy(), 'Cannot reset or finalize a report while the Agent is executing. Await the active operation first.');
|
|
165
|
+
}
|
|
166
|
+
assertReportWritable() {
|
|
167
|
+
const report = this.reportState;
|
|
168
|
+
(0, utils_namespaceObject.assert)(!this.context.isDestroyed(), 'Cannot execute using a destroyed Agent.');
|
|
169
|
+
(0, utils_namespaceObject.assert)(!this.reportReset, 'Report reset is in progress. Await resetDump() first.');
|
|
170
|
+
(0, utils_namespaceObject.assert)(!report.finalization, 'The report has been finalized. Call and await resetDump() before executing again.');
|
|
171
|
+
return report;
|
|
172
|
+
}
|
|
173
|
+
async withReportOperation(operation) {
|
|
174
|
+
const report = this.assertReportWritable();
|
|
175
|
+
const pending = Promise.resolve().then(operation);
|
|
176
|
+
report.activeOperations.add(pending);
|
|
177
|
+
try {
|
|
178
|
+
return await pending;
|
|
179
|
+
} finally{
|
|
180
|
+
report.activeOperations.delete(pending);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
async resetDump() {
|
|
184
|
+
(0, utils_namespaceObject.assert)(!this.context.isDestroyed(), 'Cannot reset a report using a destroyed Agent.');
|
|
185
|
+
if (this.reportReset) return this.reportReset;
|
|
186
|
+
this.assertReportIdle();
|
|
187
|
+
this.reportReset = (async ()=>{
|
|
188
|
+
try {
|
|
189
|
+
await this.finalizeReport();
|
|
190
|
+
} catch (error) {
|
|
191
|
+
warn(`Failed to finalize previous report; resetting dump: ${String(error)}`);
|
|
192
|
+
}
|
|
193
|
+
(0, utils_namespaceObject.assert)(!this.context.isDestroyed(), 'Cannot reset a report using a destroyed Agent.');
|
|
194
|
+
const fileName = (0, external_utils_js_namespaceObject_1.getReportFileName)(this.opts.testId || this.context.getDeviceType() || 'web');
|
|
195
|
+
this.reportState = this.createReportState(fileName);
|
|
196
|
+
return this.dump;
|
|
197
|
+
})();
|
|
198
|
+
try {
|
|
199
|
+
return await this.reportReset;
|
|
200
|
+
} finally{
|
|
201
|
+
this.reportReset = void 0;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
async finalizeReport() {
|
|
205
|
+
const report = this.reportState;
|
|
206
|
+
if (!report.finalization) {
|
|
207
|
+
this.assertReportIdle();
|
|
208
|
+
report.finalization = (async ()=>{
|
|
209
|
+
await report.generator.flush();
|
|
210
|
+
const path = await report.generator.finalize();
|
|
211
|
+
report.file = path;
|
|
212
|
+
this.clearDumpInMemory(report);
|
|
213
|
+
return path;
|
|
214
|
+
})();
|
|
215
|
+
}
|
|
216
|
+
return report.finalization;
|
|
217
|
+
}
|
|
218
|
+
appendExecutionDump(execution, runner) {
|
|
219
|
+
(0, utils_namespaceObject.assert)(!this.reportState.finalization, 'Cannot append to a finalized report. Await resetDump() first.');
|
|
220
|
+
const currentDump = this.dump;
|
|
221
|
+
if (runner) {
|
|
222
|
+
const existingIndex = this.reportState.executionIndexByRunner.get(runner);
|
|
223
|
+
if (void 0 !== existingIndex) {
|
|
224
|
+
currentDump.executions[existingIndex] = execution;
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
currentDump.executions.push(execution);
|
|
228
|
+
this.reportState.executionIndexByRunner.set(runner, currentDump.executions.length - 1);
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
currentDump.executions.push(execution);
|
|
232
|
+
}
|
|
233
|
+
dumpDataString(opt) {
|
|
234
|
+
this.dump.groupName = this.opts.groupName;
|
|
235
|
+
this.dump.groupDescription = this.opts.groupDescription;
|
|
236
|
+
if (utils_namespaceObject.ifInBrowser || opt?.inlineScreenshots) return this.dump.serializeWithInlineScreenshots();
|
|
237
|
+
return this.dump.serialize();
|
|
238
|
+
}
|
|
239
|
+
reportHTMLString(getDumpString) {
|
|
240
|
+
if (external_constants_js_namespaceObject.IS_REPORT_BUILD) return '';
|
|
241
|
+
const dumpString = getDumpString();
|
|
242
|
+
if (!this.reportState.yamlRecords.length) return (0, external_utils_js_namespaceObject.reportHTMLContent)(dumpString);
|
|
243
|
+
const reportId = this.reportState.yamlScopeId;
|
|
244
|
+
const runnerDump = (0, agent_report_js_namespaceObject.buildAgentTestRunReportDump)(this.buildYamlReportInput(), this.dump, {
|
|
245
|
+
reportId,
|
|
246
|
+
scopeId: this.reportState.yamlScopeId,
|
|
247
|
+
sourcePath: this.reportFile ?? '<inline-agent-report>'
|
|
248
|
+
});
|
|
249
|
+
return `${(0, external_utils_js_namespaceObject.reportHTMLContent)({
|
|
250
|
+
dumpString,
|
|
251
|
+
attributes: {
|
|
252
|
+
'data-group-id': reportId,
|
|
253
|
+
'data-report-id': reportId
|
|
254
|
+
}
|
|
255
|
+
})}\n${(0, html_utils_js_namespaceObject.generateTestRunReportScriptTag)(runnerDump)}`;
|
|
256
|
+
}
|
|
257
|
+
writeOutActionDumps(executionDump) {
|
|
258
|
+
const report = this.reportState;
|
|
259
|
+
if (report.finalization) {
|
|
260
|
+
if (executionDump) throw new errors_js_namespaceObject.WorkflowError('Cannot append to a finalized report. Await resetDump() first.', {
|
|
261
|
+
code: 'REPORT_FINALIZED'
|
|
262
|
+
});
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
const exec = executionDump || report.lastExecution;
|
|
266
|
+
if (exec) {
|
|
267
|
+
report.lastExecution = exec;
|
|
268
|
+
report.generator.onExecutionUpdate(exec, this.getReportMeta(), this.opts.reportAttributes);
|
|
269
|
+
}
|
|
270
|
+
report.file = report.generator.getReportPath();
|
|
271
|
+
}
|
|
272
|
+
async flushReport() {
|
|
273
|
+
if (this.reportReset) await this.reportReset;
|
|
274
|
+
const report = this.reportState;
|
|
275
|
+
if (report.finalization) return report.finalization;
|
|
276
|
+
this.writeOutActionDumps();
|
|
277
|
+
await report.generator.flush();
|
|
278
|
+
return report.lastExecution ? report.file ?? void 0 : void 0;
|
|
279
|
+
}
|
|
280
|
+
getReportMeta() {
|
|
281
|
+
return {
|
|
282
|
+
groupName: this.dump.groupName,
|
|
283
|
+
groupDescription: this.dump.groupDescription,
|
|
284
|
+
sdkVersion: this.dump.sdkVersion,
|
|
285
|
+
modelBriefs: this.dump.modelBriefs,
|
|
286
|
+
deviceType: this.dump.deviceType
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
get onDumpUpdate() {
|
|
290
|
+
return this.dumpUpdateListeners[0];
|
|
291
|
+
}
|
|
292
|
+
set onDumpUpdate(callback) {
|
|
293
|
+
this.dumpUpdateListeners = [];
|
|
294
|
+
if (callback) this.dumpUpdateListeners.push(callback);
|
|
295
|
+
}
|
|
296
|
+
addDumpUpdateListener(listener) {
|
|
297
|
+
this.dumpUpdateListeners.push(listener);
|
|
298
|
+
return ()=>{
|
|
299
|
+
this.removeDumpUpdateListener(listener);
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
removeDumpUpdateListener(listener) {
|
|
303
|
+
const index = this.dumpUpdateListeners.indexOf(listener);
|
|
304
|
+
if (index > -1) this.dumpUpdateListeners.splice(index, 1);
|
|
305
|
+
}
|
|
306
|
+
clearDumpUpdateListeners() {
|
|
307
|
+
this.dumpUpdateListeners = [];
|
|
308
|
+
}
|
|
309
|
+
notifyDumpUpdateListeners(executionDump) {
|
|
310
|
+
const dumpString = this.dumpDataString();
|
|
311
|
+
for (const listener of this.dumpUpdateListeners)try {
|
|
312
|
+
listener(dumpString, executionDump);
|
|
313
|
+
} catch (error) {
|
|
314
|
+
console.error('Error in onDumpUpdate listener', error);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
bindRunner(runner) {
|
|
318
|
+
this.reportByRunner.set(runner, this.reportState);
|
|
319
|
+
}
|
|
320
|
+
assertRunnerCurrent(runner) {
|
|
321
|
+
const report = this.reportByRunner.get(runner);
|
|
322
|
+
(0, utils_namespaceObject.assert)(report === this.reportState && !report.finalization, 'Cannot write a late execution update into a different or finalized report.');
|
|
323
|
+
}
|
|
324
|
+
async flushPendingWrites() {
|
|
325
|
+
await this.reportState.generator.flush();
|
|
326
|
+
}
|
|
327
|
+
async waitForOperations() {
|
|
328
|
+
while(this.reportState.activeOperations.size)await Promise.allSettled([
|
|
329
|
+
...this.reportState.activeOperations
|
|
330
|
+
]);
|
|
331
|
+
}
|
|
332
|
+
async waitForReset() {
|
|
333
|
+
if (this.reportReset) await this.reportReset.catch(()=>{});
|
|
334
|
+
}
|
|
335
|
+
constructor(context){
|
|
336
|
+
_define_property(this, "context", void 0);
|
|
337
|
+
_define_property(this, "reportState", void 0);
|
|
338
|
+
_define_property(this, "reportReset", void 0);
|
|
339
|
+
_define_property(this, "reportByRunner", void 0);
|
|
340
|
+
_define_property(this, "dumpUpdateListeners", void 0);
|
|
341
|
+
this.context = context;
|
|
342
|
+
this.reportByRunner = new WeakMap();
|
|
343
|
+
this.dumpUpdateListeners = [];
|
|
344
|
+
const opts = this.opts;
|
|
345
|
+
const fileName = opts.reportFileName ?? (0, external_utils_js_namespaceObject_1.getReportFileName)(opts.testId || context.getDeviceType() || 'web');
|
|
346
|
+
this.reportState = this.createReportState(fileName, opts.reportAttributes?.['data-group-id'] === fileName);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
exports.AgentReportManager = __webpack_exports__.AgentReportManager;
|
|
350
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
351
|
+
"AgentReportManager"
|
|
352
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
353
|
+
Object.defineProperty(exports, '__esModule', {
|
|
354
|
+
value: true
|
|
355
|
+
});
|
|
356
|
+
|
|
357
|
+
//# sourceMappingURL=agent-report-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent/agent-report-manager.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../src/agent/agent-report-manager.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 { getDebug } from '@midscene/shared/logger';\nimport { assert, ifInBrowser, uuid } from '@midscene/shared/utils';\nimport { IS_REPORT_BUILD } from '../constants';\nimport { generateTestRunReportScriptTag } from '../dump/html-utils';\nimport { type IReportGenerator, ReportGenerator } from '../report-generator';\nimport type { TaskRunner } from '../task-runner';\nimport { WorkflowError } from '../test-runner/errors';\nimport type { WorkflowExecutionRecord } from '../test-runner/execution-record';\nimport { buildAgentTestRunReportDump } from '../test-runner/reporting/agent-report';\nimport { executionRecordsToReportInput } from '../test-runner/reporting/execution-record';\nimport {\n type AgentOpt,\n type ExecutionDump,\n ReportActionDump,\n type ReportMeta,\n} from '../types';\nimport { getVersion, reportHTMLContent } from '../utils';\nimport { getReportFileName } from './utils';\n\nconst warn = getDebug('agent', { console: true });\n\ntype ReportOptions = Pick<\n AgentOpt,\n | 'groupName'\n | 'groupDescription'\n | 'generateReport'\n | 'persistExecutionDump'\n | 'outputFormat'\n | 'autoPrintReportMsg'\n | 'reportAttributes'\n | 'reportFileName'\n | 'testId'\n>;\n\ninterface AgentReportContext {\n getOptions(): ReportOptions;\n getDeviceType(): ReportActionDump['deviceType'];\n isDestroyed(): boolean;\n isExternallyBusy(): boolean;\n}\n\ninterface AgentReportState {\n dump: ReportActionDump;\n file?: string | null;\n fileName?: string;\n generator: IReportGenerator;\n finalization?: Promise<string | undefined>;\n lastExecution?: ExecutionDump;\n executionIndexByRunner: WeakMap<TaskRunner, number>;\n yamlScopeId: string;\n yamlRecords: WorkflowExecutionRecord[];\n activeOperations: Set<Promise<unknown>>;\n}\n\n/** Owns report state and persistence; execution and device ownership stay with Agent. */\nexport class AgentReportManager {\n private reportState: AgentReportState;\n private reportReset?: Promise<ReportActionDump>;\n private readonly reportByRunner = new WeakMap<TaskRunner, AgentReportState>();\n private dumpUpdateListeners: Array<\n (dump: string, executionDump?: ExecutionDump) => void\n > = [];\n\n constructor(private readonly context: AgentReportContext) {\n const opts = this.opts;\n const fileName =\n opts.reportFileName ??\n getReportFileName(opts.testId || context.getDeviceType() || 'web');\n this.reportState = this.createReportState(\n fileName,\n opts.reportAttributes?.['data-group-id'] === fileName,\n );\n }\n\n private get opts(): ReportOptions {\n return this.context.getOptions();\n }\n\n get dump(): ReportActionDump {\n return this.reportState.dump;\n }\n set dump(value: ReportActionDump) {\n this.reportState.dump = value;\n }\n\n get reportFile(): string | null | undefined {\n return this.reportState.file;\n }\n set reportFile(value: string | null | undefined) {\n this.reportState.file = value;\n }\n\n get reportFileName(): string | undefined {\n return this.reportState.fileName;\n }\n set reportFileName(value: string | undefined) {\n this.reportState.fileName = value;\n }\n\n /** @internal Runner snapshots retain immutable data and shared image files. */\n _prepareForTestRunner(): void {\n this.reportState.generator.enableSourceSnapshots?.();\n }\n async _createReportSource(scopeId: string, executionIds?: readonly string[]) {\n return this.reportState.generator.createSourceSnapshot?.(\n scopeId,\n executionIds,\n );\n }\n\n /** @internal The Agent owns one report stream across root YAML invocations. */\n async _writeYamlExecutionReport(\n record: WorkflowExecutionRecord,\n ): Promise<string | undefined> {\n const report = this.reportState;\n const existingIndex = report.yamlRecords.findIndex(\n (entry) => entry.runId === record.runId,\n );\n const recordIndex =\n existingIndex < 0 ? report.yamlRecords.length : existingIndex;\n report.yamlRecords[recordIndex] = record;\n try {\n const path = await report.generator.writeRunnerReport?.(\n this.buildYamlReportInput(),\n report.yamlScopeId,\n this.getReportMeta(),\n );\n report.file = path ?? report.file;\n return path;\n } catch (error) {\n report.yamlRecords[recordIndex] = Object.freeze({\n ...record,\n status: 'failed',\n reportError: error,\n });\n throw error;\n }\n }\n\n private buildYamlReportInput() {\n const scopedRecords = this.reportState.yamlRecords.map((entry) => ({\n ...entry,\n ...(entry.execution\n ? {\n execution: {\n document: {\n ...entry.execution.document,\n reportScopeId: this.reportState.yamlScopeId,\n },\n cases: entry.execution.cases.map((outcome) => ({\n ...outcome,\n ...(outcome.run\n ? {\n run: {\n ...outcome.run,\n reportScopeId: this.reportState.yamlScopeId,\n },\n }\n : {}),\n ...(outcome.attempts\n ? {\n attempts: outcome.attempts.map((attempt) => ({\n ...attempt,\n reportScopeId: this.reportState.yamlScopeId,\n })),\n }\n : {}),\n })),\n },\n }\n : {}),\n }));\n return executionRecordsToReportInput(scopedRecords, {\n runId: this.reportState.yamlScopeId,\n });\n }\n\n private createEmptyDump(): ReportActionDump {\n return new ReportActionDump({\n sdkVersion: getVersion(),\n groupName: this.opts.groupName!,\n groupDescription: this.opts.groupDescription,\n executions: [],\n modelBriefs: [],\n deviceType: this.context.getDeviceType(),\n });\n }\n\n private createReportState(\n fileName: string,\n reuseExistingReport = false,\n ): AgentReportState {\n return {\n dump: this.createEmptyDump(),\n fileName,\n generator: ReportGenerator.create(fileName, {\n generateReport: this.opts.generateReport,\n persistExecutionDump: this.opts.persistExecutionDump,\n outputFormat: this.opts.outputFormat,\n autoPrintReportMsg: this.opts.autoPrintReportMsg,\n reuseExistingReport,\n }),\n executionIndexByRunner: new WeakMap(),\n yamlScopeId: uuid(),\n yamlRecords: [],\n activeOperations: new Set(),\n };\n }\n\n private clearDumpInMemory(report = this.reportState): void {\n report.dump = this.createEmptyDump();\n report.executionIndexByRunner = new WeakMap();\n report.lastExecution = undefined;\n report.yamlRecords.length = 0;\n }\n\n private assertReportIdle(): void {\n assert(\n !this.reportState.activeOperations.size &&\n !this.context.isExternallyBusy(),\n 'Cannot reset or finalize a report while the Agent is executing. Await the active operation first.',\n );\n }\n\n assertReportWritable(): AgentReportState {\n const report = this.reportState;\n assert(\n !this.context.isDestroyed(),\n 'Cannot execute using a destroyed Agent.',\n );\n assert(\n !this.reportReset,\n 'Report reset is in progress. Await resetDump() first.',\n );\n assert(\n !report.finalization,\n 'The report has been finalized. Call and await resetDump() before executing again.',\n );\n return report;\n }\n\n async withReportOperation<T>(operation: () => Promise<T>): Promise<T> {\n const report = this.assertReportWritable();\n const pending = Promise.resolve().then(operation);\n report.activeOperations.add(pending);\n try {\n return await pending;\n } finally {\n report.activeOperations.delete(pending);\n }\n }\n\n /**\n * Finalize the preceding report and reset execution records for a new report.\n * Historical artifacts are retained; this Agent and its device stay connected.\n * Await this method before executing again. Concurrent resets share one reset.\n */\n async resetDump(): Promise<ReportActionDump> {\n assert(\n !this.context.isDestroyed(),\n 'Cannot reset a report using a destroyed Agent.',\n );\n if (this.reportReset) return this.reportReset;\n this.assertReportIdle();\n this.reportReset = (async () => {\n try {\n await this.finalizeReport();\n } catch (error) {\n // Failure belongs to the preceding report, not to the next write queue.\n warn(\n `Failed to finalize previous report; resetting dump: ${String(error)}`,\n );\n }\n assert(\n !this.context.isDestroyed(),\n 'Cannot reset a report using a destroyed Agent.',\n );\n const fileName = getReportFileName(\n this.opts.testId || this.context.getDeviceType() || 'web',\n );\n this.reportState = this.createReportState(fileName);\n return this.dump;\n })();\n try {\n return await this.reportReset;\n } finally {\n this.reportReset = undefined;\n }\n }\n\n /**\n * Seal the current report and release its in-memory records without\n * disconnecting the device. Export in-memory data before calling this method.\n * Repeated calls return the same result and never rewrite published artifacts.\n */\n async finalizeReport(): Promise<string | undefined> {\n const report = this.reportState;\n if (!report.finalization) {\n this.assertReportIdle();\n report.finalization = (async () => {\n await report.generator.flush();\n const path = await report.generator.finalize();\n report.file = path;\n this.clearDumpInMemory(report);\n return path;\n })();\n }\n return report.finalization;\n }\n\n appendExecutionDump(execution: ExecutionDump, runner?: TaskRunner) {\n assert(\n !this.reportState.finalization,\n 'Cannot append to a finalized report. Await resetDump() first.',\n );\n const currentDump = this.dump;\n if (runner) {\n const existingIndex = this.reportState.executionIndexByRunner.get(runner);\n if (existingIndex !== undefined) {\n currentDump.executions[existingIndex] = execution;\n return;\n }\n currentDump.executions.push(execution);\n this.reportState.executionIndexByRunner.set(\n runner,\n currentDump.executions.length - 1,\n );\n return;\n }\n currentDump.executions.push(execution);\n }\n\n dumpDataString(opt?: { inlineScreenshots?: boolean }) {\n // update dump info\n this.dump.groupName = this.opts.groupName!;\n this.dump.groupDescription = this.opts.groupDescription;\n // In browser environment, use inline screenshots since file system is not available\n if (ifInBrowser || opt?.inlineScreenshots) {\n return this.dump.serializeWithInlineScreenshots();\n }\n return this.dump.serialize();\n }\n\n reportHTMLString(getDumpString: () => string) {\n // Short-circuit at the call site because JavaScript evaluates function\n // arguments first. This avoids serializing the dump (including inline\n // screenshots) when the Report Viewer build does not need report HTML.\n if (IS_REPORT_BUILD) {\n return '';\n }\n\n // dumpDataString() handles browser environment with inline screenshots\n const dumpString = getDumpString();\n if (!this.reportState.yamlRecords.length)\n return reportHTMLContent(dumpString);\n\n // Browser exports have no file writer, so the execution record must own\n // the hierarchy independently of whether file report generation is enabled.\n const reportId = this.reportState.yamlScopeId;\n const runnerDump = buildAgentTestRunReportDump(\n this.buildYamlReportInput(),\n this.dump,\n {\n reportId,\n scopeId: this.reportState.yamlScopeId,\n sourcePath: this.reportFile ?? '<inline-agent-report>',\n },\n );\n return `${reportHTMLContent({\n dumpString,\n attributes: { 'data-group-id': reportId, 'data-report-id': reportId },\n })}\\n${generateTestRunReportScriptTag(runnerDump)}`;\n }\n\n writeOutActionDumps(executionDump?: ExecutionDump) {\n const report = this.reportState;\n if (report.finalization) {\n if (executionDump) {\n throw new WorkflowError(\n 'Cannot append to a finalized report. Await resetDump() first.',\n {\n code: 'REPORT_FINALIZED',\n },\n );\n }\n return;\n }\n const exec = executionDump || report.lastExecution;\n if (exec) {\n report.lastExecution = exec;\n report.generator.onExecutionUpdate(\n exec,\n this.getReportMeta(),\n this.opts.reportAttributes,\n );\n }\n report.file = report.generator.getReportPath();\n }\n\n /** Persist current report data without disposing this Agent or its device. */\n async flushReport(): Promise<string | undefined> {\n if (this.reportReset) await this.reportReset;\n const report = this.reportState;\n if (report.finalization) return report.finalization;\n this.writeOutActionDumps();\n await report.generator.flush();\n return report.lastExecution ? (report.file ?? undefined) : undefined;\n }\n\n private getReportMeta(): ReportMeta {\n return {\n groupName: this.dump.groupName,\n groupDescription: this.dump.groupDescription,\n sdkVersion: this.dump.sdkVersion,\n modelBriefs: this.dump.modelBriefs,\n deviceType: this.dump.deviceType,\n };\n }\n\n get onDumpUpdate():\n | ((dump: string, executionDump?: ExecutionDump) => void)\n | undefined {\n return this.dumpUpdateListeners[0];\n }\n\n set onDumpUpdate(callback:\n | ((dump: string, executionDump?: ExecutionDump) => void)\n | undefined) {\n // Clear existing listeners\n this.dumpUpdateListeners = [];\n // Add callback to array if provided\n if (callback) {\n this.dumpUpdateListeners.push(callback);\n }\n }\n\n addDumpUpdateListener(\n listener: (dump: string, executionDump?: ExecutionDump) => void,\n ): () => void {\n this.dumpUpdateListeners.push(listener);\n\n // Return remove function\n return () => {\n this.removeDumpUpdateListener(listener);\n };\n }\n\n /**\n * Remove a dump update listener\n * @param listener The listener function to remove\n */\n removeDumpUpdateListener(\n listener: (dump: string, executionDump?: ExecutionDump) => void,\n ): void {\n const index = this.dumpUpdateListeners.indexOf(listener);\n if (index > -1) {\n this.dumpUpdateListeners.splice(index, 1);\n }\n }\n\n /**\n * Clear all dump update listeners\n */\n clearDumpUpdateListeners(): void {\n this.dumpUpdateListeners = [];\n }\n\n notifyDumpUpdateListeners(executionDump?: ExecutionDump) {\n const dumpString = this.dumpDataString();\n for (const listener of this.dumpUpdateListeners) {\n try {\n listener(dumpString, executionDump);\n } catch (error) {\n console.error('Error in onDumpUpdate listener', error);\n }\n }\n }\n\n bindRunner(runner: TaskRunner): void {\n this.reportByRunner.set(runner, this.reportState);\n }\n\n assertRunnerCurrent(runner: TaskRunner): void {\n const report = this.reportByRunner.get(runner);\n assert(\n report === this.reportState && !report.finalization,\n 'Cannot write a late execution update into a different or finalized report.',\n );\n }\n\n async flushPendingWrites(): Promise<void> {\n await this.reportState.generator.flush();\n }\n\n async waitForOperations(): Promise<void> {\n while (this.reportState.activeOperations.size) {\n await Promise.allSettled([...this.reportState.activeOperations]);\n }\n }\n\n async waitForReset(): Promise<void> {\n if (this.reportReset) await this.reportReset.catch(() => {});\n }\n}\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","warn","getDebug","AgentReportManager","value","scopeId","executionIds","record","report","existingIndex","entry","recordIndex","path","error","scopedRecords","outcome","attempt","executionRecordsToReportInput","ReportActionDump","getVersion","fileName","reuseExistingReport","ReportGenerator","WeakMap","uuid","Set","undefined","assert","operation","pending","Promise","String","getReportFileName","execution","runner","currentDump","opt","ifInBrowser","getDumpString","IS_REPORT_BUILD","dumpString","reportHTMLContent","reportId","runnerDump","buildAgentTestRunReportDump","generateTestRunReportScriptTag","executionDump","WorkflowError","exec","callback","listener","index","console","context","opts"],"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,IA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