@aiscene/core 1.7.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/LICENSE +21 -0
- package/README.md +9 -0
- package/dist/es/agent/agent.mjs +749 -0
- package/dist/es/agent/agent.mjs.map +1 -0
- package/dist/es/agent/common.mjs +0 -0
- package/dist/es/agent/execution-session.mjs +41 -0
- package/dist/es/agent/execution-session.mjs.map +1 -0
- package/dist/es/agent/index.mjs +6 -0
- package/dist/es/agent/task-builder.mjs +332 -0
- package/dist/es/agent/task-builder.mjs.map +1 -0
- package/dist/es/agent/task-cache.mjs +214 -0
- package/dist/es/agent/task-cache.mjs.map +1 -0
- package/dist/es/agent/tasks.mjs +426 -0
- package/dist/es/agent/tasks.mjs.map +1 -0
- package/dist/es/agent/ui-utils.mjs +91 -0
- package/dist/es/agent/ui-utils.mjs.map +1 -0
- package/dist/es/agent/utils.mjs +198 -0
- package/dist/es/agent/utils.mjs.map +1 -0
- package/dist/es/ai-model/auto-glm/actions.mjs +237 -0
- package/dist/es/ai-model/auto-glm/actions.mjs.map +1 -0
- package/dist/es/ai-model/auto-glm/index.mjs +6 -0
- package/dist/es/ai-model/auto-glm/parser.mjs +239 -0
- package/dist/es/ai-model/auto-glm/parser.mjs.map +1 -0
- package/dist/es/ai-model/auto-glm/planning.mjs +71 -0
- package/dist/es/ai-model/auto-glm/planning.mjs.map +1 -0
- package/dist/es/ai-model/auto-glm/prompt.mjs +222 -0
- package/dist/es/ai-model/auto-glm/prompt.mjs.map +1 -0
- package/dist/es/ai-model/auto-glm/util.mjs +9 -0
- package/dist/es/ai-model/auto-glm/util.mjs.map +1 -0
- package/dist/es/ai-model/conversation-history.mjs +195 -0
- package/dist/es/ai-model/conversation-history.mjs.map +1 -0
- package/dist/es/ai-model/index.mjs +11 -0
- package/dist/es/ai-model/inspect.mjs +394 -0
- package/dist/es/ai-model/inspect.mjs.map +1 -0
- package/dist/es/ai-model/llm-planning.mjs +233 -0
- package/dist/es/ai-model/llm-planning.mjs.map +1 -0
- package/dist/es/ai-model/prompt/common.mjs +7 -0
- package/dist/es/ai-model/prompt/common.mjs.map +1 -0
- package/dist/es/ai-model/prompt/describe.mjs +66 -0
- package/dist/es/ai-model/prompt/describe.mjs.map +1 -0
- package/dist/es/ai-model/prompt/extraction.mjs +129 -0
- package/dist/es/ai-model/prompt/extraction.mjs.map +1 -0
- package/dist/es/ai-model/prompt/llm-locator.mjs +51 -0
- package/dist/es/ai-model/prompt/llm-locator.mjs.map +1 -0
- package/dist/es/ai-model/prompt/llm-planning.mjs +568 -0
- package/dist/es/ai-model/prompt/llm-planning.mjs.map +1 -0
- package/dist/es/ai-model/prompt/llm-section-locator.mjs +44 -0
- package/dist/es/ai-model/prompt/llm-section-locator.mjs.map +1 -0
- package/dist/es/ai-model/prompt/order-sensitive-judge.mjs +35 -0
- package/dist/es/ai-model/prompt/order-sensitive-judge.mjs.map +1 -0
- package/dist/es/ai-model/prompt/playwright-generator.mjs +117 -0
- package/dist/es/ai-model/prompt/playwright-generator.mjs.map +1 -0
- package/dist/es/ai-model/prompt/ui-tars-planning.mjs +36 -0
- package/dist/es/ai-model/prompt/ui-tars-planning.mjs.map +1 -0
- package/dist/es/ai-model/prompt/util.mjs +59 -0
- package/dist/es/ai-model/prompt/util.mjs.map +1 -0
- package/dist/es/ai-model/prompt/yaml-generator.mjs +219 -0
- package/dist/es/ai-model/prompt/yaml-generator.mjs.map +1 -0
- package/dist/es/ai-model/service-caller/codex-app-server.mjs +575 -0
- package/dist/es/ai-model/service-caller/codex-app-server.mjs.map +1 -0
- package/dist/es/ai-model/service-caller/image-detail.mjs +6 -0
- package/dist/es/ai-model/service-caller/image-detail.mjs.map +1 -0
- package/dist/es/ai-model/service-caller/index.mjs +473 -0
- package/dist/es/ai-model/service-caller/index.mjs.map +1 -0
- package/dist/es/ai-model/ui-tars-planning.mjs +249 -0
- package/dist/es/ai-model/ui-tars-planning.mjs.map +1 -0
- package/dist/es/common.mjs +371 -0
- package/dist/es/common.mjs.map +1 -0
- package/dist/es/device/device-options.mjs +0 -0
- package/dist/es/device/index.mjs +341 -0
- package/dist/es/device/index.mjs.map +1 -0
- package/dist/es/dump/html-utils.mjs +284 -0
- package/dist/es/dump/html-utils.mjs.map +1 -0
- package/dist/es/dump/image-restoration.mjs +43 -0
- package/dist/es/dump/image-restoration.mjs.map +1 -0
- package/dist/es/dump/index.mjs +3 -0
- package/dist/es/index.mjs +15 -0
- package/dist/es/index.mjs.map +1 -0
- package/dist/es/report-generator.mjs +162 -0
- package/dist/es/report-generator.mjs.map +1 -0
- package/dist/es/report.mjs +137 -0
- package/dist/es/report.mjs.map +1 -0
- package/dist/es/screenshot-item.mjs +105 -0
- package/dist/es/screenshot-item.mjs.map +1 -0
- package/dist/es/service/index.mjs +274 -0
- package/dist/es/service/index.mjs.map +1 -0
- package/dist/es/service/utils.mjs +15 -0
- package/dist/es/service/utils.mjs.map +1 -0
- package/dist/es/skill/index.mjs +38 -0
- package/dist/es/skill/index.mjs.map +1 -0
- package/dist/es/task-runner.mjs +263 -0
- package/dist/es/task-runner.mjs.map +1 -0
- package/dist/es/task-timing.mjs +12 -0
- package/dist/es/task-timing.mjs.map +1 -0
- package/dist/es/tree.mjs +13 -0
- package/dist/es/tree.mjs.map +1 -0
- package/dist/es/types.mjs +199 -0
- package/dist/es/types.mjs.map +1 -0
- package/dist/es/utils.mjs +229 -0
- package/dist/es/utils.mjs.map +1 -0
- package/dist/es/yaml/builder.mjs +13 -0
- package/dist/es/yaml/builder.mjs.map +1 -0
- package/dist/es/yaml/index.mjs +4 -0
- package/dist/es/yaml/player.mjs +434 -0
- package/dist/es/yaml/player.mjs.map +1 -0
- package/dist/es/yaml/utils.mjs +102 -0
- package/dist/es/yaml/utils.mjs.map +1 -0
- package/dist/es/yaml.mjs +0 -0
- package/dist/lib/agent/agent.js +797 -0
- package/dist/lib/agent/agent.js.map +1 -0
- package/dist/lib/agent/common.js +5 -0
- package/dist/lib/agent/execution-session.js +75 -0
- package/dist/lib/agent/execution-session.js.map +1 -0
- package/dist/lib/agent/index.js +81 -0
- package/dist/lib/agent/index.js.map +1 -0
- package/dist/lib/agent/task-builder.js +369 -0
- package/dist/lib/agent/task-builder.js.map +1 -0
- package/dist/lib/agent/task-cache.js +266 -0
- package/dist/lib/agent/task-cache.js.map +1 -0
- package/dist/lib/agent/tasks.js +469 -0
- package/dist/lib/agent/tasks.js.map +1 -0
- package/dist/lib/agent/ui-utils.js +143 -0
- package/dist/lib/agent/ui-utils.js.map +1 -0
- package/dist/lib/agent/utils.js +275 -0
- package/dist/lib/agent/utils.js.map +1 -0
- package/dist/lib/ai-model/auto-glm/actions.js +271 -0
- package/dist/lib/ai-model/auto-glm/actions.js.map +1 -0
- package/dist/lib/ai-model/auto-glm/index.js +66 -0
- package/dist/lib/ai-model/auto-glm/index.js.map +1 -0
- package/dist/lib/ai-model/auto-glm/parser.js +282 -0
- package/dist/lib/ai-model/auto-glm/parser.js.map +1 -0
- package/dist/lib/ai-model/auto-glm/planning.js +105 -0
- package/dist/lib/ai-model/auto-glm/planning.js.map +1 -0
- package/dist/lib/ai-model/auto-glm/prompt.js +259 -0
- package/dist/lib/ai-model/auto-glm/prompt.js.map +1 -0
- package/dist/lib/ai-model/auto-glm/util.js +46 -0
- package/dist/lib/ai-model/auto-glm/util.js.map +1 -0
- package/dist/lib/ai-model/conversation-history.js +229 -0
- package/dist/lib/ai-model/conversation-history.js.map +1 -0
- package/dist/lib/ai-model/index.js +125 -0
- package/dist/lib/ai-model/index.js.map +1 -0
- package/dist/lib/ai-model/inspect.js +440 -0
- package/dist/lib/ai-model/inspect.js.map +1 -0
- package/dist/lib/ai-model/llm-planning.js +270 -0
- package/dist/lib/ai-model/llm-planning.js.map +1 -0
- package/dist/lib/ai-model/prompt/common.js +41 -0
- package/dist/lib/ai-model/prompt/common.js.map +1 -0
- package/dist/lib/ai-model/prompt/describe.js +100 -0
- package/dist/lib/ai-model/prompt/describe.js.map +1 -0
- package/dist/lib/ai-model/prompt/extraction.js +169 -0
- package/dist/lib/ai-model/prompt/extraction.js.map +1 -0
- package/dist/lib/ai-model/prompt/llm-locator.js +88 -0
- package/dist/lib/ai-model/prompt/llm-locator.js.map +1 -0
- package/dist/lib/ai-model/prompt/llm-planning.js +605 -0
- package/dist/lib/ai-model/prompt/llm-planning.js.map +1 -0
- package/dist/lib/ai-model/prompt/llm-section-locator.js +81 -0
- package/dist/lib/ai-model/prompt/llm-section-locator.js.map +1 -0
- package/dist/lib/ai-model/prompt/order-sensitive-judge.js +72 -0
- package/dist/lib/ai-model/prompt/order-sensitive-judge.js.map +1 -0
- package/dist/lib/ai-model/prompt/playwright-generator.js +178 -0
- package/dist/lib/ai-model/prompt/playwright-generator.js.map +1 -0
- package/dist/lib/ai-model/prompt/ui-tars-planning.js +73 -0
- package/dist/lib/ai-model/prompt/ui-tars-planning.js.map +1 -0
- package/dist/lib/ai-model/prompt/util.js +105 -0
- package/dist/lib/ai-model/prompt/util.js.map +1 -0
- package/dist/lib/ai-model/prompt/yaml-generator.js +280 -0
- package/dist/lib/ai-model/prompt/yaml-generator.js.map +1 -0
- package/dist/lib/ai-model/service-caller/codex-app-server.js +624 -0
- package/dist/lib/ai-model/service-caller/codex-app-server.js.map +1 -0
- package/dist/lib/ai-model/service-caller/image-detail.js +40 -0
- package/dist/lib/ai-model/service-caller/image-detail.js.map +1 -0
- package/dist/lib/ai-model/service-caller/index.js +538 -0
- package/dist/lib/ai-model/service-caller/index.js.map +1 -0
- package/dist/lib/ai-model/ui-tars-planning.js +283 -0
- package/dist/lib/ai-model/ui-tars-planning.js.map +1 -0
- package/dist/lib/common.js +480 -0
- package/dist/lib/common.js.map +1 -0
- package/dist/lib/device/device-options.js +20 -0
- package/dist/lib/device/device-options.js.map +1 -0
- package/dist/lib/device/index.js +468 -0
- package/dist/lib/device/index.js.map +1 -0
- package/dist/lib/dump/html-utils.js +357 -0
- package/dist/lib/dump/html-utils.js.map +1 -0
- package/dist/lib/dump/image-restoration.js +77 -0
- package/dist/lib/dump/image-restoration.js.map +1 -0
- package/dist/lib/dump/index.js +60 -0
- package/dist/lib/dump/index.js.map +1 -0
- package/dist/lib/index.js +146 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/report-generator.js +200 -0
- package/dist/lib/report-generator.js.map +1 -0
- package/dist/lib/report.js +171 -0
- package/dist/lib/report.js.map +1 -0
- package/dist/lib/screenshot-item.js +139 -0
- package/dist/lib/screenshot-item.js.map +1 -0
- package/dist/lib/service/index.js +308 -0
- package/dist/lib/service/index.js.map +1 -0
- package/dist/lib/service/utils.js +49 -0
- package/dist/lib/service/utils.js.map +1 -0
- package/dist/lib/skill/index.js +72 -0
- package/dist/lib/skill/index.js.map +1 -0
- package/dist/lib/task-runner.js +300 -0
- package/dist/lib/task-runner.js.map +1 -0
- package/dist/lib/task-timing.js +46 -0
- package/dist/lib/task-timing.js.map +1 -0
- package/dist/lib/tree.js +53 -0
- package/dist/lib/tree.js.map +1 -0
- package/dist/lib/types.js +288 -0
- package/dist/lib/types.js.map +1 -0
- package/dist/lib/utils.js +308 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/yaml/builder.js +57 -0
- package/dist/lib/yaml/builder.js.map +1 -0
- package/dist/lib/yaml/index.js +81 -0
- package/dist/lib/yaml/index.js.map +1 -0
- package/dist/lib/yaml/player.js +468 -0
- package/dist/lib/yaml/player.js.map +1 -0
- package/dist/lib/yaml/utils.js +155 -0
- package/dist/lib/yaml/utils.js.map +1 -0
- package/dist/lib/yaml.js +20 -0
- package/dist/lib/yaml.js.map +1 -0
- package/dist/types/agent/agent.d.ts +205 -0
- package/dist/types/agent/common.d.ts +0 -0
- package/dist/types/agent/execution-session.d.ts +36 -0
- package/dist/types/agent/index.d.ts +10 -0
- package/dist/types/agent/task-builder.d.ts +34 -0
- package/dist/types/agent/task-cache.d.ts +49 -0
- package/dist/types/agent/tasks.d.ts +69 -0
- package/dist/types/agent/ui-utils.d.ts +14 -0
- package/dist/types/agent/utils.d.ts +31 -0
- package/dist/types/ai-model/auto-glm/actions.d.ts +78 -0
- package/dist/types/ai-model/auto-glm/index.d.ts +6 -0
- package/dist/types/ai-model/auto-glm/parser.d.ts +18 -0
- package/dist/types/ai-model/auto-glm/planning.d.ts +12 -0
- package/dist/types/ai-model/auto-glm/prompt.d.ts +27 -0
- package/dist/types/ai-model/auto-glm/util.d.ts +13 -0
- package/dist/types/ai-model/conversation-history.d.ts +105 -0
- package/dist/types/ai-model/index.d.ts +14 -0
- package/dist/types/ai-model/inspect.d.ts +67 -0
- package/dist/types/ai-model/llm-planning.d.ts +19 -0
- package/dist/types/ai-model/prompt/common.d.ts +2 -0
- package/dist/types/ai-model/prompt/describe.d.ts +1 -0
- package/dist/types/ai-model/prompt/extraction.d.ts +7 -0
- package/dist/types/ai-model/prompt/llm-locator.d.ts +3 -0
- package/dist/types/ai-model/prompt/llm-planning.d.ts +10 -0
- package/dist/types/ai-model/prompt/llm-section-locator.d.ts +3 -0
- package/dist/types/ai-model/prompt/order-sensitive-judge.d.ts +2 -0
- package/dist/types/ai-model/prompt/playwright-generator.d.ts +26 -0
- package/dist/types/ai-model/prompt/ui-tars-planning.d.ts +2 -0
- package/dist/types/ai-model/prompt/util.d.ts +33 -0
- package/dist/types/ai-model/prompt/yaml-generator.d.ts +100 -0
- package/dist/types/ai-model/service-caller/codex-app-server.d.ts +42 -0
- package/dist/types/ai-model/service-caller/image-detail.d.ts +2 -0
- package/dist/types/ai-model/service-caller/index.d.ts +49 -0
- package/dist/types/ai-model/ui-tars-planning.d.ts +72 -0
- package/dist/types/common.d.ts +288 -0
- package/dist/types/device/device-options.d.ts +142 -0
- package/dist/types/device/index.d.ts +2528 -0
- package/dist/types/dump/html-utils.d.ts +63 -0
- package/dist/types/dump/image-restoration.d.ts +6 -0
- package/dist/types/dump/index.d.ts +5 -0
- package/dist/types/index.d.ts +17 -0
- package/dist/types/report-generator.d.ts +66 -0
- package/dist/types/report.d.ts +22 -0
- package/dist/types/screenshot-item.d.ts +66 -0
- package/dist/types/service/index.d.ts +24 -0
- package/dist/types/service/utils.d.ts +2 -0
- package/dist/types/skill/index.d.ts +25 -0
- package/dist/types/task-runner.d.ts +50 -0
- package/dist/types/task-timing.d.ts +8 -0
- package/dist/types/tree.d.ts +4 -0
- package/dist/types/types.d.ts +669 -0
- package/dist/types/utils.d.ts +40 -0
- package/dist/types/yaml/builder.d.ts +2 -0
- package/dist/types/yaml/index.d.ts +4 -0
- package/dist/types/yaml/player.d.ts +34 -0
- package/dist/types/yaml/utils.d.ts +9 -0
- package/dist/types/yaml.d.ts +217 -0
- package/package.json +130 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.n = (module)=>{
|
|
5
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
+
__webpack_require__.d(getter, {
|
|
7
|
+
a: getter
|
|
8
|
+
});
|
|
9
|
+
return getter;
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
14
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: definition[key]
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
})();
|
|
20
|
+
(()=>{
|
|
21
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
22
|
+
})();
|
|
23
|
+
(()=>{
|
|
24
|
+
__webpack_require__.r = (exports1)=>{
|
|
25
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
26
|
+
value: 'Module'
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
29
|
+
value: true
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
})();
|
|
33
|
+
var __webpack_exports__ = {};
|
|
34
|
+
__webpack_require__.r(__webpack_exports__);
|
|
35
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
36
|
+
plan: ()=>external_ai_model_index_js_namespaceObject.plan,
|
|
37
|
+
TUserPromptSchema: ()=>external_ai_model_index_js_namespaceObject.TUserPromptSchema,
|
|
38
|
+
MIDSCENE_MODEL_NAME: ()=>env_namespaceObject.MIDSCENE_MODEL_NAME,
|
|
39
|
+
generateImageScriptTag: ()=>external_dump_index_js_namespaceObject.generateImageScriptTag,
|
|
40
|
+
restoreImageReferences: ()=>external_dump_index_js_namespaceObject.restoreImageReferences,
|
|
41
|
+
parseDumpScriptAttributes: ()=>external_dump_index_js_namespaceObject.parseDumpScriptAttributes,
|
|
42
|
+
z: ()=>external_zod_namespaceObject.z,
|
|
43
|
+
generateDumpScriptTag: ()=>external_dump_index_js_namespaceObject.generateDumpScriptTag,
|
|
44
|
+
SizeSchema: ()=>external_ai_model_index_js_namespaceObject.SizeSchema,
|
|
45
|
+
default: ()=>src,
|
|
46
|
+
getVersion: ()=>external_utils_js_namespaceObject.getVersion,
|
|
47
|
+
getMidsceneLocationSchema: ()=>external_ai_model_index_js_namespaceObject.getMidsceneLocationSchema,
|
|
48
|
+
parseDumpScript: ()=>external_dump_index_js_namespaceObject.parseDumpScript,
|
|
49
|
+
ServiceError: ()=>external_types_js_namespaceObject.ServiceError,
|
|
50
|
+
parseImageScripts: ()=>external_dump_index_js_namespaceObject.parseImageScripts,
|
|
51
|
+
PointSchema: ()=>external_ai_model_index_js_namespaceObject.PointSchema,
|
|
52
|
+
RectSchema: ()=>external_ai_model_index_js_namespaceObject.RectSchema,
|
|
53
|
+
Agent: ()=>external_agent_index_js_namespaceObject.Agent,
|
|
54
|
+
nullReportGenerator: ()=>external_report_generator_js_namespaceObject.nullReportGenerator,
|
|
55
|
+
Service: ()=>index_js_default(),
|
|
56
|
+
AiLocateElement: ()=>external_ai_model_index_js_namespaceObject.AiLocateElement,
|
|
57
|
+
ScreenshotItem: ()=>external_screenshot_item_js_namespaceObject.ScreenshotItem,
|
|
58
|
+
createAgent: ()=>external_agent_index_js_namespaceObject.createAgent,
|
|
59
|
+
ExecutionDump: ()=>external_types_js_namespaceObject.ExecutionDump,
|
|
60
|
+
escapeContent: ()=>external_dump_index_js_namespaceObject.escapeContent,
|
|
61
|
+
ReportGenerator: ()=>external_report_generator_js_namespaceObject.ReportGenerator,
|
|
62
|
+
TaskRunner: ()=>external_task_runner_js_namespaceObject.TaskRunner,
|
|
63
|
+
GroupedActionDump: ()=>external_types_js_namespaceObject.GroupedActionDump,
|
|
64
|
+
TMultimodalPromptSchema: ()=>external_ai_model_index_js_namespaceObject.TMultimodalPromptSchema,
|
|
65
|
+
unescapeContent: ()=>external_dump_index_js_namespaceObject.unescapeContent
|
|
66
|
+
});
|
|
67
|
+
const external_zod_namespaceObject = require("zod");
|
|
68
|
+
const index_js_namespaceObject = require("./service/index.js");
|
|
69
|
+
var index_js_default = /*#__PURE__*/ __webpack_require__.n(index_js_namespaceObject);
|
|
70
|
+
const external_task_runner_js_namespaceObject = require("./task-runner.js");
|
|
71
|
+
const external_utils_js_namespaceObject = require("./utils.js");
|
|
72
|
+
const external_ai_model_index_js_namespaceObject = require("./ai-model/index.js");
|
|
73
|
+
const env_namespaceObject = require("@midscene/shared/env");
|
|
74
|
+
const external_types_js_namespaceObject = require("./types.js");
|
|
75
|
+
const external_agent_index_js_namespaceObject = require("./agent/index.js");
|
|
76
|
+
const external_dump_index_js_namespaceObject = require("./dump/index.js");
|
|
77
|
+
const external_report_generator_js_namespaceObject = require("./report-generator.js");
|
|
78
|
+
const external_screenshot_item_js_namespaceObject = require("./screenshot-item.js");
|
|
79
|
+
const src = index_js_default();
|
|
80
|
+
exports.Agent = __webpack_exports__.Agent;
|
|
81
|
+
exports.AiLocateElement = __webpack_exports__.AiLocateElement;
|
|
82
|
+
exports.ExecutionDump = __webpack_exports__.ExecutionDump;
|
|
83
|
+
exports.GroupedActionDump = __webpack_exports__.GroupedActionDump;
|
|
84
|
+
exports.MIDSCENE_MODEL_NAME = __webpack_exports__.MIDSCENE_MODEL_NAME;
|
|
85
|
+
exports.PointSchema = __webpack_exports__.PointSchema;
|
|
86
|
+
exports.RectSchema = __webpack_exports__.RectSchema;
|
|
87
|
+
exports.ReportGenerator = __webpack_exports__.ReportGenerator;
|
|
88
|
+
exports.ScreenshotItem = __webpack_exports__.ScreenshotItem;
|
|
89
|
+
exports.Service = __webpack_exports__.Service;
|
|
90
|
+
exports.ServiceError = __webpack_exports__.ServiceError;
|
|
91
|
+
exports.SizeSchema = __webpack_exports__.SizeSchema;
|
|
92
|
+
exports.TMultimodalPromptSchema = __webpack_exports__.TMultimodalPromptSchema;
|
|
93
|
+
exports.TUserPromptSchema = __webpack_exports__.TUserPromptSchema;
|
|
94
|
+
exports.TaskRunner = __webpack_exports__.TaskRunner;
|
|
95
|
+
exports.createAgent = __webpack_exports__.createAgent;
|
|
96
|
+
exports["default"] = __webpack_exports__["default"];
|
|
97
|
+
exports.escapeContent = __webpack_exports__.escapeContent;
|
|
98
|
+
exports.generateDumpScriptTag = __webpack_exports__.generateDumpScriptTag;
|
|
99
|
+
exports.generateImageScriptTag = __webpack_exports__.generateImageScriptTag;
|
|
100
|
+
exports.getMidsceneLocationSchema = __webpack_exports__.getMidsceneLocationSchema;
|
|
101
|
+
exports.getVersion = __webpack_exports__.getVersion;
|
|
102
|
+
exports.nullReportGenerator = __webpack_exports__.nullReportGenerator;
|
|
103
|
+
exports.parseDumpScript = __webpack_exports__.parseDumpScript;
|
|
104
|
+
exports.parseDumpScriptAttributes = __webpack_exports__.parseDumpScriptAttributes;
|
|
105
|
+
exports.parseImageScripts = __webpack_exports__.parseImageScripts;
|
|
106
|
+
exports.plan = __webpack_exports__.plan;
|
|
107
|
+
exports.restoreImageReferences = __webpack_exports__.restoreImageReferences;
|
|
108
|
+
exports.unescapeContent = __webpack_exports__.unescapeContent;
|
|
109
|
+
exports.z = __webpack_exports__.z;
|
|
110
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
111
|
+
"Agent",
|
|
112
|
+
"AiLocateElement",
|
|
113
|
+
"ExecutionDump",
|
|
114
|
+
"GroupedActionDump",
|
|
115
|
+
"MIDSCENE_MODEL_NAME",
|
|
116
|
+
"PointSchema",
|
|
117
|
+
"RectSchema",
|
|
118
|
+
"ReportGenerator",
|
|
119
|
+
"ScreenshotItem",
|
|
120
|
+
"Service",
|
|
121
|
+
"ServiceError",
|
|
122
|
+
"SizeSchema",
|
|
123
|
+
"TMultimodalPromptSchema",
|
|
124
|
+
"TUserPromptSchema",
|
|
125
|
+
"TaskRunner",
|
|
126
|
+
"createAgent",
|
|
127
|
+
"default",
|
|
128
|
+
"escapeContent",
|
|
129
|
+
"generateDumpScriptTag",
|
|
130
|
+
"generateImageScriptTag",
|
|
131
|
+
"getMidsceneLocationSchema",
|
|
132
|
+
"getVersion",
|
|
133
|
+
"nullReportGenerator",
|
|
134
|
+
"parseDumpScript",
|
|
135
|
+
"parseDumpScriptAttributes",
|
|
136
|
+
"parseImageScripts",
|
|
137
|
+
"plan",
|
|
138
|
+
"restoreImageReferences",
|
|
139
|
+
"unescapeContent",
|
|
140
|
+
"z"
|
|
141
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
142
|
+
Object.defineProperty(exports, '__esModule', {
|
|
143
|
+
value: true
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["webpack/runtime/compat_get_default_export","webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../src/index.ts"],"sourcesContent":["// getDefaultExport function for compatibility with non-ESM modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};\n","__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { z } from 'zod';\nimport Service from './service/index';\nimport { TaskRunner } from './task-runner';\nimport { getVersion } from './utils';\n\nexport {\n plan,\n AiLocateElement,\n getMidsceneLocationSchema,\n PointSchema,\n SizeSchema,\n RectSchema,\n TMultimodalPromptSchema,\n TUserPromptSchema,\n type TMultimodalPrompt,\n type TUserPrompt,\n} from './ai-model/index';\n\nexport {\n MIDSCENE_MODEL_NAME,\n type CreateOpenAIClientFn,\n} from '@midscene/shared/env';\n\nexport type * from './types';\nexport {\n ServiceError,\n ExecutionDump,\n GroupedActionDump,\n type IExecutionDump,\n type IGroupedActionDump,\n type GroupMeta,\n} from './types';\n\nexport { z };\n\nexport default Service;\nexport { TaskRunner, Service, getVersion };\n\nexport type {\n MidsceneYamlScript,\n MidsceneYamlTask,\n MidsceneYamlFlowItem,\n MidsceneYamlConfigResult,\n MidsceneYamlConfig,\n MidsceneYamlScriptWebEnv,\n MidsceneYamlScriptAndroidEnv,\n MidsceneYamlScriptIOSEnv,\n MidsceneYamlScriptEnv,\n LocateOption,\n DetailedLocateParam,\n} from './yaml';\n\nexport { Agent, type AgentOpt, type AiActOptions, createAgent } from './agent';\n\n// Dump utilities\nexport {\n restoreImageReferences,\n escapeContent,\n unescapeContent,\n parseImageScripts,\n parseDumpScript,\n parseDumpScriptAttributes,\n generateImageScriptTag,\n generateDumpScriptTag,\n} from './dump';\n\n// Report generator\nexport type { IReportGenerator } from './report-generator';\nexport { ReportGenerator, nullReportGenerator } from './report-generator';\n\n// ScreenshotItem\nexport { ScreenshotItem } from './screenshot-item';\n"],"names":["__webpack_require__","module","getter","definition","key","Object","obj","prop","Symbol","Service"],"mappings":";;;IACAA,oBAAoB,CAAC,GAAG,CAACC;QACxB,IAAIC,SAASD,UAAUA,OAAO,UAAU,GACvC,IAAOA,MAAM,CAAC,UAAU,GACxB,IAAOA;QACRD,oBAAoB,CAAC,CAACE,QAAQ;YAAE,GAAGA;QAAO;QAC1C,OAAOA;IACR;;;ICPAF,oBAAoB,CAAC,GAAG,CAAC,UAASG;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGH,oBAAoB,CAAC,CAACG,YAAYC,QAAQ,CAACJ,oBAAoB,CAAC,CAAC,UAASI,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAJ,oBAAoB,CAAC,GAAG,CAACM,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFP,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,eAAlB,OAAOQ,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC6BA,YAAeI"}
|
|
@@ -0,0 +1,200 @@
|
|
|
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
|
+
ReportGenerator: ()=>ReportGenerator,
|
|
28
|
+
nullReportGenerator: ()=>nullReportGenerator
|
|
29
|
+
});
|
|
30
|
+
const external_node_fs_namespaceObject = require("node:fs");
|
|
31
|
+
const external_node_path_namespaceObject = require("node:path");
|
|
32
|
+
const common_namespaceObject = require("@midscene/shared/common");
|
|
33
|
+
const env_namespaceObject = require("@midscene/shared/env");
|
|
34
|
+
const utils_namespaceObject = require("@midscene/shared/utils");
|
|
35
|
+
const html_utils_js_namespaceObject = require("./dump/html-utils.js");
|
|
36
|
+
const external_types_js_namespaceObject = require("./types.js");
|
|
37
|
+
const external_utils_js_namespaceObject = require("./utils.js");
|
|
38
|
+
function _define_property(obj, key, value) {
|
|
39
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
40
|
+
value: value,
|
|
41
|
+
enumerable: true,
|
|
42
|
+
configurable: true,
|
|
43
|
+
writable: true
|
|
44
|
+
});
|
|
45
|
+
else obj[key] = value;
|
|
46
|
+
return obj;
|
|
47
|
+
}
|
|
48
|
+
const nullReportGenerator = {
|
|
49
|
+
onExecutionUpdate: ()=>{},
|
|
50
|
+
flush: async ()=>{},
|
|
51
|
+
finalize: async ()=>void 0,
|
|
52
|
+
getReportPath: ()=>void 0
|
|
53
|
+
};
|
|
54
|
+
class ReportGenerator {
|
|
55
|
+
static create(reportFileName, opts) {
|
|
56
|
+
if (false === opts.generateReport) return nullReportGenerator;
|
|
57
|
+
if (utils_namespaceObject.ifInBrowser) return nullReportGenerator;
|
|
58
|
+
if ('html-and-external-assets' === opts.outputFormat) {
|
|
59
|
+
const outputDir = (0, external_node_path_namespaceObject.join)((0, common_namespaceObject.getMidsceneRunSubDir)('report'), reportFileName);
|
|
60
|
+
return new ReportGenerator({
|
|
61
|
+
reportPath: (0, external_node_path_namespaceObject.join)(outputDir, 'index.html'),
|
|
62
|
+
screenshotMode: 'directory',
|
|
63
|
+
autoPrint: opts.autoPrintReportMsg
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
return new ReportGenerator({
|
|
67
|
+
reportPath: (0, external_node_path_namespaceObject.join)((0, common_namespaceObject.getMidsceneRunSubDir)('report'), `${reportFileName}.html`),
|
|
68
|
+
screenshotMode: 'inline',
|
|
69
|
+
autoPrint: opts.autoPrintReportMsg
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
onExecutionUpdate(execution, groupMeta) {
|
|
73
|
+
this.lastExecution = execution;
|
|
74
|
+
this.lastGroupMeta = groupMeta;
|
|
75
|
+
this.writeQueue = this.writeQueue.then(()=>{
|
|
76
|
+
if (this.destroyed) return;
|
|
77
|
+
this.doWriteExecution(execution, groupMeta);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
async flush() {
|
|
81
|
+
await this.writeQueue;
|
|
82
|
+
}
|
|
83
|
+
async finalize() {
|
|
84
|
+
if (this.lastExecution && this.lastGroupMeta) this.onExecutionUpdate(this.lastExecution, this.lastGroupMeta);
|
|
85
|
+
await this.flush();
|
|
86
|
+
this.destroyed = true;
|
|
87
|
+
if (!this.initialized) return;
|
|
88
|
+
this.printReportPath('finalized');
|
|
89
|
+
return this.reportPath;
|
|
90
|
+
}
|
|
91
|
+
getReportPath() {
|
|
92
|
+
return this.reportPath;
|
|
93
|
+
}
|
|
94
|
+
printReportPath(verb) {
|
|
95
|
+
if (!this.autoPrint || !this.reportPath) return;
|
|
96
|
+
if (env_namespaceObject.globalConfigManager.getEnvConfigInBoolean(env_namespaceObject.MIDSCENE_REPORT_QUIET)) return;
|
|
97
|
+
if ('directory' === this.screenshotMode) (0, utils_namespaceObject.logMsg)(`Midscene - report ${verb}: npx serve ${(0, external_node_path_namespaceObject.dirname)(this.reportPath)}`);
|
|
98
|
+
else (0, utils_namespaceObject.logMsg)(`Midscene - report ${verb}: ${this.reportPath}`);
|
|
99
|
+
}
|
|
100
|
+
doWriteExecution(execution, groupMeta) {
|
|
101
|
+
if ('inline' === this.screenshotMode) this.writeInlineExecution(execution, groupMeta);
|
|
102
|
+
else this.writeDirectoryExecution(execution, groupMeta);
|
|
103
|
+
if (!this.firstWriteDone) {
|
|
104
|
+
this.firstWriteDone = true;
|
|
105
|
+
this.printReportPath('generated');
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
wrapAsGroupedDump(execution, groupMeta) {
|
|
109
|
+
return new external_types_js_namespaceObject.GroupedActionDump({
|
|
110
|
+
sdkVersion: groupMeta.sdkVersion,
|
|
111
|
+
groupName: groupMeta.groupName,
|
|
112
|
+
groupDescription: groupMeta.groupDescription,
|
|
113
|
+
modelBriefs: groupMeta.modelBriefs,
|
|
114
|
+
deviceType: groupMeta.deviceType,
|
|
115
|
+
executions: [
|
|
116
|
+
execution
|
|
117
|
+
]
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
writeInlineExecution(execution, groupMeta) {
|
|
121
|
+
const dir = (0, external_node_path_namespaceObject.dirname)(this.reportPath);
|
|
122
|
+
if (!(0, external_node_fs_namespaceObject.existsSync)(dir)) (0, external_node_fs_namespaceObject.mkdirSync)(dir, {
|
|
123
|
+
recursive: true
|
|
124
|
+
});
|
|
125
|
+
if (!this.initialized) {
|
|
126
|
+
(0, external_node_fs_namespaceObject.writeFileSync)(this.reportPath, (0, external_utils_js_namespaceObject.getReportTpl)());
|
|
127
|
+
this.initialized = true;
|
|
128
|
+
}
|
|
129
|
+
const screenshots = execution.collectScreenshots();
|
|
130
|
+
for (const screenshot of screenshots)if (!this.writtenScreenshots.has(screenshot.id)) {
|
|
131
|
+
(0, external_utils_js_namespaceObject.appendFileSync)(this.reportPath, `\n${(0, html_utils_js_namespaceObject.generateImageScriptTag)(screenshot.id, screenshot.base64)}`);
|
|
132
|
+
this.writtenScreenshots.add(screenshot.id);
|
|
133
|
+
screenshot.markPersistedInline(this.reportPath);
|
|
134
|
+
}
|
|
135
|
+
const singleDump = this.wrapAsGroupedDump(execution, groupMeta);
|
|
136
|
+
const serialized = singleDump.serialize();
|
|
137
|
+
const attributes = {
|
|
138
|
+
'data-group-id': this.reportStreamId
|
|
139
|
+
};
|
|
140
|
+
(0, external_utils_js_namespaceObject.appendFileSync)(this.reportPath, `\n${(0, html_utils_js_namespaceObject.generateDumpScriptTag)(serialized, attributes)}`);
|
|
141
|
+
}
|
|
142
|
+
writeDirectoryExecution(execution, groupMeta) {
|
|
143
|
+
const dir = (0, external_node_path_namespaceObject.dirname)(this.reportPath);
|
|
144
|
+
if (!(0, external_node_fs_namespaceObject.existsSync)(dir)) (0, external_node_fs_namespaceObject.mkdirSync)(dir, {
|
|
145
|
+
recursive: true
|
|
146
|
+
});
|
|
147
|
+
const screenshotsDir = (0, external_node_path_namespaceObject.join)(dir, 'screenshots');
|
|
148
|
+
if (!(0, external_node_fs_namespaceObject.existsSync)(screenshotsDir)) (0, external_node_fs_namespaceObject.mkdirSync)(screenshotsDir, {
|
|
149
|
+
recursive: true
|
|
150
|
+
});
|
|
151
|
+
const screenshots = execution.collectScreenshots();
|
|
152
|
+
for (const screenshot of screenshots)if (!this.writtenScreenshots.has(screenshot.id)) {
|
|
153
|
+
const ext = screenshot.extension;
|
|
154
|
+
const absolutePath = (0, external_node_path_namespaceObject.join)(screenshotsDir, `${screenshot.id}.${ext}`);
|
|
155
|
+
const buffer = Buffer.from(screenshot.rawBase64, 'base64');
|
|
156
|
+
(0, external_node_fs_namespaceObject.writeFileSync)(absolutePath, buffer);
|
|
157
|
+
this.writtenScreenshots.add(screenshot.id);
|
|
158
|
+
screenshot.markPersistedToPath(`./screenshots/${screenshot.id}.${ext}`, absolutePath);
|
|
159
|
+
}
|
|
160
|
+
const singleDump = this.wrapAsGroupedDump(execution, groupMeta);
|
|
161
|
+
const serialized = singleDump.serialize();
|
|
162
|
+
const dumpAttributes = {
|
|
163
|
+
'data-group-id': this.reportStreamId
|
|
164
|
+
};
|
|
165
|
+
if (!this.initialized) {
|
|
166
|
+
(0, external_node_fs_namespaceObject.writeFileSync)(this.reportPath, `${(0, external_utils_js_namespaceObject.getReportTpl)()}${(0, html_utils_js_namespaceObject.getBaseUrlFixScript)()}`);
|
|
167
|
+
this.initialized = true;
|
|
168
|
+
}
|
|
169
|
+
(0, external_utils_js_namespaceObject.appendFileSync)(this.reportPath, `\n${(0, html_utils_js_namespaceObject.generateDumpScriptTag)(serialized, dumpAttributes)}`);
|
|
170
|
+
}
|
|
171
|
+
constructor(options){
|
|
172
|
+
_define_property(this, "reportPath", void 0);
|
|
173
|
+
_define_property(this, "screenshotMode", void 0);
|
|
174
|
+
_define_property(this, "autoPrint", void 0);
|
|
175
|
+
_define_property(this, "firstWriteDone", false);
|
|
176
|
+
_define_property(this, "reportStreamId", void 0);
|
|
177
|
+
_define_property(this, "writtenScreenshots", new Set());
|
|
178
|
+
_define_property(this, "initialized", false);
|
|
179
|
+
_define_property(this, "lastExecution", void 0);
|
|
180
|
+
_define_property(this, "lastGroupMeta", void 0);
|
|
181
|
+
_define_property(this, "writeQueue", Promise.resolve());
|
|
182
|
+
_define_property(this, "destroyed", false);
|
|
183
|
+
this.reportPath = options.reportPath;
|
|
184
|
+
this.screenshotMode = options.screenshotMode;
|
|
185
|
+
this.autoPrint = options.autoPrint ?? true;
|
|
186
|
+
this.reportStreamId = (0, utils_namespaceObject.uuid)();
|
|
187
|
+
this.printReportPath('will be generated at');
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
exports.ReportGenerator = __webpack_exports__.ReportGenerator;
|
|
191
|
+
exports.nullReportGenerator = __webpack_exports__.nullReportGenerator;
|
|
192
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
193
|
+
"ReportGenerator",
|
|
194
|
+
"nullReportGenerator"
|
|
195
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
196
|
+
Object.defineProperty(exports, '__esModule', {
|
|
197
|
+
value: true
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
//# sourceMappingURL=report-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report-generator.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../src/report-generator.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 { existsSync, mkdirSync, writeFileSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { getMidsceneRunSubDir } from '@midscene/shared/common';\nimport {\n MIDSCENE_REPORT_QUIET,\n globalConfigManager,\n} from '@midscene/shared/env';\nimport { ifInBrowser, logMsg, uuid } from '@midscene/shared/utils';\nimport {\n generateDumpScriptTag,\n generateImageScriptTag,\n getBaseUrlFixScript,\n} from './dump/html-utils';\nimport { type ExecutionDump, type GroupMeta, GroupedActionDump } from './types';\nimport { appendFileSync, getReportTpl } from './utils';\n\nexport interface IReportGenerator {\n /**\n * Write or update a single execution.\n * Each call appends a new dump script tag. The frontend deduplicates\n * executions with the same id/name, keeping only the last one.\n *\n * @param execution Current execution's full data\n * @param groupMeta Group-level metadata (groupName, sdkVersion, etc.)\n */\n onExecutionUpdate(execution: ExecutionDump, groupMeta: GroupMeta): void;\n\n /**\n * @deprecated Use onExecutionUpdate instead. Kept for backward compatibility.\n */\n onDumpUpdate?(dump: GroupedActionDump): void;\n\n /**\n * Wait for all queued write operations to complete.\n */\n flush(): Promise<void>;\n\n /**\n * Finalize the report. Calls flush() internally.\n */\n finalize(): Promise<string | undefined>;\n\n getReportPath(): string | undefined;\n}\n\nexport const nullReportGenerator: IReportGenerator = {\n onExecutionUpdate: () => {},\n flush: async () => {},\n finalize: async () => undefined,\n getReportPath: () => undefined,\n};\n\nexport class ReportGenerator implements IReportGenerator {\n private reportPath: string;\n private screenshotMode: 'inline' | 'directory';\n private autoPrint: boolean;\n private firstWriteDone = false;\n\n // Unique identifier for this report stream — used as data-group-id\n private readonly reportStreamId: string;\n\n // Tracks screenshots already written to disk (by id) to avoid duplicates\n private writtenScreenshots = new Set<string>();\n private initialized = false;\n\n // Tracks the last execution + groupMeta for re-writing on finalize\n private lastExecution?: ExecutionDump;\n private lastGroupMeta?: GroupMeta;\n\n // write queue for serial execution\n private writeQueue: Promise<void> = Promise.resolve();\n private destroyed = false;\n\n constructor(options: {\n reportPath: string;\n screenshotMode: 'inline' | 'directory';\n autoPrint?: boolean;\n }) {\n this.reportPath = options.reportPath;\n this.screenshotMode = options.screenshotMode;\n this.autoPrint = options.autoPrint ?? true;\n this.reportStreamId = uuid();\n this.printReportPath('will be generated at');\n }\n\n static create(\n reportFileName: string,\n opts: {\n generateReport?: boolean;\n outputFormat?: 'single-html' | 'html-and-external-assets';\n autoPrintReportMsg?: boolean;\n },\n ): IReportGenerator {\n if (opts.generateReport === false) return nullReportGenerator;\n\n // In browser environment, file system is not available\n if (ifInBrowser) return nullReportGenerator;\n\n if (opts.outputFormat === 'html-and-external-assets') {\n const outputDir = join(getMidsceneRunSubDir('report'), reportFileName);\n return new ReportGenerator({\n reportPath: join(outputDir, 'index.html'),\n screenshotMode: 'directory',\n autoPrint: opts.autoPrintReportMsg,\n });\n }\n\n return new ReportGenerator({\n reportPath: join(\n getMidsceneRunSubDir('report'),\n `${reportFileName}.html`,\n ),\n screenshotMode: 'inline',\n autoPrint: opts.autoPrintReportMsg,\n });\n }\n\n onExecutionUpdate(execution: ExecutionDump, groupMeta: GroupMeta): void {\n this.lastExecution = execution;\n this.lastGroupMeta = groupMeta;\n this.writeQueue = this.writeQueue.then(() => {\n if (this.destroyed) return;\n this.doWriteExecution(execution, groupMeta);\n });\n }\n\n async flush(): Promise<void> {\n await this.writeQueue;\n }\n\n async finalize(): Promise<string | undefined> {\n // Re-write the last execution to capture any final state changes\n if (this.lastExecution && this.lastGroupMeta) {\n this.onExecutionUpdate(this.lastExecution, this.lastGroupMeta);\n }\n await this.flush();\n this.destroyed = true;\n\n if (!this.initialized) {\n // No executions were ever written — no file exists\n return undefined;\n }\n\n this.printReportPath('finalized');\n return this.reportPath;\n }\n\n getReportPath(): string | undefined {\n return this.reportPath;\n }\n\n private printReportPath(verb: string): void {\n if (!this.autoPrint || !this.reportPath) return;\n if (globalConfigManager.getEnvConfigInBoolean(MIDSCENE_REPORT_QUIET))\n return;\n\n if (this.screenshotMode === 'directory') {\n logMsg(\n `Midscene - report ${verb}: npx serve ${dirname(this.reportPath)}`,\n );\n } else {\n logMsg(`Midscene - report ${verb}: ${this.reportPath}`);\n }\n }\n\n private doWriteExecution(\n execution: ExecutionDump,\n groupMeta: GroupMeta,\n ): void {\n if (this.screenshotMode === 'inline') {\n this.writeInlineExecution(execution, groupMeta);\n } else {\n this.writeDirectoryExecution(execution, groupMeta);\n }\n if (!this.firstWriteDone) {\n this.firstWriteDone = true;\n this.printReportPath('generated');\n }\n }\n\n /**\n * Wrap an ExecutionDump + GroupMeta into a single-execution GroupedActionDump.\n */\n private wrapAsGroupedDump(\n execution: ExecutionDump,\n groupMeta: GroupMeta,\n ): GroupedActionDump {\n return new GroupedActionDump({\n sdkVersion: groupMeta.sdkVersion,\n groupName: groupMeta.groupName,\n groupDescription: groupMeta.groupDescription,\n modelBriefs: groupMeta.modelBriefs,\n deviceType: groupMeta.deviceType,\n executions: [execution],\n });\n }\n\n /**\n * Append-only inline mode: write new screenshots and a dump tag on every call.\n * The frontend deduplicates executions with the same id/name (keeps last).\n * Duplicate dump JSON is acceptable; only screenshots are deduplicated.\n */\n private writeInlineExecution(\n execution: ExecutionDump,\n groupMeta: GroupMeta,\n ): void {\n const dir = dirname(this.reportPath);\n if (!existsSync(dir)) {\n mkdirSync(dir, { recursive: true });\n }\n\n // Initialize: write HTML template once\n if (!this.initialized) {\n writeFileSync(this.reportPath, getReportTpl());\n this.initialized = true;\n }\n\n // Append new screenshots (skip already-written ones)\n const screenshots = execution.collectScreenshots();\n for (const screenshot of screenshots) {\n if (!this.writtenScreenshots.has(screenshot.id)) {\n appendFileSync(\n this.reportPath,\n `\\n${generateImageScriptTag(screenshot.id, screenshot.base64)}`,\n );\n this.writtenScreenshots.add(screenshot.id);\n // Safe to release memory — the image tag is permanent (never truncated)\n screenshot.markPersistedInline(this.reportPath);\n }\n }\n\n // Append dump tag (always — frontend keeps only last per execution id)\n const singleDump = this.wrapAsGroupedDump(execution, groupMeta);\n const serialized = singleDump.serialize();\n const attributes: Record<string, string> = {\n 'data-group-id': this.reportStreamId,\n };\n appendFileSync(\n this.reportPath,\n `\\n${generateDumpScriptTag(serialized, attributes)}`,\n );\n }\n\n private writeDirectoryExecution(\n execution: ExecutionDump,\n groupMeta: GroupMeta,\n ): void {\n const dir = dirname(this.reportPath);\n if (!existsSync(dir)) {\n mkdirSync(dir, { recursive: true });\n }\n\n // create screenshots subdirectory\n const screenshotsDir = join(dir, 'screenshots');\n if (!existsSync(screenshotsDir)) {\n mkdirSync(screenshotsDir, { recursive: true });\n }\n\n // 1. Write new screenshots and release memory immediately\n const screenshots = execution.collectScreenshots();\n for (const screenshot of screenshots) {\n if (!this.writtenScreenshots.has(screenshot.id)) {\n const ext = screenshot.extension;\n const absolutePath = join(screenshotsDir, `${screenshot.id}.${ext}`);\n const buffer = Buffer.from(screenshot.rawBase64, 'base64');\n writeFileSync(absolutePath, buffer);\n this.writtenScreenshots.add(screenshot.id);\n screenshot.markPersistedToPath(\n `./screenshots/${screenshot.id}.${ext}`,\n absolutePath,\n );\n }\n }\n\n // 2. Append dump tag (always — frontend keeps only last per execution id)\n const singleDump = this.wrapAsGroupedDump(execution, groupMeta);\n const serialized = singleDump.serialize();\n const dumpAttributes: Record<string, string> = {\n 'data-group-id': this.reportStreamId,\n };\n\n if (!this.initialized) {\n writeFileSync(\n this.reportPath,\n `${getReportTpl()}${getBaseUrlFixScript()}`,\n );\n this.initialized = true;\n }\n\n appendFileSync(\n this.reportPath,\n `\\n${generateDumpScriptTag(serialized, dumpAttributes)}`,\n );\n }\n}\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","nullReportGenerator","undefined","ReportGenerator","reportFileName","opts","ifInBrowser","outputDir","join","getMidsceneRunSubDir","execution","groupMeta","verb","globalConfigManager","MIDSCENE_REPORT_QUIET","logMsg","dirname","GroupedActionDump","dir","existsSync","mkdirSync","writeFileSync","getReportTpl","screenshots","screenshot","appendFileSync","generateImageScriptTag","singleDump","serialized","attributes","generateDumpScriptTag","screenshotsDir","ext","absolutePath","buffer","Buffer","dumpAttributes","getBaseUrlFixScript","options","Set","Promise","uuid"],"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,K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AAAA;QACtB,IAAI,CAAC,eAAe,CAAC;IACvB;AAmNF"}
|
|
@@ -0,0 +1,171 @@
|
|
|
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
|
+
ReportMergingTool: ()=>ReportMergingTool
|
|
28
|
+
});
|
|
29
|
+
const external_node_fs_namespaceObject = require("node:fs");
|
|
30
|
+
const external_node_path_namespaceObject = require("node:path");
|
|
31
|
+
const common_namespaceObject = require("@midscene/shared/common");
|
|
32
|
+
const utils_namespaceObject = require("@midscene/shared/utils");
|
|
33
|
+
const index_js_namespaceObject = require("./agent/index.js");
|
|
34
|
+
const html_utils_js_namespaceObject = require("./dump/html-utils.js");
|
|
35
|
+
const external_types_js_namespaceObject = require("./types.js");
|
|
36
|
+
const external_utils_js_namespaceObject = require("./utils.js");
|
|
37
|
+
function _define_property(obj, key, value) {
|
|
38
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
39
|
+
value: value,
|
|
40
|
+
enumerable: true,
|
|
41
|
+
configurable: true,
|
|
42
|
+
writable: true
|
|
43
|
+
});
|
|
44
|
+
else obj[key] = value;
|
|
45
|
+
return obj;
|
|
46
|
+
}
|
|
47
|
+
class ReportMergingTool {
|
|
48
|
+
append(reportInfo) {
|
|
49
|
+
this.reportInfos.push(reportInfo);
|
|
50
|
+
}
|
|
51
|
+
clear() {
|
|
52
|
+
this.reportInfos = [];
|
|
53
|
+
}
|
|
54
|
+
isDirectoryModeReport(reportFilePath) {
|
|
55
|
+
const reportDir = external_node_path_namespaceObject.dirname(reportFilePath);
|
|
56
|
+
return 'index.html' === external_node_path_namespaceObject.basename(reportFilePath) && (0, external_node_fs_namespaceObject.existsSync)(external_node_path_namespaceObject.join(reportDir, 'screenshots'));
|
|
57
|
+
}
|
|
58
|
+
mergeDumpScripts(contents) {
|
|
59
|
+
const unescaped = contents.map((c)=>(0, utils_namespaceObject.antiEscapeScriptTag)(c)).filter((c)=>c.length > 0);
|
|
60
|
+
if (0 === unescaped.length) return '';
|
|
61
|
+
if (1 === unescaped.length) return unescaped[0];
|
|
62
|
+
const base = external_types_js_namespaceObject.GroupedActionDump.fromSerializedString(unescaped[0]);
|
|
63
|
+
const allExecutions = [
|
|
64
|
+
...base.executions
|
|
65
|
+
];
|
|
66
|
+
for(let i = 1; i < unescaped.length; i++){
|
|
67
|
+
const other = external_types_js_namespaceObject.GroupedActionDump.fromSerializedString(unescaped[i]);
|
|
68
|
+
allExecutions.push(...other.executions);
|
|
69
|
+
}
|
|
70
|
+
let noIdCounter = 0;
|
|
71
|
+
const deduped = new Map();
|
|
72
|
+
for (const exec of allExecutions){
|
|
73
|
+
const key = exec.id || `__no_id_${noIdCounter++}`;
|
|
74
|
+
deduped.set(key, exec);
|
|
75
|
+
}
|
|
76
|
+
base.executions = Array.from(deduped.values());
|
|
77
|
+
return base.serialize();
|
|
78
|
+
}
|
|
79
|
+
mergeReports(reportFileName = 'AUTO', opts) {
|
|
80
|
+
if (this.reportInfos.length <= 1) {
|
|
81
|
+
(0, utils_namespaceObject.logMsg)('Not enough reports to merge');
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
const { rmOriginalReports = false, overwrite = false } = opts ?? {};
|
|
85
|
+
const targetDir = (0, common_namespaceObject.getMidsceneRunSubDir)('report');
|
|
86
|
+
const hasDirectoryModeReport = this.reportInfos.some((info)=>this.isDirectoryModeReport(info.reportFilePath));
|
|
87
|
+
const resolvedName = 'AUTO' === reportFileName ? (0, index_js_namespaceObject.getReportFileName)('merged-report') : reportFileName;
|
|
88
|
+
const outputFilePath = hasDirectoryModeReport ? external_node_path_namespaceObject.resolve(targetDir, resolvedName, 'index.html') : external_node_path_namespaceObject.resolve(targetDir, `${resolvedName}.html`);
|
|
89
|
+
if ('AUTO' !== reportFileName && (0, external_node_fs_namespaceObject.existsSync)(outputFilePath)) {
|
|
90
|
+
if (!overwrite) throw new Error(`Report file already exists: ${outputFilePath}\nSet overwrite to true to overwrite this file.`);
|
|
91
|
+
if (hasDirectoryModeReport) (0, external_node_fs_namespaceObject.rmSync)(external_node_path_namespaceObject.dirname(outputFilePath), {
|
|
92
|
+
recursive: true,
|
|
93
|
+
force: true
|
|
94
|
+
});
|
|
95
|
+
else (0, external_node_fs_namespaceObject.unlinkSync)(outputFilePath);
|
|
96
|
+
}
|
|
97
|
+
if (hasDirectoryModeReport) (0, external_node_fs_namespaceObject.mkdirSync)(external_node_path_namespaceObject.dirname(outputFilePath), {
|
|
98
|
+
recursive: true
|
|
99
|
+
});
|
|
100
|
+
(0, utils_namespaceObject.logMsg)(`Start merging ${this.reportInfos.length} reports...\nCreating template file...`);
|
|
101
|
+
try {
|
|
102
|
+
(0, external_node_fs_namespaceObject.appendFileSync)(outputFilePath, (0, external_utils_js_namespaceObject.getReportTpl)());
|
|
103
|
+
if (hasDirectoryModeReport) (0, external_node_fs_namespaceObject.appendFileSync)(outputFilePath, (0, html_utils_js_namespaceObject.getBaseUrlFixScript)());
|
|
104
|
+
for(let i = 0; i < this.reportInfos.length; i++){
|
|
105
|
+
const reportInfo = this.reportInfos[i];
|
|
106
|
+
(0, utils_namespaceObject.logMsg)(`Processing report ${i + 1}/${this.reportInfos.length}`);
|
|
107
|
+
if (this.isDirectoryModeReport(reportInfo.reportFilePath)) {
|
|
108
|
+
const reportDir = external_node_path_namespaceObject.dirname(reportInfo.reportFilePath);
|
|
109
|
+
const screenshotsDir = external_node_path_namespaceObject.join(reportDir, 'screenshots');
|
|
110
|
+
const mergedScreenshotsDir = external_node_path_namespaceObject.join(external_node_path_namespaceObject.dirname(outputFilePath), 'screenshots');
|
|
111
|
+
(0, external_node_fs_namespaceObject.mkdirSync)(mergedScreenshotsDir, {
|
|
112
|
+
recursive: true
|
|
113
|
+
});
|
|
114
|
+
for (const file of (0, external_node_fs_namespaceObject.readdirSync)(screenshotsDir)){
|
|
115
|
+
const src = external_node_path_namespaceObject.join(screenshotsDir, file);
|
|
116
|
+
const dest = external_node_path_namespaceObject.join(mergedScreenshotsDir, file);
|
|
117
|
+
(0, external_node_fs_namespaceObject.copyFileSync)(src, dest);
|
|
118
|
+
}
|
|
119
|
+
} else (0, html_utils_js_namespaceObject.streamImageScriptsToFile)(reportInfo.reportFilePath, outputFilePath);
|
|
120
|
+
const allDumps = (0, html_utils_js_namespaceObject.extractAllDumpScriptsSync)(reportInfo.reportFilePath).filter((d)=>d.openTag.includes('data-group-id'));
|
|
121
|
+
const groupIdMatch = allDumps[0]?.openTag.match(/data-group-id="([^"]+)"/);
|
|
122
|
+
const mergedGroupId = groupIdMatch ? decodeURIComponent(groupIdMatch[1]) : `merged-group-${i}`;
|
|
123
|
+
const dumpString = allDumps.length > 0 ? this.mergeDumpScripts(allDumps.map((d)=>d.content)) : (0, html_utils_js_namespaceObject.extractLastDumpScriptSync)(reportInfo.reportFilePath);
|
|
124
|
+
const { reportAttributes } = reportInfo;
|
|
125
|
+
const reportHtmlStr = `${(0, external_utils_js_namespaceObject.reportHTMLContent)({
|
|
126
|
+
dumpString,
|
|
127
|
+
attributes: {
|
|
128
|
+
'data-group-id': mergedGroupId,
|
|
129
|
+
playwright_test_duration: reportAttributes.testDuration,
|
|
130
|
+
playwright_test_status: reportAttributes.testStatus,
|
|
131
|
+
playwright_test_title: reportAttributes.testTitle,
|
|
132
|
+
playwright_test_id: reportAttributes.testId,
|
|
133
|
+
playwright_test_description: reportAttributes.testDescription
|
|
134
|
+
}
|
|
135
|
+
}, void 0, void 0, false)}\n`;
|
|
136
|
+
(0, external_node_fs_namespaceObject.appendFileSync)(outputFilePath, reportHtmlStr);
|
|
137
|
+
}
|
|
138
|
+
(0, utils_namespaceObject.logMsg)(`Successfully merged new report: ${outputFilePath}`);
|
|
139
|
+
if (rmOriginalReports) {
|
|
140
|
+
for (const info of this.reportInfos)try {
|
|
141
|
+
if (this.isDirectoryModeReport(info.reportFilePath)) {
|
|
142
|
+
const reportDir = external_node_path_namespaceObject.dirname(info.reportFilePath);
|
|
143
|
+
(0, external_node_fs_namespaceObject.rmSync)(reportDir, {
|
|
144
|
+
recursive: true,
|
|
145
|
+
force: true
|
|
146
|
+
});
|
|
147
|
+
} else (0, external_node_fs_namespaceObject.unlinkSync)(info.reportFilePath);
|
|
148
|
+
} catch (error) {
|
|
149
|
+
(0, utils_namespaceObject.logMsg)(`Error deleting report ${info.reportFilePath}: ${error}`);
|
|
150
|
+
}
|
|
151
|
+
(0, utils_namespaceObject.logMsg)(`Removed ${this.reportInfos.length} original reports`);
|
|
152
|
+
}
|
|
153
|
+
return outputFilePath;
|
|
154
|
+
} catch (error) {
|
|
155
|
+
(0, utils_namespaceObject.logMsg)(`Error in mergeReports: ${error}`);
|
|
156
|
+
throw error;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
constructor(){
|
|
160
|
+
_define_property(this, "reportInfos", []);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
exports.ReportMergingTool = __webpack_exports__.ReportMergingTool;
|
|
164
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
165
|
+
"ReportMergingTool"
|
|
166
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
167
|
+
Object.defineProperty(exports, '__esModule', {
|
|
168
|
+
value: true
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
//# sourceMappingURL=report.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../src/report.ts"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import {\n appendFileSync,\n copyFileSync,\n existsSync,\n mkdirSync,\n readdirSync,\n rmSync,\n unlinkSync,\n} from 'node:fs';\nimport * as path from 'node:path';\nimport { getMidsceneRunSubDir } from '@midscene/shared/common';\nimport { antiEscapeScriptTag, logMsg } from '@midscene/shared/utils';\nimport { getReportFileName } from './agent';\nimport {\n extractAllDumpScriptsSync,\n extractLastDumpScriptSync,\n getBaseUrlFixScript,\n streamImageScriptsToFile,\n} from './dump/html-utils';\nimport { GroupedActionDump } from './types';\nimport type { ReportFileWithAttributes } from './types';\nimport { getReportTpl, reportHTMLContent } from './utils';\n\nexport class ReportMergingTool {\n private reportInfos: ReportFileWithAttributes[] = [];\n public append(reportInfo: ReportFileWithAttributes) {\n this.reportInfos.push(reportInfo);\n }\n public clear() {\n this.reportInfos = [];\n }\n\n /**\n * Check if a report is in directory mode (html-and-external-assets).\n * Directory mode reports: {name}/index.html + {name}/screenshots/\n */\n private isDirectoryModeReport(reportFilePath: string): boolean {\n const reportDir = path.dirname(reportFilePath);\n return (\n path.basename(reportFilePath) === 'index.html' &&\n existsSync(path.join(reportDir, 'screenshots'))\n );\n }\n\n /**\n * Merge multiple dump script contents (from the same source report)\n * into a single serialized GroupedActionDump string.\n * If there's only one dump, return it as-is. If multiple, merge\n * all executions into the first dump's group structure.\n */\n private mergeDumpScripts(contents: string[]): string {\n const unescaped = contents\n .map((c) => antiEscapeScriptTag(c))\n .filter((c) => c.length > 0);\n if (unescaped.length === 0) return '';\n if (unescaped.length === 1) return unescaped[0];\n\n // Parse all dumps and collect executions, deduplicating by id (keep last).\n // Only executions with a stable id are deduped; old-format entries without\n // id are always kept (they may be distinct despite sharing the same name).\n const base = GroupedActionDump.fromSerializedString(unescaped[0]);\n const allExecutions = [...base.executions];\n for (let i = 1; i < unescaped.length; i++) {\n const other = GroupedActionDump.fromSerializedString(unescaped[i]);\n allExecutions.push(...other.executions);\n }\n let noIdCounter = 0;\n const deduped = new Map<string, (typeof allExecutions)[0]>();\n for (const exec of allExecutions) {\n const key = exec.id || `__no_id_${noIdCounter++}`;\n deduped.set(key, exec);\n }\n base.executions = Array.from(deduped.values());\n return base.serialize();\n }\n\n public mergeReports(\n reportFileName: 'AUTO' | string = 'AUTO',\n opts?: {\n rmOriginalReports?: boolean;\n overwrite?: boolean;\n },\n ): string | null {\n if (this.reportInfos.length <= 1) {\n logMsg('Not enough reports to merge');\n return null;\n }\n\n const { rmOriginalReports = false, overwrite = false } = opts ?? {};\n const targetDir = getMidsceneRunSubDir('report');\n\n // Check if any source report is directory mode\n const hasDirectoryModeReport = this.reportInfos.some((info) =>\n this.isDirectoryModeReport(info.reportFilePath),\n );\n\n const resolvedName =\n reportFileName === 'AUTO'\n ? getReportFileName('merged-report')\n : reportFileName;\n\n // Directory mode: output as {name}/index.html to keep relative paths working\n // Inline mode: output as {name}.html (single file)\n const outputFilePath = hasDirectoryModeReport\n ? path.resolve(targetDir, resolvedName, 'index.html')\n : path.resolve(targetDir, `${resolvedName}.html`);\n\n if (reportFileName !== 'AUTO' && existsSync(outputFilePath)) {\n if (!overwrite) {\n throw new Error(\n `Report file already exists: ${outputFilePath}\\nSet overwrite to true to overwrite this file.`,\n );\n }\n if (hasDirectoryModeReport) {\n rmSync(path.dirname(outputFilePath), { recursive: true, force: true });\n } else {\n unlinkSync(outputFilePath);\n }\n }\n\n if (hasDirectoryModeReport) {\n mkdirSync(path.dirname(outputFilePath), { recursive: true });\n }\n\n logMsg(\n `Start merging ${this.reportInfos.length} reports...\\nCreating template file...`,\n );\n\n try {\n // Write template\n appendFileSync(outputFilePath, getReportTpl());\n\n // For directory-mode output, inject base URL fix script\n if (hasDirectoryModeReport) {\n appendFileSync(outputFilePath, getBaseUrlFixScript());\n }\n\n // Process all reports one by one\n for (let i = 0; i < this.reportInfos.length; i++) {\n const reportInfo = this.reportInfos[i];\n logMsg(`Processing report ${i + 1}/${this.reportInfos.length}`);\n\n if (this.isDirectoryModeReport(reportInfo.reportFilePath)) {\n // Directory mode: copy external screenshot files\n const reportDir = path.dirname(reportInfo.reportFilePath);\n const screenshotsDir = path.join(reportDir, 'screenshots');\n const mergedScreenshotsDir = path.join(\n path.dirname(outputFilePath),\n 'screenshots',\n );\n mkdirSync(mergedScreenshotsDir, { recursive: true });\n for (const file of readdirSync(screenshotsDir)) {\n const src = path.join(screenshotsDir, file);\n const dest = path.join(mergedScreenshotsDir, file);\n copyFileSync(src, dest);\n }\n } else {\n // Inline mode: stream image scripts to output file\n streamImageScriptsToFile(reportInfo.reportFilePath, outputFilePath);\n }\n\n // Extract all dump scripts from the source report.\n // After the per-execution append refactor, a single source report\n // may contain multiple <script type=\"midscene_web_dump\"> tags\n // (one per execution). We merge them into a single GroupedActionDump.\n // Filter by data-group-id to exclude false matches from the template's\n // bundled JS code, which also references the midscene_web_dump type string.\n const allDumps = extractAllDumpScriptsSync(\n reportInfo.reportFilePath,\n ).filter((d) => d.openTag.includes('data-group-id'));\n const groupIdMatch = allDumps[0]?.openTag.match(\n /data-group-id=\"([^\"]+)\"/,\n );\n const mergedGroupId = groupIdMatch\n ? decodeURIComponent(groupIdMatch[1])\n : `merged-group-${i}`;\n const dumpString =\n allDumps.length > 0\n ? this.mergeDumpScripts(allDumps.map((d) => d.content))\n : extractLastDumpScriptSync(reportInfo.reportFilePath);\n const { reportAttributes } = reportInfo;\n\n const reportHtmlStr = `${reportHTMLContent(\n {\n dumpString,\n attributes: {\n 'data-group-id': mergedGroupId,\n playwright_test_duration: reportAttributes.testDuration,\n playwright_test_status: reportAttributes.testStatus,\n playwright_test_title: reportAttributes.testTitle,\n playwright_test_id: reportAttributes.testId,\n playwright_test_description: reportAttributes.testDescription,\n },\n },\n undefined,\n undefined,\n false,\n )}\\n`;\n\n appendFileSync(outputFilePath, reportHtmlStr);\n }\n\n logMsg(`Successfully merged new report: ${outputFilePath}`);\n\n // Remove original reports if needed\n if (rmOriginalReports) {\n for (const info of this.reportInfos) {\n try {\n if (this.isDirectoryModeReport(info.reportFilePath)) {\n // Directory mode: remove the entire report directory\n const reportDir = path.dirname(info.reportFilePath);\n rmSync(reportDir, { recursive: true, force: true });\n } else {\n unlinkSync(info.reportFilePath);\n }\n } catch (error) {\n logMsg(`Error deleting report ${info.reportFilePath}: ${error}`);\n }\n }\n logMsg(`Removed ${this.reportInfos.length} original reports`);\n }\n return outputFilePath;\n } catch (error) {\n logMsg(`Error in mergeReports: ${error}`);\n throw error;\n }\n }\n}\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","ReportMergingTool","reportInfo","reportFilePath","reportDir","path","existsSync","contents","unescaped","c","antiEscapeScriptTag","base","GroupedActionDump","allExecutions","i","other","noIdCounter","deduped","Map","exec","Array","reportFileName","opts","logMsg","rmOriginalReports","overwrite","targetDir","getMidsceneRunSubDir","hasDirectoryModeReport","info","resolvedName","getReportFileName","outputFilePath","Error","rmSync","unlinkSync","mkdirSync","appendFileSync","getReportTpl","getBaseUrlFixScript","screenshotsDir","mergedScreenshotsDir","file","readdirSync","src","dest","copyFileSync","streamImageScriptsToFile","allDumps","extractAllDumpScriptsSync","d","groupIdMatch","mergedGroupId","decodeURIComponent","dumpString","extractLastDumpScriptSync","reportAttributes","reportHtmlStr","reportHTMLContent","undefined","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;;;;;;;;;;;;;;;;;;;;;;;;;ACiBO,MAAMI;IAEJ,OAAOC,UAAoC,EAAE;QAClD,IAAI,CAAC,WAAW,CAAC,IAAI,CAACA;IACxB;IACO,QAAQ;QACb,IAAI,CAAC,WAAW,GAAG,EAAE;IACvB;IAMQ,sBAAsBC,cAAsB,EAAW;QAC7D,MAAMC,YAAYC,mCAAAA,OAAY,CAACF;QAC/B,OACEE,AAAkC,iBAAlCA,mCAAAA,QAAa,CAACF,mBACdG,AAAAA,IAAAA,iCAAAA,UAAAA,AAAAA,EAAWD,mCAAAA,IAAS,CAACD,WAAW;IAEpC;IAQQ,iBAAiBG,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