@midscene/core 1.17.6 → 1.17.7
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-report-manager.mjs +1 -1
- package/dist/es/agent/agent-report-manager.mjs.map +1 -1
- package/dist/es/agent/utils.mjs +1 -1
- package/dist/es/ai-model/model-adapter/locate-prompt-order.mjs +80 -0
- package/dist/es/ai-model/model-adapter/locate-prompt-order.mjs.map +1 -0
- package/dist/es/ai-model/model-adapter/locate.mjs +2 -1
- package/dist/es/ai-model/model-adapter/locate.mjs.map +1 -1
- package/dist/es/ai-model/workflows/grounding/locate.mjs +1 -1
- package/dist/es/ai-model/workflows/grounding/locate.mjs.map +1 -1
- package/dist/es/ai-model/workflows/grounding/section-locate.mjs +1 -1
- package/dist/es/ai-model/workflows/grounding/section-locate.mjs.map +1 -1
- package/dist/es/ai-model/workflows/grounding/utils.mjs +8 -26
- package/dist/es/ai-model/workflows/grounding/utils.mjs.map +1 -1
- package/dist/es/dump/report-image-export.mjs +58 -0
- package/dist/es/dump/report-image-export.mjs.map +1 -0
- package/dist/es/dump/screenshot-store.mjs +5 -0
- package/dist/es/dump/screenshot-store.mjs.map +1 -1
- package/dist/es/report-cli.mjs +13 -29
- package/dist/es/report-cli.mjs.map +1 -1
- package/dist/es/report-generator.mjs +22 -8
- package/dist/es/report-generator.mjs.map +1 -1
- package/dist/es/report-html-template.mjs +1 -1
- package/dist/es/report-markdown.mjs +50 -53
- package/dist/es/report-markdown.mjs.map +1 -1
- package/dist/es/report.mjs +8 -24
- package/dist/es/report.mjs.map +1 -1
- package/dist/es/utils.mjs +1 -1
- package/dist/lib/agent/agent-report-manager.js +1 -1
- package/dist/lib/agent/agent-report-manager.js.map +1 -1
- package/dist/lib/agent/utils.js +1 -1
- package/dist/lib/ai-model/model-adapter/locate-prompt-order.js +117 -0
- package/dist/lib/ai-model/model-adapter/locate-prompt-order.js.map +1 -0
- package/dist/lib/ai-model/model-adapter/locate.js +2 -1
- package/dist/lib/ai-model/model-adapter/locate.js.map +1 -1
- package/dist/lib/ai-model/workflows/grounding/locate.js +1 -1
- package/dist/lib/ai-model/workflows/grounding/locate.js.map +1 -1
- package/dist/lib/ai-model/workflows/grounding/section-locate.js +1 -1
- package/dist/lib/ai-model/workflows/grounding/section-locate.js.map +1 -1
- package/dist/lib/ai-model/workflows/grounding/utils.js +8 -26
- package/dist/lib/ai-model/workflows/grounding/utils.js.map +1 -1
- package/dist/lib/dump/report-image-export.js +92 -0
- package/dist/lib/dump/report-image-export.js.map +1 -0
- package/dist/lib/dump/screenshot-store.js +5 -0
- package/dist/lib/dump/screenshot-store.js.map +1 -1
- package/dist/lib/report-cli.js +12 -28
- package/dist/lib/report-cli.js.map +1 -1
- package/dist/lib/report-generator.js +22 -8
- package/dist/lib/report-generator.js.map +1 -1
- package/dist/lib/report-html-template.js +1 -1
- package/dist/lib/report-markdown.js +50 -53
- package/dist/lib/report-markdown.js.map +1 -1
- package/dist/lib/report.js +6 -22
- package/dist/lib/report.js.map +1 -1
- package/dist/lib/utils.js +1 -1
- package/dist/types/ai-model/model-adapter/locate-prompt-order.d.ts +24 -0
- package/dist/types/ai-model/model-adapter/locate-prompt-order.d.ts.map +1 -0
- package/dist/types/ai-model/model-adapter/locate.d.ts.map +1 -1
- package/dist/types/ai-model/model-adapter/types.d.ts +9 -3
- package/dist/types/ai-model/model-adapter/types.d.ts.map +1 -1
- package/dist/types/ai-model/workflows/grounding/utils.d.ts +4 -9
- package/dist/types/ai-model/workflows/grounding/utils.d.ts.map +1 -1
- package/dist/types/dump/report-image-export.d.ts +12 -0
- package/dist/types/dump/report-image-export.d.ts.map +1 -0
- package/dist/types/dump/screenshot-store.d.ts +2 -0
- package/dist/types/dump/screenshot-store.d.ts.map +1 -1
- package/dist/types/report-cli.d.ts.map +1 -1
- package/dist/types/report-generator.d.ts +4 -2
- package/dist/types/report-generator.d.ts.map +1 -1
- package/dist/types/report-markdown.d.ts +4 -2
- package/dist/types/report-markdown.d.ts.map +1 -1
- package/dist/types/report.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/lib/report.js.map
CHANGED
|
@@ -1 +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 mkdtempSync,\n readFileSync,\n readdirSync,\n renameSync,\n rmSync,\n unlinkSync,\n writeFileSync,\n} from 'node:fs';\nimport * as fsAsync from 'node:fs/promises';\nimport * as path from 'node:path';\nimport { getMidsceneRunSubDir } from '@midscene/shared/common';\nimport { antiEscapeScriptTag, logMsg, uuid } from '@midscene/shared/utils';\nimport { getReportFileName } from './agent/report-file-name';\nimport {\n DATA_SCREENSHOT_MODE_ATTR,\n extractLastDumpScriptSync,\n generateAgentReportComment,\n getBaseUrlFixScript,\n generateTestRunReportScriptTag as runnerDumpScript,\n streamDumpScriptsSync,\n streamImageScriptsToFile,\n} from './dump/html-utils';\nimport {\n imageRefFileExtension,\n normalizeStoredImageRef,\n} from './dump/image-reference';\nimport {\n readReportArtifactManifest,\n readReportDumpScripts,\n readReportRunnerDump,\n streamReportDumpScripts,\n} from './dump/report-artifact-reader';\nimport {\n parseBase64ImageDataUrl,\n resolveImageSource,\n} from './dump/screenshot-store';\nexport {\n readReportActionDump,\n readReportArtifactManifestAsync,\n readReportArtifactManifest,\n readReportDumpScripts,\n readReportRunnerDump,\n streamReportDumpScripts,\n} from './dump/report-artifact-reader';\nexport { ExecutionRecorder } from './dump/execution-recorder';\nexport { ReportArtifactStore } from './dump/report-artifact-store';\nexport { ReportSession } from './dump/report-session';\nimport {\n publishReportArtifact,\n publishReportArtifactSync,\n} from './dump/report-artifact-publication';\nimport {\n ReportArtifactWriter,\n type ReportGroupAttributes,\n} from './dump/report-artifact-writer';\nimport { collectReportSummary } from './report-stats';\nimport type {\n AssembleTestRunReportOptions,\n IndexedTestRunReportSource,\n TestRunReportMetrics,\n TestRunReportSource,\n TestRunReportSourceIndex,\n} from './test-run-report';\nimport {\n type MergeTestRunReportSource,\n mergeTestRunReportDumps,\n} from './test-runner/reporting/merge-report';\nimport { collectTestRunReportMetrics } from './test-runner/reporting/metrics';\nimport {\n type ExecutionDump,\n type IExecutionDump,\n ReportActionDump,\n type ScreenshotMode,\n} from './types';\nimport type { ReportFileWithAttributes } from './types';\nimport { getReportTpl, getVersion, reportHTMLContent } from './utils';\n\nexport {\n calculateTestRunHealth,\n classifyTestRunCase,\n} from './test-run-health';\n\nexport interface ExportReportArtifactOptions {\n reportPath: string;\n outputDir: string;\n reportFileName: string;\n outputFormat?: 'single-html' | 'html-and-external-assets';\n overwrite?: boolean;\n}\n\n/** Export only referenced facts and images, validating them before publishing. */\nexport async function exportReportArtifact(\n options: ExportReportArtifactOptions,\n): Promise<string> {\n validateTestRunReportFileName(options.reportFileName);\n const input = path.resolve(options.reportPath);\n const output = path.resolve(options.outputDir);\n const external = options.outputFormat === 'html-and-external-assets';\n const artifact = path.join(output, options.reportFileName);\n const destination = external\n ? path.join(artifact, 'index.html')\n : `${artifact}.html`;\n if (\n input === destination ||\n (external && input.startsWith(`${artifact}${path.sep}`))\n )\n throw new Error('Export destination must differ from the input report.');\n if (!options.overwrite && existsSync(external ? artifact : destination))\n throw new Error(`Report artifact already exists: ${artifact}`);\n const manifest = readReportArtifactManifest(input);\n const runner = readReportRunnerDump(input);\n const groups = new Map<\n string,\n { dump: ReportActionDump; attributes: ReportGroupAttributes }\n >();\n for (const source of readReportDumpScripts(input)) {\n const attributes = Object.fromEntries(\n [...source.openTag.matchAll(/([^\\s=]+)=\"([^\"]*)\"/g)]\n .filter(([, key]) => key !== 'type')\n .map(([, key, value]) => [key, decodeURIComponent(value)]),\n );\n const id = attributes['data-group-id'];\n if (!id) throw new Error('Report execution group is missing its ID.');\n const dump = ReportActionDump.fromSerializedString(\n manifest ? source.content : antiEscapeScriptTag(source.content),\n );\n const previous = groups.get(id);\n dump.executions = dedupeExecutionsKeepLatest([\n ...(previous?.dump.executions ?? []),\n ...dump.executions,\n ]);\n groups.set(id, { dump, attributes });\n }\n if (!groups.size && !runner)\n throw new Error('No report execution data was found in the input.');\n const hint = [...groups.values()][0]?.attributes['data-report-kind'];\n const kind =\n manifest?.kind ??\n (hint === 'agent' || hint === 'test' ? hint : runner ? 'test' : 'agent');\n await fsAsync.mkdir(output, { recursive: true });\n const temporary = await fsAsync.mkdtemp(path.join(output, '.report-export-'));\n const entry = path.join(temporary, 'index.html');\n try {\n const writer = new ReportArtifactWriter(\n entry,\n external,\n kind,\n manifest?.reportId ?? runner?.runId,\n );\n await writer.initialize();\n for (const [id, group] of groups)\n await writer.addGroup(\n id,\n group.dump.serialize(),\n input,\n group.attributes,\n );\n await writer.finish(\n runner,\n mergedAgentReportComment([...groups.values()].map((group) => group.dump)),\n );\n await publishReportArtifact(\n external ? temporary : entry,\n external ? artifact : destination,\n external,\n options.overwrite,\n );\n return destination;\n } finally {\n await fsAsync.rm(temporary, { recursive: true, force: true });\n }\n}\n\n/**\n * Read the screenshot storage mode a report declared at generation time.\n *\n * Reports written by current versions stamp `data-screenshot-mode` onto every\n * dump script tag, so we only need to peek at the first real dump script (the\n * template's bundled JS also references the dump type string, hence the\n * `data-group-id` filter) and can stop streaming immediately.\n *\n * Returns undefined for legacy reports that predate the attribute or for\n * unreadable files, letting the caller fall back to a filesystem heuristic.\n */\nconst screenshotModeAttrRegExp = new RegExp(\n `${DATA_SCREENSHOT_MODE_ATTR}=\"(inline|directory)\"`,\n);\n\nfunction readDeclaredScreenshotMode(\n reportFilePath: string,\n): ScreenshotMode | undefined {\n let mode: ScreenshotMode | undefined;\n try {\n streamDumpScriptsSync(reportFilePath, ({ openTag }) => {\n // Skip false matches from the template's bundled JS code.\n if (!openTag.includes('data-group-id')) return false;\n const match = openTag.match(screenshotModeAttrRegExp);\n mode = match?.[1] as ScreenshotMode | undefined;\n return true; // the first real dump script decides the mode\n });\n } catch {\n // Unreadable / non-existent file — let the caller fall back.\n }\n return mode;\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 * The mode is read from the report's own `data-screenshot-mode` metadata, which\n * is authoritative regardless of whether the run happened to capture any\n * screenshots. For legacy reports without the attribute we fall back to the old\n * filesystem heuristic (an `index.html` that has a sibling `screenshots/` dir).\n */\nexport function isDirectoryModeReport(reportFilePath: string): boolean {\n if (readReportArtifactManifest(reportFilePath)) return true;\n // Agent directory reports use index.html by default. Reports without the\n // versioned manifest use the existing metadata and layout heuristic.\n if (path.basename(reportFilePath) !== 'index.html') return false;\n\n const declared = readDeclaredScreenshotMode(reportFilePath);\n if (declared) return declared === 'directory';\n\n // Legacy fallback for reports generated before screenshotMode was embedded.\n return existsSync(path.join(path.dirname(reportFilePath), 'screenshots'));\n}\n\n/**\n * Whether a report lives in its own dedicated directory (`{name}/index.html`)\n * rather than being a single standalone file (`{name}.html`).\n *\n * This is a structural fact about *where the report file sits*, independent of\n * how it stores screenshots: a directory report can keep screenshots external\n * (a `screenshots/` sibling) OR inline them into `index.html`. Deletion needs\n * this — not the screenshot mode — to decide whether to remove the whole\n * directory or just unlink a file, so that an inline-screenshot report nested in\n * its own folder still has the folder removed instead of being orphaned.\n */\nfunction isDirectoryBasedReport(reportFilePath: string): boolean {\n return path.basename(reportFilePath) === 'index.html';\n}\n\n/**\n * Remove a complete report artifact from disk.\n *\n * Standalone reports own only their HTML file, while directory-based reports\n * own the directory containing `index.html`. Callers must decide whether they\n * own the source artifact and should only invoke this after its replacement\n * has been produced successfully.\n *\n * @param reportFilePath Path to the standalone report or directory report's\n * `index.html` entry point.\n * @throws When the owned report artifact cannot be removed.\n */\nexport function removeReportArtifact(reportFilePath: string): void {\n if (isDirectoryBasedReport(reportFilePath)) {\n rmSync(path.dirname(reportFilePath), { recursive: true, force: true });\n return;\n }\n unlinkSync(reportFilePath);\n}\n\n/**\n * Deduplicate executions by stable id, keeping only the last occurrence.\n * Old-format executions without id are always preserved.\n */\nexport function dedupeExecutionsKeepLatest<T extends Pick<ExecutionDump, 'id'>>(\n executions: T[],\n): T[] {\n let noIdCounter = 0;\n const deduped = new Map<string, T>();\n for (const exec of executions) {\n const key = exec.id || `__no_id_${noIdCounter++}`;\n deduped.set(key, exec);\n }\n return Array.from(deduped.values());\n}\n/**\n * Peek at the first `sdkVersion` field embedded in a midscene_web_dump\n * script tag inside the given report file. Returns undefined if no\n * recognizable tag or sdkVersion is present.\n */\nfunction peekReportSdkVersion(reportFilePath: string): string | undefined {\n try {\n let dump: string | undefined;\n streamReportDumpScripts(reportFilePath, ({ content }) => {\n dump = content;\n return true;\n });\n dump ??= extractLastDumpScriptSync(reportFilePath) ?? undefined;\n if (!dump) return undefined;\n const match = dump.match(/\"sdkVersion\"\\s*:\\s*\"([^\"]+)\"/);\n return match?.[1];\n } catch {\n return undefined;\n }\n}\n\nconst warnedMismatchedVersions = new Set<string>();\n\nfunction tryParseAgentReportDump(dumpString: string): ReportActionDump | null {\n const trimmed = dumpString.trimStart();\n if (!trimmed.startsWith('{') || !trimmed.includes('\"executions\"')) {\n return null;\n }\n\n try {\n return ReportActionDump.fromSerializedString(trimmed);\n } catch {\n return null;\n }\n}\n\nfunction mergedAgentReportComment(reports: ReportActionDump[]): string {\n if (reports.length === 0) {\n return '';\n }\n if (reports.length === 1) {\n return generateAgentReportComment(reports[0]);\n }\n\n const deviceTypes = Array.from(\n new Set(reports.map((report) => report.deviceType).filter(Boolean)),\n );\n const mergedReport = new ReportActionDump({\n sdkVersion: reports[0].sdkVersion || getVersion(),\n groupName: 'Merged Midscene Report',\n groupDescription: 'Agent-readable summary for merged report HTML',\n modelBriefs: reports.flatMap((report) => report.modelBriefs ?? []),\n deviceType: deviceTypes.length === 1 ? deviceTypes[0] : 'mixed',\n executions: dedupeExecutionsKeepLatest(\n reports.flatMap((report) => report.executions ?? []),\n ),\n });\n return generateAgentReportComment(mergedReport);\n}\n\nexport class ReportMergingTool {\n private reportInfos: ReportFileWithAttributes[] = [];\n\n private createEmptyDumpString(groupName: string, groupDescription?: string) {\n return new ReportActionDump({\n sdkVersion: '',\n groupName,\n groupDescription,\n modelBriefs: [],\n executions: [],\n }).serialize();\n }\n\n public append(reportInfo: ReportFileWithAttributes) {\n if (\n !reportInfo.reportFilePath &&\n reportInfo.reportAttributes.testStatus !== 'skipped'\n ) {\n throw new Error(\n 'reportFilePath is required unless reportAttributes.testStatus is \"skipped\"',\n );\n }\n\n if (reportInfo.reportFilePath) {\n const sourceVersion = peekReportSdkVersion(reportInfo.reportFilePath);\n const currentVersion = getVersion();\n if (\n sourceVersion &&\n currentVersion &&\n sourceVersion !== currentVersion &&\n !warnedMismatchedVersions.has(sourceVersion)\n ) {\n warnedMismatchedVersions.add(sourceVersion);\n logMsg(\n `[@midscene/core] ReportMergingTool version mismatch: source report was written by @midscene/core@${sourceVersion} but the merger is @midscene/core@${currentVersion}. This commonly means @midscene/core and the device package (e.g. @midscene/android) resolve to different versions in node_modules. Merged output may silently drop intermediate steps. Align the versions and reinstall (rm -rf node_modules package-lock.json && npm install).`,\n );\n }\n }\n this.reportInfos.push(reportInfo);\n }\n public clear() {\n this.reportInfos = [];\n }\n\n /**\n * Merge multiple dump script contents (from the same source report)\n * into a single serialized ReportActionDump 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[], external: boolean): string {\n const unescaped = contents\n .map((c) => (external ? 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 = ReportActionDump.fromSerializedString(unescaped[0]);\n const allExecutions = [...base.executions];\n for (let i = 1; i < unescaped.length; i++) {\n const other = ReportActionDump.fromSerializedString(unescaped[i]);\n allExecutions.push(...other.executions);\n }\n base.executions = dedupeExecutionsKeepLatest(allExecutions);\n return base.serialize();\n }\n\n public mergeReports(\n reportFileName: 'AUTO' | string = 'AUTO',\n opts: {\n rmOriginalReports?: boolean;\n overwrite?: boolean;\n outputDir?: string;\n outputFormat?: 'single-html' | 'html-and-external-assets';\n } = {},\n ): string | null {\n const {\n rmOriginalReports = false,\n overwrite = false,\n outputDir,\n outputFormat,\n } = opts;\n if (!this.reportInfos.length) {\n logMsg('No reports to merge');\n return null;\n }\n const runnerDumps = this.reportInfos.map((info) =>\n info.reportFilePath\n ? readReportRunnerDump(info.reportFilePath)\n : undefined,\n );\n const hasRunnerDump = runnerDumps.some(Boolean);\n const external = outputFormat === 'html-and-external-assets';\n const name =\n reportFileName === 'AUTO'\n ? getReportFileName('merged-report')\n : reportFileName;\n validateTestRunReportFileName(name);\n const targetDir = outputDir\n ? path.resolve(outputDir)\n : getMidsceneRunSubDir('report');\n mkdirSync(targetDir, { recursive: true });\n const artifact = path.join(targetDir, name);\n const outputFilePath = external\n ? path.join(artifact, 'index.html')\n : `${artifact}.html`;\n if (!overwrite && existsSync(external ? artifact : outputFilePath))\n throw new Error(\n `Report file already exists: ${outputFilePath}\\nSet overwrite to true to overwrite this file.`,\n );\n if (\n rmOriginalReports &&\n this.reportInfos.some(\n (info) =>\n info.reportFilePath &&\n isDirectoryBasedReport(info.reportFilePath) &&\n outputFilePath.startsWith(\n `${path.dirname(path.resolve(info.reportFilePath))}${path.sep}`,\n ),\n )\n )\n throw new Error(\n 'Merged output must be outside source report directories when removing originals.',\n );\n const temporary = mkdtempSync(path.join(targetDir, '.merged-report-'));\n const entry = path.join(temporary, 'index.html');\n try {\n const writer = new ReportArtifactWriter(\n entry,\n external,\n hasRunnerDump ? 'test' : 'agent',\n );\n writer.initializeSync();\n const agentReports: ReportActionDump[] = [];\n const runnerSources: MergeTestRunReportSource[] = [];\n const groupIds = new Set<string>();\n for (const [index, info] of this.reportInfos.entries()) {\n const attributes = info.reportAttributes;\n let serialized = this.createEmptyDumpString(\n attributes.testTitle,\n attributes.testDescription,\n );\n let groupId = `merged-group-${index}`;\n if (info.reportFilePath) {\n const dumps = readReportDumpScripts(info.reportFilePath);\n const originalId = dumps[0]?.openTag.match(\n /data-group-id=\"([^\"]+)\"/,\n )?.[1];\n if (\n originalId &&\n !hasRunnerDump &&\n !groupIds.has(decodeURIComponent(originalId))\n )\n groupId = decodeURIComponent(originalId);\n serialized = dumps.length\n ? this.mergeDumpScripts(\n dumps.map((dump) => dump.content),\n Boolean(readReportArtifactManifest(info.reportFilePath)),\n )\n : (extractLastDumpScriptSync(info.reportFilePath) ?? serialized);\n }\n if (groupIds.has(groupId)) groupId = `merged-group-${uuid()}`;\n groupIds.add(groupId);\n const agentReport = tryParseAgentReportDump(serialized);\n if (agentReport) agentReports.push(agentReport);\n if (hasRunnerDump)\n runnerSources.push({\n reportId: groupId,\n sourcePath: info.reportFilePath ?? '<skipped-agent-report>',\n attributes,\n dump: runnerDumps[index],\n timing: agentReport\n ? agentReportTiming(agentReport, attributes.testDuration)\n : undefined,\n });\n writer.addGroupSync(groupId, serialized, info.reportFilePath ?? entry, {\n ...(hasRunnerDump ? { 'data-report-id': groupId } : {}),\n playwright_test_duration: attributes.testDuration,\n playwright_test_status: attributes.testStatus,\n playwright_test_title: attributes.testTitle,\n playwright_test_id: attributes.testId,\n playwright_test_description: attributes.testDescription,\n is_merged: true,\n });\n }\n let runner;\n if (hasRunnerDump) {\n const executions = dedupeExecutionsKeepLatest(\n agentReports.flatMap((report) => report.executions),\n );\n const metrics = collectTestRunReportMetrics({ executions });\n const executionMetrics = Object.fromEntries(\n executions.flatMap((execution) =>\n execution.id\n ? [\n [\n execution.id,\n collectTestRunReportMetrics({ executions: [execution] }),\n ],\n ]\n : [],\n ),\n );\n runner = mergeTestRunReportDumps(\n runnerSources,\n metrics,\n uuid(),\n executionMetrics,\n );\n }\n writer.finishSync(runner, mergedAgentReportComment(agentReports));\n publishReportArtifactSync(\n external ? temporary : entry,\n external ? artifact : outputFilePath,\n external,\n overwrite,\n );\n if (rmOriginalReports)\n for (const sourcePath of new Set(\n this.reportInfos.flatMap((info) =>\n info.reportFilePath ? [path.resolve(info.reportFilePath)] : [],\n ),\n )) {\n if (sourcePath !== outputFilePath) removeReportArtifact(sourcePath);\n }\n logMsg(`Successfully merged new report: ${outputFilePath}`);\n return outputFilePath;\n } finally {\n rmSync(temporary, { recursive: true, force: true });\n }\n }\n}\n\nfunction agentReportTiming(\n report: ReportActionDump,\n durationMs: number,\n): MergeTestRunReportSource['timing'] {\n const timing = collectReportSummary(report).timing;\n const executionTimes = report.executions\n .map((execution) => execution.logTime)\n .filter(\n (value): value is number =>\n typeof value === 'number' && Number.isFinite(value),\n );\n const started =\n timing.wallTimeStart ??\n (executionTimes.length ? Math.min(...executionTimes) : undefined);\n if (started === undefined) return undefined;\n const ended =\n timing.wallTimeEnd ??\n Math.max(\n ...executionTimes,\n started + (Number.isFinite(durationMs) ? Math.max(0, durationMs) : 0),\n );\n return {\n startedAt: new Date(started).toISOString(),\n endedAt: new Date(ended).toISOString(),\n durationMs: Math.max(0, ended - started),\n };\n}\n\ninterface PreparedTestRunReportSource extends IndexedTestRunReportSource {\n dump: ReportActionDump;\n dumpPath?: string;\n imageOrigins: Map<string, string>;\n}\n\nconst validateTestRunReportFileName = (fileName: string): void => {\n if (\n !fileName ||\n fileName === '.' ||\n fileName === '..' ||\n path.basename(fileName) !== fileName ||\n fileName.endsWith('.html')\n ) {\n throw new Error(\n `Midscene Test reportFileName must be one path segment without an extension: ${fileName}`,\n );\n }\n};\n\nconst uniqueTestRunReportSources = (\n sources: readonly TestRunReportSource[],\n): TestRunReportSource[] => {\n const unique = new Map<string, TestRunReportSource>();\n\n for (const source of sources) {\n const scopeId = source.scopeId.trim();\n const sourcePath = path.resolve(source.sourcePath);\n if (!scopeId) {\n throw new Error('Midscene Test report source scopeId must not be empty.');\n }\n\n unique.set(`${scopeId}\\u0000${source.dumpPath ?? sourcePath}`, {\n ...source,\n scopeId,\n sourcePath,\n });\n }\n\n return [...unique.values()];\n};\n\nconst prepareTestRunReportSources = (\n sources: readonly TestRunReportSource[],\n loadedDumps?: ReadonlyMap<string, string | Error>,\n): {\n sources: PreparedTestRunReportSource[];\n metrics: TestRunReportMetrics;\n capturedMetrics: TestRunReportMetrics;\n executionMetrics: Record<string, TestRunReportMetrics>;\n diagnostics: import('./test-run-report').TestRunReportDiagnostic[];\n} => {\n const prepared: PreparedTestRunReportSource[] = [];\n const diagnostics: import('./test-run-report').TestRunReportDiagnostic[] = [];\n const ownerByScopedExecution = new Map<string, string>();\n const preparedByPath = new Map<string, PreparedTestRunReportSource>();\n\n for (const [sourceIndex, source] of uniqueTestRunReportSources(\n sources,\n ).entries()) {\n let baseDump: ReportActionDump;\n let executions: IExecutionDump[];\n try {\n if (source.dumpPath) {\n const contents =\n loadedDumps?.get(source.dumpPath) ??\n readFileSync(source.dumpPath, 'utf8');\n if (contents instanceof Error) throw contents;\n baseDump = ReportActionDump.fromSerializedString(contents);\n executions = baseDump.executions;\n } else {\n if (!existsSync(source.sourcePath))\n throw new Error(`Agent report does not exist: ${source.sourcePath}`);\n const sourceVersion = peekReportSdkVersion(source.sourcePath);\n const currentVersion = getVersion();\n if (\n sourceVersion &&\n currentVersion &&\n sourceVersion !== currentVersion &&\n !warnedMismatchedVersions.has(sourceVersion)\n ) {\n warnedMismatchedVersions.add(sourceVersion);\n logMsg(\n `[@midscene/core] TestRunReportAssembler version mismatch: source report was written by @midscene/core@${sourceVersion} but the assembler is @midscene/core@${currentVersion}. Align the workspace package versions before generating the Midscene Test report.`,\n );\n }\n ({ baseDump, executions } = collectDedupedExecutions(\n source.sourcePath,\n ));\n }\n } catch (error) {\n diagnostics.push({\n level: 'warning',\n code: 'agent-source-unavailable',\n scopeId: source.scopeId,\n sourcePaths: [source.sourcePath],\n message: `Agent source could not be collected: ${String(error)}`,\n });\n continue;\n }\n // A borrowed Agent can serve several sequential test scopes. Reuse its\n // report group and metrics while indexing each scope's execution links.\n const sourceKey = source.sourcePath;\n const imageOrigins = new Map<string, string>();\n JSON.parse(baseDump.serialize(), (_key, value) => {\n const ref = normalizeStoredImageRef(value);\n if (ref)\n imageOrigins.set(\n ref.id,\n ref.storage === 'file'\n ? (source.dumpPath ?? source.sourcePath)\n : source.sourcePath,\n );\n return value;\n });\n const shared = preparedByPath.get(sourceKey);\n if (shared) {\n for (const [id, origin] of imageOrigins)\n shared.imageOrigins.set(id, origin);\n if (source.dumpPath) {\n shared.dump.executions = dedupeExecutionsKeepLatest([\n ...shared.dump.executions,\n ...baseDump.executions,\n ]);\n }\n const scoped = prepared.find(\n (item) =>\n item.reportId === shared.reportId && item.scopeId === source.scopeId,\n );\n const executionIds = [\n ...new Set([\n ...(scoped?.executionIds ?? []),\n ...executions.flatMap((execution) =>\n execution.id ? [execution.id] : [],\n ),\n ]),\n ];\n for (const executionId of executionIds) {\n const key = `${source.scopeId}\\u0000${executionId}`;\n const owner = ownerByScopedExecution.get(key);\n if (owner && owner !== shared.reportId)\n throw new Error(\n `Agent execution ${executionId} is present in multiple reports for test scope ${source.scopeId}: ${owner}, ${shared.reportId}`,\n );\n ownerByScopedExecution.set(key, shared.reportId);\n }\n if (scoped) {\n scoped.executionIds = executionIds;\n const partial = [scoped.collection, source.collection].find(\n (collection) => collection?.status === 'partial',\n );\n scoped.collection = partial ?? source.collection ?? scoped.collection;\n } else\n prepared.push({\n ...shared,\n scopeId: source.scopeId,\n executionIds,\n collection: source.collection,\n });\n continue;\n }\n const reportId = `runner-report-${sourceIndex + 1}`;\n const executionIds: string[] = [];\n for (const execution of executions) {\n if (!execution.id) continue;\n const scopedExecution = `${source.scopeId}\\u0000${execution.id}`;\n const previousOwner = ownerByScopedExecution.get(scopedExecution);\n if (previousOwner && previousOwner !== reportId) {\n throw new Error(\n `Agent execution ${execution.id} is present in multiple reports for test scope ${source.scopeId}: ${previousOwner}, ${reportId}`,\n );\n }\n ownerByScopedExecution.set(scopedExecution, reportId);\n executionIds.push(execution.id);\n }\n\n const dump = new ReportActionDump({\n sdkVersion: baseDump.sdkVersion,\n groupName: baseDump.groupName,\n groupDescription: baseDump.groupDescription,\n modelBriefs: baseDump.modelBriefs,\n deviceType: baseDump.deviceType,\n executions,\n });\n const preparedSource = {\n reportId,\n scopeId: source.scopeId,\n sourcePath: source.sourcePath,\n executionIds,\n collection: source.collection,\n dump,\n imageOrigins,\n ...(source.dumpPath ? { dumpPath: source.dumpPath } : {}),\n };\n prepared.push(preparedSource);\n preparedByPath.set(sourceKey, preparedSource);\n }\n\n // A legacy invocation can preserve a snapshot of an Agent also used by\n // native scopes. Count stable executions once across both paths.\n const executions = dedupeExecutionsKeepLatest(\n [...preparedByPath.values()].flatMap((source) => source.dump.executions),\n );\n const metrics = collectTestRunReportMetrics({ executions });\n const executionMetrics = Object.fromEntries(\n executions.flatMap((execution) =>\n execution.id\n ? [\n [\n execution.id,\n collectTestRunReportMetrics({ executions: [execution] }),\n ],\n ]\n : [],\n ),\n );\n return {\n sources: prepared,\n diagnostics,\n capturedMetrics: metrics,\n executionMetrics,\n metrics: {\n ...metrics,\n collection: {\n ...metrics.collection!,\n fields: Object.fromEntries(\n Object.entries(metrics.collection!.fields!).map(([field, status]) => [\n field,\n diagnostics.length\n ? prepared.length === 0\n ? 'unknown'\n : status === 'complete'\n ? 'partial'\n : status\n : status,\n ]),\n ) as NonNullable<\n NonNullable<TestRunReportMetrics['collection']>['fields']\n >,\n status: diagnostics.length\n ? prepared.length\n ? 'partial'\n : 'unknown'\n : metrics.collection!.status,\n expectedExecutionCount: 0,\n capturedExecutionCount: 0,\n reasons: [\n ...metrics.collection!.reasons,\n ...diagnostics.map((diagnostic) => diagnostic.message),\n ],\n },\n },\n };\n};\n\n/**\n * Build a self-contained Midscene Test report while preserving the existing\n * Agent dump format consumed by the Report App.\n *\n * Test hierarchy and status live in `midscene_test_run_dump`; Agent reports\n * remain independent `midscene_web_dump` groups addressed by `data-report-id`.\n */\nexport class TestRunReportAssembler {\n /** Runtime publisher: current Agent snapshots avoid parsing HTML or copying unused images. */\n public async assembleAsync(\n options: AssembleTestRunReportOptions,\n ): Promise<string> {\n validateTestRunReportFileName(options.reportFileName);\n const loaded = new Map<string, string | Error>();\n await Promise.all(\n options.sources.map(async (source) => {\n if (source.dumpPath) {\n try {\n loaded.set(\n source.dumpPath,\n await fsAsync.readFile(source.dumpPath, 'utf8'),\n );\n } catch (error) {\n loaded.set(\n source.dumpPath,\n error instanceof Error ? error : new Error(String(error)),\n );\n }\n }\n }),\n );\n const prepared = prepareTestRunReportSources(options.sources, loaded);\n const dump = options.buildRunnerDump({\n sources: prepared.sources,\n metrics: prepared.metrics,\n capturedMetrics: prepared.capturedMetrics,\n executionMetrics: prepared.executionMetrics,\n diagnostics: prepared.diagnostics,\n });\n if (dump.kind !== 'test-runner' || dump.schemaVersion !== 1)\n throw new Error('Invalid Runner report dump');\n const directoryMode = options.outputFormat === 'html-and-external-assets';\n const outputDir = path.resolve(options.outputDir);\n await fsAsync.mkdir(outputDir, { recursive: true });\n const artifact = path.join(outputDir, options.reportFileName);\n const finalPath = directoryMode\n ? path.join(artifact, 'index.html')\n : `${artifact}.html`;\n if (!options.overwrite && existsSync(directoryMode ? artifact : finalPath))\n throw new Error(`Report artifact already exists: ${artifact}`);\n const temporary = await fsAsync.mkdtemp(\n path.join(outputDir, '.test-run-report-'),\n );\n const htmlPath = path.join(temporary, 'index.html');\n try {\n const writer = new ReportArtifactWriter(\n htmlPath,\n directoryMode,\n 'test',\n dump.runId,\n );\n await writer.initialize();\n const reports: ReportActionDump[] = [];\n for (const source of new Map(\n prepared.sources.map((source) => [source.reportId, source]),\n ).values()) {\n reports.push(source.dump);\n await writer.addGroup(\n source.reportId,\n source.dump.serialize(),\n source.dumpPath ?? source.sourcePath,\n {\n 'data-report-id': source.reportId,\n 'data-runner-scope-id': source.scopeId,\n },\n source.imageOrigins,\n );\n }\n await writer.finish(dump, mergedAgentReportComment(reports));\n await publishReportArtifact(\n directoryMode ? temporary : htmlPath,\n directoryMode ? artifact : finalPath,\n directoryMode,\n options.overwrite,\n );\n return finalPath;\n } finally {\n await fsAsync.rm(temporary, { recursive: true, force: true });\n }\n }\n\n public assemble(options: AssembleTestRunReportOptions): string {\n validateTestRunReportFileName(options.reportFileName);\n const outputDir = path.resolve(options.outputDir);\n mkdirSync(outputDir, { recursive: true });\n\n const prepared = prepareTestRunReportSources(options.sources);\n const index: TestRunReportSourceIndex = {\n sources: prepared.sources.map(\n ({ reportId, scopeId, sourcePath, executionIds, collection }) => ({\n reportId,\n scopeId,\n sourcePath,\n executionIds,\n collection,\n }),\n ),\n metrics: prepared.metrics,\n capturedMetrics: prepared.capturedMetrics,\n executionMetrics: prepared.executionMetrics,\n diagnostics: prepared.diagnostics,\n };\n const runnerDump = options.buildRunnerDump(index);\n if (runnerDump.schemaVersion !== 1 || runnerDump.kind !== 'test-runner') {\n throw new Error(\n 'buildRunnerDump must return a Midscene Test report dump with schemaVersion 1 and kind \"test-runner\".',\n );\n }\n // Validate serializability before creating any output artifact.\n JSON.stringify(runnerDump);\n\n const directoryMode = options.outputFormat === 'html-and-external-assets';\n const finalArtifactPath = path.join(outputDir, options.reportFileName);\n const directoryReportPath = path.join(finalArtifactPath, 'index.html');\n const standaloneReportPath = `${finalArtifactPath}.html`;\n const finalReportPath = directoryMode\n ? directoryReportPath\n : standaloneReportPath;\n const existingArtifacts = [\n directoryMode ? finalArtifactPath : standaloneReportPath,\n ].filter(existsSync);\n if (existingArtifacts.length > 0 && !options.overwrite) {\n throw new Error(\n `Report artifact already exists: ${existingArtifacts[0]}\\nSet overwrite to true to overwrite this report.`,\n );\n }\n\n const temporaryRoot = mkdtempSync(\n path.join(outputDir, '.test-run-report-'),\n );\n const temporaryArtifactPath = path.join(\n temporaryRoot,\n options.reportFileName,\n );\n const temporaryReportPath = directoryMode\n ? path.join(temporaryArtifactPath, 'index.html')\n : `${temporaryArtifactPath}.html`;\n\n try {\n if (directoryMode) {\n mkdirSync(temporaryArtifactPath, { recursive: true });\n }\n\n const writer = new ReportArtifactWriter(\n temporaryReportPath,\n directoryMode,\n 'test',\n runnerDump.runId,\n );\n writer.initializeSync();\n const agentReports: ReportActionDump[] = [];\n for (const source of new Map(\n prepared.sources.map((source) => [source.reportId, source]),\n ).values()) {\n agentReports.push(source.dump);\n writer.addGroupSync(\n source.reportId,\n source.dump.serialize(),\n source.dumpPath ?? source.sourcePath,\n {\n 'data-report-id': source.reportId,\n 'data-runner-scope-id': source.scopeId,\n },\n source.imageOrigins,\n );\n }\n writer.finishSync(runnerDump, mergedAgentReportComment(agentReports));\n\n publishReportArtifactSync(\n directoryMode ? temporaryArtifactPath : temporaryReportPath,\n directoryMode ? finalArtifactPath : standaloneReportPath,\n directoryMode,\n options.overwrite,\n );\n rmSync(temporaryRoot, { recursive: true, force: true });\n return finalReportPath;\n } catch (error) {\n rmSync(temporaryRoot, { recursive: true, force: true });\n throw error;\n }\n }\n}\n\nexport interface SplitReportHtmlOptions {\n htmlPath: string;\n outputDir: string;\n}\n\nexport interface SplitReportHtmlResult {\n executionJsonFiles: string[];\n screenshotFiles: string[];\n}\n\nexport interface CollectedReportExecutions {\n baseDump: ReportActionDump;\n executions: IExecutionDump[];\n}\n\n/**\n * Collect executions from a report HTML, deduplicating by stable id while\n * keeping only the latest occurrence. Old-format executions without id are\n * always preserved.\n */\nexport function collectDedupedExecutions(\n htmlPath: string,\n): CollectedReportExecutions {\n let baseDump: ReportActionDump | null = null;\n let executionSerial = 0;\n const latestSerialByExecutionId = new Map<string, number>();\n\n streamReportDumpScripts(htmlPath, (dumpScript) => {\n if (!dumpScript.openTag.includes('data-group-id')) {\n return false;\n }\n const groupedDump = ReportActionDump.fromSerializedString(\n antiEscapeScriptTag(dumpScript.content),\n );\n for (const execution of groupedDump.executions) {\n executionSerial += 1;\n if (execution.id) {\n latestSerialByExecutionId.set(execution.id, executionSerial);\n }\n }\n return false;\n });\n\n const executions: IExecutionDump[] = [];\n executionSerial = 0;\n streamReportDumpScripts(htmlPath, (dumpScript) => {\n if (!dumpScript.openTag.includes('data-group-id')) {\n return false;\n }\n\n const groupedDump = ReportActionDump.fromSerializedString(\n antiEscapeScriptTag(dumpScript.content),\n );\n if (!baseDump) {\n baseDump = groupedDump;\n }\n\n for (const execution of groupedDump.executions) {\n executionSerial += 1;\n if (\n execution.id &&\n latestSerialByExecutionId.get(execution.id) !== executionSerial\n ) {\n continue;\n }\n executions.push(execution);\n }\n\n return false;\n });\n\n if (!baseDump) {\n throw new Error(`No report dump scripts found in ${htmlPath}`);\n }\n\n return {\n baseDump,\n executions,\n };\n}\n\nfunction externalizeImagesInExecution(\n execution: IExecutionDump,\n opts: {\n htmlPath: string;\n screenshotsDir: string;\n writtenFiles: Set<string>;\n },\n): void {\n const visit = (node: unknown): void => {\n if (Array.isArray(node)) {\n for (const item of node) {\n visit(item);\n }\n return;\n }\n\n if (typeof node !== 'object' || node === null) return;\n\n const ref = normalizeStoredImageRef(node);\n if (ref) {\n const ext = imageRefFileExtension(ref);\n const fileName = `${ref.id}.${ext}`;\n const relativePath = `./screenshots/${fileName}`;\n const absolutePath = path.join(opts.screenshotsDir, fileName);\n\n if (!opts.writtenFiles.has(fileName)) {\n const resolved = resolveImageSource(ref, {\n reportPath: opts.htmlPath,\n });\n if (resolved.type === 'data-uri') {\n const { rawBase64 } = parseBase64ImageDataUrl(resolved.dataUri);\n writeFileSync(absolutePath, Buffer.from(rawBase64, 'base64'));\n } else {\n copyFileSync(resolved.filePath, absolutePath);\n }\n opts.writtenFiles.add(fileName);\n }\n\n ref.storage = 'file';\n ref.path = relativePath;\n return;\n }\n\n for (const value of Object.values(node)) {\n visit(value);\n }\n };\n\n visit(execution);\n}\n\n/**\n * Reverse parse a Midscene report HTML into per-execution JSON files and\n * externalized screenshots.\n */\nexport function splitReportHtmlByExecution(\n options: SplitReportHtmlOptions,\n): SplitReportHtmlResult {\n const { htmlPath, outputDir } = options;\n const screenshotsDir = path.join(outputDir, 'screenshots');\n\n mkdirSync(outputDir, { recursive: true });\n mkdirSync(screenshotsDir, { recursive: true });\n\n const executionJsonFiles: string[] = [];\n const writtenScreenshotFiles = new Set<string>();\n const { baseDump, executions } = collectDedupedExecutions(htmlPath);\n\n let fileIndex = 0;\n for (const execution of executions) {\n fileIndex += 1;\n externalizeImagesInExecution(execution, {\n htmlPath,\n screenshotsDir,\n writtenFiles: writtenScreenshotFiles,\n });\n const singleExecutionDump = new ReportActionDump({\n sdkVersion: baseDump.sdkVersion,\n groupName: baseDump.groupName,\n groupDescription: baseDump.groupDescription,\n modelBriefs: baseDump.modelBriefs,\n deviceType: baseDump.deviceType,\n executions: [execution],\n });\n\n const jsonFilePath = path.join(outputDir, `${fileIndex}.execution.json`);\n writeFileSync(jsonFilePath, singleExecutionDump.serialize(2), 'utf-8');\n executionJsonFiles.push(jsonFilePath);\n }\n\n return {\n executionJsonFiles,\n screenshotFiles: Array.from(writtenScreenshotFiles)\n .sort()\n .map((fileName) => path.join(screenshotsDir, fileName)),\n };\n}\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","exportReportArtifact","options","validateTestRunReportFileName","input","path","output","external","artifact","destination","Error","existsSync","manifest","readReportArtifactManifest","runner","readReportRunnerDump","groups","Map","source","readReportDumpScripts","attributes","value","decodeURIComponent","id","dump","ReportActionDump","antiEscapeScriptTag","previous","dedupeExecutionsKeepLatest","hint","kind","fsAsync","temporary","entry","writer","ReportArtifactWriter","group","mergedAgentReportComment","publishReportArtifact","screenshotModeAttrRegExp","RegExp","DATA_SCREENSHOT_MODE_ATTR","readDeclaredScreenshotMode","reportFilePath","mode","streamDumpScriptsSync","openTag","match","isDirectoryModeReport","declared","isDirectoryBasedReport","removeReportArtifact","rmSync","unlinkSync","executions","noIdCounter","deduped","exec","Array","peekReportSdkVersion","streamReportDumpScripts","content","extractLastDumpScriptSync","undefined","warnedMismatchedVersions","Set","tryParseAgentReportDump","dumpString","trimmed","reports","generateAgentReportComment","deviceTypes","report","Boolean","mergedReport","getVersion","ReportMergingTool","groupName","groupDescription","reportInfo","sourceVersion","currentVersion","logMsg","contents","unescaped","c","base","allExecutions","i","other","reportFileName","opts","rmOriginalReports","overwrite","outputDir","outputFormat","runnerDumps","info","hasRunnerDump","name","getReportFileName","targetDir","getMidsceneRunSubDir","mkdirSync","outputFilePath","mkdtempSync","agentReports","runnerSources","groupIds","index","serialized","groupId","dumps","originalId","uuid","agentReport","agentReportTiming","metrics","collectTestRunReportMetrics","executionMetrics","execution","mergeTestRunReportDumps","publishReportArtifactSync","sourcePath","durationMs","timing","collectReportSummary","executionTimes","Number","started","Math","ended","Date","fileName","uniqueTestRunReportSources","sources","unique","scopeId","prepareTestRunReportSources","loadedDumps","prepared","diagnostics","ownerByScopedExecution","preparedByPath","sourceIndex","baseDump","readFileSync","collectDedupedExecutions","error","String","sourceKey","imageOrigins","JSON","_key","ref","normalizeStoredImageRef","shared","origin","scoped","item","executionIds","executionId","owner","partial","collection","reportId","scopedExecution","previousOwner","preparedSource","field","status","diagnostic","TestRunReportAssembler","loaded","Promise","directoryMode","finalPath","htmlPath","runnerDump","finalArtifactPath","directoryReportPath","standaloneReportPath","finalReportPath","existingArtifacts","temporaryRoot","temporaryArtifactPath","temporaryReportPath","executionSerial","latestSerialByExecutionId","dumpScript","groupedDump","externalizeImagesInExecution","visit","node","ext","imageRefFileExtension","relativePath","absolutePath","resolved","resolveImageSource","rawBase64","parseBase64ImageDataUrl","writeFileSync","Buffer","copyFileSync","splitReportHtmlByExecution","screenshotsDir","executionJsonFiles","writtenScreenshotFiles","fileIndex","singleExecutionDump","jsonFilePath"],"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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC0FO,eAAeI,qBACpBC,OAAoC;IAEpCC,8BAA8BD,QAAQ,cAAc;IACpD,MAAME,QAAQC,mCAAAA,OAAY,CAACH,QAAQ,UAAU;IAC7C,MAAMI,SAASD,mCAAAA,OAAY,CAACH,QAAQ,SAAS;IAC7C,MAAMK,WAAWL,AAAyB,+BAAzBA,QAAQ,YAAY;IACrC,MAAMM,WAAWH,mCAAAA,IAAS,CAACC,QAAQJ,QAAQ,cAAc;IACzD,MAAMO,cAAcF,WAChBF,mCAAAA,IAAS,CAACG,UAAU,gBACpB,GAAGA,SAAS,KAAK,CAAC;IACtB,IACEJ,UAAUK,eACTF,YAAYH,MAAM,UAAU,CAAC,GAAGI,WAAWH,mCAAAA,GAAQ,EAAE,GAEtD,MAAM,IAAIK,MAAM;IAClB,IA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AAAA,SAAAA,AAAAA,EAAUuG,gBAAgB;QAAE,WAAW;IAAK;IAE5C,MAAMC,qBAA+B,EAAE;IACvC,MAAMC,yBAAyB,IAAI/I;IACnC,MAAM,EAAEgF,QAAQ,EAAE3F,UAAU,EAAE,GAAG6F,yBAAyB8B;IAE1D,IAAIgC,YAAY;IAChB,KAAK,MAAMzF,aAAalE,WAAY;QAClC2J,aAAa;QACblB,6BAA6BvE,WAAW;YACtCyD;YACA6B;YACA,cAAcE;QAChB;QACA,MAAME,sBAAsB,IAAIzL,kCAAAA,gBAAgBA,CAAC;YAC/C,YAAYwH,SAAS,UAAU;YAC/B,WAAWA,SAAS,SAAS;YAC7B,kBAAkBA,SAAS,gBAAgB;YAC3C,aAAaA,SAAS,WAAW;YACjC,YAAYA,SAAS,UAAU;YAC/B,YAAY;gBAACzB;aAAU;QACzB;QAEA,MAAM2F,eAAe9M,mCAAAA,IAAS,CAACyF,WAAW,GAAGmH,UAAU,eAAe,CAAC;QACvEP,IAAAA,iCAAAA,aAAAA,AAAAA,EAAcS,cAAcD,oBAAoB,SAAS,CAAC,IAAI;QAC9DH,mBAAmB,IAAI,CAACI;IAC1B;IAEA,OAAO;QACLJ;QACA,iBAAiBrJ,MAAM,IAAI,CAACsJ,wBACzB,IAAI,GACJ,GAAG,CAAC,CAAC3E,WAAahI,mCAAAA,IAAS,CAACyM,gBAAgBzE;IACjD;AACF"}
|
|
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 existsSync,\n mkdirSync,\n mkdtempSync,\n readFileSync,\n readdirSync,\n renameSync,\n rmSync,\n unlinkSync,\n writeFileSync,\n} from 'node:fs';\nimport * as fsAsync from 'node:fs/promises';\nimport * as path from 'node:path';\nimport { getMidsceneRunSubDir } from '@midscene/shared/common';\nimport { antiEscapeScriptTag, logMsg, uuid } from '@midscene/shared/utils';\nimport { getReportFileName } from './agent/report-file-name';\nimport {\n DATA_SCREENSHOT_MODE_ATTR,\n extractLastDumpScriptSync,\n generateAgentReportComment,\n getBaseUrlFixScript,\n generateTestRunReportScriptTag as runnerDumpScript,\n streamDumpScriptsSync,\n streamImageScriptsToFile,\n} from './dump/html-utils';\nimport { normalizeStoredImageRef } from './dump/image-reference';\nimport {\n readReportArtifactManifest,\n readReportDumpScripts,\n readReportRunnerDump,\n streamReportDumpScripts,\n} from './dump/report-artifact-reader';\nimport { ReportImageExporter } from './dump/report-image-export';\nexport {\n readReportActionDump,\n readReportArtifactManifestAsync,\n readReportArtifactManifest,\n readReportDumpScripts,\n readReportRunnerDump,\n streamReportDumpScripts,\n} from './dump/report-artifact-reader';\nexport { ExecutionRecorder } from './dump/execution-recorder';\nexport { ReportArtifactStore } from './dump/report-artifact-store';\nexport { ReportSession } from './dump/report-session';\nimport {\n publishReportArtifact,\n publishReportArtifactSync,\n} from './dump/report-artifact-publication';\nimport {\n ReportArtifactWriter,\n type ReportGroupAttributes,\n} from './dump/report-artifact-writer';\nimport { collectReportSummary } from './report-stats';\nimport type {\n AssembleTestRunReportOptions,\n IndexedTestRunReportSource,\n TestRunReportMetrics,\n TestRunReportSource,\n TestRunReportSourceIndex,\n} from './test-run-report';\nimport {\n type MergeTestRunReportSource,\n mergeTestRunReportDumps,\n} from './test-runner/reporting/merge-report';\nimport { collectTestRunReportMetrics } from './test-runner/reporting/metrics';\nimport {\n type ExecutionDump,\n type IExecutionDump,\n ReportActionDump,\n type ScreenshotMode,\n} from './types';\nimport type { ReportFileWithAttributes } from './types';\nimport { getReportTpl, getVersion, reportHTMLContent } from './utils';\n\nexport {\n calculateTestRunHealth,\n classifyTestRunCase,\n} from './test-run-health';\n\nexport interface ExportReportArtifactOptions {\n reportPath: string;\n outputDir: string;\n reportFileName: string;\n outputFormat?: 'single-html' | 'html-and-external-assets';\n overwrite?: boolean;\n}\n\n/** Export only referenced facts and images, validating them before publishing. */\nexport async function exportReportArtifact(\n options: ExportReportArtifactOptions,\n): Promise<string> {\n validateTestRunReportFileName(options.reportFileName);\n const input = path.resolve(options.reportPath);\n const output = path.resolve(options.outputDir);\n const external = options.outputFormat === 'html-and-external-assets';\n const artifact = path.join(output, options.reportFileName);\n const destination = external\n ? path.join(artifact, 'index.html')\n : `${artifact}.html`;\n if (\n input === destination ||\n (external && input.startsWith(`${artifact}${path.sep}`))\n )\n throw new Error('Export destination must differ from the input report.');\n if (!options.overwrite && existsSync(external ? artifact : destination))\n throw new Error(`Report artifact already exists: ${artifact}`);\n const manifest = readReportArtifactManifest(input);\n const runner = readReportRunnerDump(input);\n const groups = new Map<\n string,\n { dump: ReportActionDump; attributes: ReportGroupAttributes }\n >();\n for (const source of readReportDumpScripts(input)) {\n const attributes = Object.fromEntries(\n [...source.openTag.matchAll(/([^\\s=]+)=\"([^\"]*)\"/g)]\n .filter(([, key]) => key !== 'type')\n .map(([, key, value]) => [key, decodeURIComponent(value)]),\n );\n const id = attributes['data-group-id'];\n if (!id) throw new Error('Report execution group is missing its ID.');\n const dump = ReportActionDump.fromSerializedString(\n manifest ? source.content : antiEscapeScriptTag(source.content),\n );\n const previous = groups.get(id);\n dump.executions = dedupeExecutionsKeepLatest([\n ...(previous?.dump.executions ?? []),\n ...dump.executions,\n ]);\n groups.set(id, { dump, attributes });\n }\n if (!groups.size && !runner)\n throw new Error('No report execution data was found in the input.');\n const hint = [...groups.values()][0]?.attributes['data-report-kind'];\n const kind =\n manifest?.kind ??\n (hint === 'agent' || hint === 'test' ? hint : runner ? 'test' : 'agent');\n await fsAsync.mkdir(output, { recursive: true });\n const temporary = await fsAsync.mkdtemp(path.join(output, '.report-export-'));\n const entry = path.join(temporary, 'index.html');\n try {\n const writer = new ReportArtifactWriter(\n entry,\n external,\n kind,\n manifest?.reportId ?? runner?.runId,\n );\n await writer.initialize();\n for (const [id, group] of groups)\n await writer.addGroup(\n id,\n group.dump.serialize(),\n input,\n group.attributes,\n );\n await writer.finish(\n runner,\n mergedAgentReportComment([...groups.values()].map((group) => group.dump)),\n );\n await publishReportArtifact(\n external ? temporary : entry,\n external ? artifact : destination,\n external,\n options.overwrite,\n );\n return destination;\n } finally {\n await fsAsync.rm(temporary, { recursive: true, force: true });\n }\n}\n\n/**\n * Read the screenshot storage mode a report declared at generation time.\n *\n * Reports written by current versions stamp `data-screenshot-mode` onto every\n * dump script tag, so we only need to peek at the first real dump script (the\n * template's bundled JS also references the dump type string, hence the\n * `data-group-id` filter) and can stop streaming immediately.\n *\n * Returns undefined for legacy reports that predate the attribute or for\n * unreadable files, letting the caller fall back to a filesystem heuristic.\n */\nconst screenshotModeAttrRegExp = new RegExp(\n `${DATA_SCREENSHOT_MODE_ATTR}=\"(inline|directory)\"`,\n);\n\nfunction readDeclaredScreenshotMode(\n reportFilePath: string,\n): ScreenshotMode | undefined {\n let mode: ScreenshotMode | undefined;\n try {\n streamDumpScriptsSync(reportFilePath, ({ openTag }) => {\n // Skip false matches from the template's bundled JS code.\n if (!openTag.includes('data-group-id')) return false;\n const match = openTag.match(screenshotModeAttrRegExp);\n mode = match?.[1] as ScreenshotMode | undefined;\n return true; // the first real dump script decides the mode\n });\n } catch {\n // Unreadable / non-existent file — let the caller fall back.\n }\n return mode;\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 * The mode is read from the report's own `data-screenshot-mode` metadata, which\n * is authoritative regardless of whether the run happened to capture any\n * screenshots. For legacy reports without the attribute we fall back to the old\n * filesystem heuristic (an `index.html` that has a sibling `screenshots/` dir).\n */\nexport function isDirectoryModeReport(reportFilePath: string): boolean {\n if (readReportArtifactManifest(reportFilePath)) return true;\n // Agent directory reports use index.html by default. Reports without the\n // versioned manifest use the existing metadata and layout heuristic.\n if (path.basename(reportFilePath) !== 'index.html') return false;\n\n const declared = readDeclaredScreenshotMode(reportFilePath);\n if (declared) return declared === 'directory';\n\n // Legacy fallback for reports generated before screenshotMode was embedded.\n return existsSync(path.join(path.dirname(reportFilePath), 'screenshots'));\n}\n\n/**\n * Whether a report lives in its own dedicated directory (`{name}/index.html`)\n * rather than being a single standalone file (`{name}.html`).\n *\n * This is a structural fact about *where the report file sits*, independent of\n * how it stores screenshots: a directory report can keep screenshots external\n * (a `screenshots/` sibling) OR inline them into `index.html`. Deletion needs\n * this — not the screenshot mode — to decide whether to remove the whole\n * directory or just unlink a file, so that an inline-screenshot report nested in\n * its own folder still has the folder removed instead of being orphaned.\n */\nfunction isDirectoryBasedReport(reportFilePath: string): boolean {\n return path.basename(reportFilePath) === 'index.html';\n}\n\n/**\n * Remove a complete report artifact from disk.\n *\n * Standalone reports own only their HTML file, while directory-based reports\n * own the directory containing `index.html`. Callers must decide whether they\n * own the source artifact and should only invoke this after its replacement\n * has been produced successfully.\n *\n * @param reportFilePath Path to the standalone report or directory report's\n * `index.html` entry point.\n * @throws When the owned report artifact cannot be removed.\n */\nexport function removeReportArtifact(reportFilePath: string): void {\n if (isDirectoryBasedReport(reportFilePath)) {\n rmSync(path.dirname(reportFilePath), { recursive: true, force: true });\n return;\n }\n unlinkSync(reportFilePath);\n}\n\n/**\n * Deduplicate executions by stable id, keeping only the last occurrence.\n * Old-format executions without id are always preserved.\n */\nexport function dedupeExecutionsKeepLatest<T extends Pick<ExecutionDump, 'id'>>(\n executions: T[],\n): T[] {\n let noIdCounter = 0;\n const deduped = new Map<string, T>();\n for (const exec of executions) {\n const key = exec.id || `__no_id_${noIdCounter++}`;\n deduped.set(key, exec);\n }\n return Array.from(deduped.values());\n}\n/**\n * Peek at the first `sdkVersion` field embedded in a midscene_web_dump\n * script tag inside the given report file. Returns undefined if no\n * recognizable tag or sdkVersion is present.\n */\nfunction peekReportSdkVersion(reportFilePath: string): string | undefined {\n try {\n let dump: string | undefined;\n streamReportDumpScripts(reportFilePath, ({ content }) => {\n dump = content;\n return true;\n });\n dump ??= extractLastDumpScriptSync(reportFilePath) ?? undefined;\n if (!dump) return undefined;\n const match = dump.match(/\"sdkVersion\"\\s*:\\s*\"([^\"]+)\"/);\n return match?.[1];\n } catch {\n return undefined;\n }\n}\n\nconst warnedMismatchedVersions = new Set<string>();\n\nfunction tryParseAgentReportDump(dumpString: string): ReportActionDump | null {\n const trimmed = dumpString.trimStart();\n if (!trimmed.startsWith('{') || !trimmed.includes('\"executions\"')) {\n return null;\n }\n\n try {\n return ReportActionDump.fromSerializedString(trimmed);\n } catch {\n return null;\n }\n}\n\nfunction mergedAgentReportComment(reports: ReportActionDump[]): string {\n if (reports.length === 0) {\n return '';\n }\n if (reports.length === 1) {\n return generateAgentReportComment(reports[0]);\n }\n\n const deviceTypes = Array.from(\n new Set(reports.map((report) => report.deviceType).filter(Boolean)),\n );\n const mergedReport = new ReportActionDump({\n sdkVersion: reports[0].sdkVersion || getVersion(),\n groupName: 'Merged Midscene Report',\n groupDescription: 'Agent-readable summary for merged report HTML',\n modelBriefs: reports.flatMap((report) => report.modelBriefs ?? []),\n deviceType: deviceTypes.length === 1 ? deviceTypes[0] : 'mixed',\n executions: dedupeExecutionsKeepLatest(\n reports.flatMap((report) => report.executions ?? []),\n ),\n });\n return generateAgentReportComment(mergedReport);\n}\n\nexport class ReportMergingTool {\n private reportInfos: ReportFileWithAttributes[] = [];\n\n private createEmptyDumpString(groupName: string, groupDescription?: string) {\n return new ReportActionDump({\n sdkVersion: '',\n groupName,\n groupDescription,\n modelBriefs: [],\n executions: [],\n }).serialize();\n }\n\n public append(reportInfo: ReportFileWithAttributes) {\n if (\n !reportInfo.reportFilePath &&\n reportInfo.reportAttributes.testStatus !== 'skipped'\n ) {\n throw new Error(\n 'reportFilePath is required unless reportAttributes.testStatus is \"skipped\"',\n );\n }\n\n if (reportInfo.reportFilePath) {\n const sourceVersion = peekReportSdkVersion(reportInfo.reportFilePath);\n const currentVersion = getVersion();\n if (\n sourceVersion &&\n currentVersion &&\n sourceVersion !== currentVersion &&\n !warnedMismatchedVersions.has(sourceVersion)\n ) {\n warnedMismatchedVersions.add(sourceVersion);\n logMsg(\n `[@midscene/core] ReportMergingTool version mismatch: source report was written by @midscene/core@${sourceVersion} but the merger is @midscene/core@${currentVersion}. This commonly means @midscene/core and the device package (e.g. @midscene/android) resolve to different versions in node_modules. Merged output may silently drop intermediate steps. Align the versions and reinstall (rm -rf node_modules package-lock.json && npm install).`,\n );\n }\n }\n this.reportInfos.push(reportInfo);\n }\n public clear() {\n this.reportInfos = [];\n }\n\n /**\n * Merge multiple dump script contents (from the same source report)\n * into a single serialized ReportActionDump 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[], external: boolean): string {\n const unescaped = contents\n .map((c) => (external ? 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 = ReportActionDump.fromSerializedString(unescaped[0]);\n const allExecutions = [...base.executions];\n for (let i = 1; i < unescaped.length; i++) {\n const other = ReportActionDump.fromSerializedString(unescaped[i]);\n allExecutions.push(...other.executions);\n }\n base.executions = dedupeExecutionsKeepLatest(allExecutions);\n return base.serialize();\n }\n\n public mergeReports(\n reportFileName: 'AUTO' | string = 'AUTO',\n opts: {\n rmOriginalReports?: boolean;\n overwrite?: boolean;\n outputDir?: string;\n outputFormat?: 'single-html' | 'html-and-external-assets';\n } = {},\n ): string | null {\n const {\n rmOriginalReports = false,\n overwrite = false,\n outputDir,\n outputFormat,\n } = opts;\n if (!this.reportInfos.length) {\n logMsg('No reports to merge');\n return null;\n }\n const runnerDumps = this.reportInfos.map((info) =>\n info.reportFilePath\n ? readReportRunnerDump(info.reportFilePath)\n : undefined,\n );\n const hasRunnerDump = runnerDumps.some(Boolean);\n const external = outputFormat === 'html-and-external-assets';\n const name =\n reportFileName === 'AUTO'\n ? getReportFileName('merged-report')\n : reportFileName;\n validateTestRunReportFileName(name);\n const targetDir = outputDir\n ? path.resolve(outputDir)\n : getMidsceneRunSubDir('report');\n mkdirSync(targetDir, { recursive: true });\n const artifact = path.join(targetDir, name);\n const outputFilePath = external\n ? path.join(artifact, 'index.html')\n : `${artifact}.html`;\n if (!overwrite && existsSync(external ? artifact : outputFilePath))\n throw new Error(\n `Report file already exists: ${outputFilePath}\\nSet overwrite to true to overwrite this file.`,\n );\n if (\n rmOriginalReports &&\n this.reportInfos.some(\n (info) =>\n info.reportFilePath &&\n isDirectoryBasedReport(info.reportFilePath) &&\n outputFilePath.startsWith(\n `${path.dirname(path.resolve(info.reportFilePath))}${path.sep}`,\n ),\n )\n )\n throw new Error(\n 'Merged output must be outside source report directories when removing originals.',\n );\n const temporary = mkdtempSync(path.join(targetDir, '.merged-report-'));\n const entry = path.join(temporary, 'index.html');\n try {\n const writer = new ReportArtifactWriter(\n entry,\n external,\n hasRunnerDump ? 'test' : 'agent',\n );\n writer.initializeSync();\n const agentReports: ReportActionDump[] = [];\n const runnerSources: MergeTestRunReportSource[] = [];\n const groupIds = new Set<string>();\n for (const [index, info] of this.reportInfos.entries()) {\n const attributes = info.reportAttributes;\n let serialized = this.createEmptyDumpString(\n attributes.testTitle,\n attributes.testDescription,\n );\n let groupId = `merged-group-${index}`;\n if (info.reportFilePath) {\n const dumps = readReportDumpScripts(info.reportFilePath);\n const originalId = dumps[0]?.openTag.match(\n /data-group-id=\"([^\"]+)\"/,\n )?.[1];\n if (\n originalId &&\n !hasRunnerDump &&\n !groupIds.has(decodeURIComponent(originalId))\n )\n groupId = decodeURIComponent(originalId);\n serialized = dumps.length\n ? this.mergeDumpScripts(\n dumps.map((dump) => dump.content),\n Boolean(readReportArtifactManifest(info.reportFilePath)),\n )\n : (extractLastDumpScriptSync(info.reportFilePath) ?? serialized);\n }\n if (groupIds.has(groupId)) groupId = `merged-group-${uuid()}`;\n groupIds.add(groupId);\n const agentReport = tryParseAgentReportDump(serialized);\n if (agentReport) agentReports.push(agentReport);\n if (hasRunnerDump)\n runnerSources.push({\n reportId: groupId,\n sourcePath: info.reportFilePath ?? '<skipped-agent-report>',\n attributes,\n dump: runnerDumps[index],\n timing: agentReport\n ? agentReportTiming(agentReport, attributes.testDuration)\n : undefined,\n });\n writer.addGroupSync(groupId, serialized, info.reportFilePath ?? entry, {\n ...(hasRunnerDump ? { 'data-report-id': groupId } : {}),\n playwright_test_duration: attributes.testDuration,\n playwright_test_status: attributes.testStatus,\n playwright_test_title: attributes.testTitle,\n playwright_test_id: attributes.testId,\n playwright_test_description: attributes.testDescription,\n is_merged: true,\n });\n }\n let runner;\n if (hasRunnerDump) {\n const executions = dedupeExecutionsKeepLatest(\n agentReports.flatMap((report) => report.executions),\n );\n const metrics = collectTestRunReportMetrics({ executions });\n const executionMetrics = Object.fromEntries(\n executions.flatMap((execution) =>\n execution.id\n ? [\n [\n execution.id,\n collectTestRunReportMetrics({ executions: [execution] }),\n ],\n ]\n : [],\n ),\n );\n runner = mergeTestRunReportDumps(\n runnerSources,\n metrics,\n uuid(),\n executionMetrics,\n );\n }\n writer.finishSync(runner, mergedAgentReportComment(agentReports));\n publishReportArtifactSync(\n external ? temporary : entry,\n external ? artifact : outputFilePath,\n external,\n overwrite,\n );\n if (rmOriginalReports)\n for (const sourcePath of new Set(\n this.reportInfos.flatMap((info) =>\n info.reportFilePath ? [path.resolve(info.reportFilePath)] : [],\n ),\n )) {\n if (sourcePath !== outputFilePath) removeReportArtifact(sourcePath);\n }\n logMsg(`Successfully merged new report: ${outputFilePath}`);\n return outputFilePath;\n } finally {\n rmSync(temporary, { recursive: true, force: true });\n }\n }\n}\n\nfunction agentReportTiming(\n report: ReportActionDump,\n durationMs: number,\n): MergeTestRunReportSource['timing'] {\n const timing = collectReportSummary(report).timing;\n const executionTimes = report.executions\n .map((execution) => execution.logTime)\n .filter(\n (value): value is number =>\n typeof value === 'number' && Number.isFinite(value),\n );\n const started =\n timing.wallTimeStart ??\n (executionTimes.length ? Math.min(...executionTimes) : undefined);\n if (started === undefined) return undefined;\n const ended =\n timing.wallTimeEnd ??\n Math.max(\n ...executionTimes,\n started + (Number.isFinite(durationMs) ? Math.max(0, durationMs) : 0),\n );\n return {\n startedAt: new Date(started).toISOString(),\n endedAt: new Date(ended).toISOString(),\n durationMs: Math.max(0, ended - started),\n };\n}\n\ninterface PreparedTestRunReportSource extends IndexedTestRunReportSource {\n dump: ReportActionDump;\n dumpPath?: string;\n imageOrigins: Map<string, string>;\n}\n\nconst validateTestRunReportFileName = (fileName: string): void => {\n if (\n !fileName ||\n fileName === '.' ||\n fileName === '..' ||\n path.basename(fileName) !== fileName ||\n fileName.endsWith('.html')\n ) {\n throw new Error(\n `Midscene Test reportFileName must be one path segment without an extension: ${fileName}`,\n );\n }\n};\n\nconst uniqueTestRunReportSources = (\n sources: readonly TestRunReportSource[],\n): TestRunReportSource[] => {\n const unique = new Map<string, TestRunReportSource>();\n\n for (const source of sources) {\n const scopeId = source.scopeId.trim();\n const sourcePath = path.resolve(source.sourcePath);\n if (!scopeId) {\n throw new Error('Midscene Test report source scopeId must not be empty.');\n }\n\n unique.set(`${scopeId}\\u0000${source.dumpPath ?? sourcePath}`, {\n ...source,\n scopeId,\n sourcePath,\n });\n }\n\n return [...unique.values()];\n};\n\nconst prepareTestRunReportSources = (\n sources: readonly TestRunReportSource[],\n loadedDumps?: ReadonlyMap<string, string | Error>,\n): {\n sources: PreparedTestRunReportSource[];\n metrics: TestRunReportMetrics;\n capturedMetrics: TestRunReportMetrics;\n executionMetrics: Record<string, TestRunReportMetrics>;\n diagnostics: import('./test-run-report').TestRunReportDiagnostic[];\n} => {\n const prepared: PreparedTestRunReportSource[] = [];\n const diagnostics: import('./test-run-report').TestRunReportDiagnostic[] = [];\n const ownerByScopedExecution = new Map<string, string>();\n const preparedByPath = new Map<string, PreparedTestRunReportSource>();\n\n for (const [sourceIndex, source] of uniqueTestRunReportSources(\n sources,\n ).entries()) {\n let baseDump: ReportActionDump;\n let executions: IExecutionDump[];\n try {\n if (source.dumpPath) {\n const contents =\n loadedDumps?.get(source.dumpPath) ??\n readFileSync(source.dumpPath, 'utf8');\n if (contents instanceof Error) throw contents;\n baseDump = ReportActionDump.fromSerializedString(contents);\n executions = baseDump.executions;\n } else {\n if (!existsSync(source.sourcePath))\n throw new Error(`Agent report does not exist: ${source.sourcePath}`);\n const sourceVersion = peekReportSdkVersion(source.sourcePath);\n const currentVersion = getVersion();\n if (\n sourceVersion &&\n currentVersion &&\n sourceVersion !== currentVersion &&\n !warnedMismatchedVersions.has(sourceVersion)\n ) {\n warnedMismatchedVersions.add(sourceVersion);\n logMsg(\n `[@midscene/core] TestRunReportAssembler version mismatch: source report was written by @midscene/core@${sourceVersion} but the assembler is @midscene/core@${currentVersion}. Align the workspace package versions before generating the Midscene Test report.`,\n );\n }\n ({ baseDump, executions } = collectDedupedExecutions(\n source.sourcePath,\n ));\n }\n } catch (error) {\n diagnostics.push({\n level: 'warning',\n code: 'agent-source-unavailable',\n scopeId: source.scopeId,\n sourcePaths: [source.sourcePath],\n message: `Agent source could not be collected: ${String(error)}`,\n });\n continue;\n }\n // A borrowed Agent can serve several sequential test scopes. Reuse its\n // report group and metrics while indexing each scope's execution links.\n const sourceKey = source.sourcePath;\n const imageOrigins = new Map<string, string>();\n JSON.parse(baseDump.serialize(), (_key, value) => {\n const ref = normalizeStoredImageRef(value);\n if (ref)\n imageOrigins.set(\n ref.id,\n ref.storage === 'file'\n ? (source.dumpPath ?? source.sourcePath)\n : source.sourcePath,\n );\n return value;\n });\n const shared = preparedByPath.get(sourceKey);\n if (shared) {\n for (const [id, origin] of imageOrigins)\n shared.imageOrigins.set(id, origin);\n if (source.dumpPath) {\n shared.dump.executions = dedupeExecutionsKeepLatest([\n ...shared.dump.executions,\n ...baseDump.executions,\n ]);\n }\n const scoped = prepared.find(\n (item) =>\n item.reportId === shared.reportId && item.scopeId === source.scopeId,\n );\n const executionIds = [\n ...new Set([\n ...(scoped?.executionIds ?? []),\n ...executions.flatMap((execution) =>\n execution.id ? [execution.id] : [],\n ),\n ]),\n ];\n for (const executionId of executionIds) {\n const key = `${source.scopeId}\\u0000${executionId}`;\n const owner = ownerByScopedExecution.get(key);\n if (owner && owner !== shared.reportId)\n throw new Error(\n `Agent execution ${executionId} is present in multiple reports for test scope ${source.scopeId}: ${owner}, ${shared.reportId}`,\n );\n ownerByScopedExecution.set(key, shared.reportId);\n }\n if (scoped) {\n scoped.executionIds = executionIds;\n const partial = [scoped.collection, source.collection].find(\n (collection) => collection?.status === 'partial',\n );\n scoped.collection = partial ?? source.collection ?? scoped.collection;\n } else\n prepared.push({\n ...shared,\n scopeId: source.scopeId,\n executionIds,\n collection: source.collection,\n });\n continue;\n }\n const reportId = `runner-report-${sourceIndex + 1}`;\n const executionIds: string[] = [];\n for (const execution of executions) {\n if (!execution.id) continue;\n const scopedExecution = `${source.scopeId}\\u0000${execution.id}`;\n const previousOwner = ownerByScopedExecution.get(scopedExecution);\n if (previousOwner && previousOwner !== reportId) {\n throw new Error(\n `Agent execution ${execution.id} is present in multiple reports for test scope ${source.scopeId}: ${previousOwner}, ${reportId}`,\n );\n }\n ownerByScopedExecution.set(scopedExecution, reportId);\n executionIds.push(execution.id);\n }\n\n const dump = new ReportActionDump({\n sdkVersion: baseDump.sdkVersion,\n groupName: baseDump.groupName,\n groupDescription: baseDump.groupDescription,\n modelBriefs: baseDump.modelBriefs,\n deviceType: baseDump.deviceType,\n executions,\n });\n const preparedSource = {\n reportId,\n scopeId: source.scopeId,\n sourcePath: source.sourcePath,\n executionIds,\n collection: source.collection,\n dump,\n imageOrigins,\n ...(source.dumpPath ? { dumpPath: source.dumpPath } : {}),\n };\n prepared.push(preparedSource);\n preparedByPath.set(sourceKey, preparedSource);\n }\n\n // A legacy invocation can preserve a snapshot of an Agent also used by\n // native scopes. Count stable executions once across both paths.\n const executions = dedupeExecutionsKeepLatest(\n [...preparedByPath.values()].flatMap((source) => source.dump.executions),\n );\n const metrics = collectTestRunReportMetrics({ executions });\n const executionMetrics = Object.fromEntries(\n executions.flatMap((execution) =>\n execution.id\n ? [\n [\n execution.id,\n collectTestRunReportMetrics({ executions: [execution] }),\n ],\n ]\n : [],\n ),\n );\n return {\n sources: prepared,\n diagnostics,\n capturedMetrics: metrics,\n executionMetrics,\n metrics: {\n ...metrics,\n collection: {\n ...metrics.collection!,\n fields: Object.fromEntries(\n Object.entries(metrics.collection!.fields!).map(([field, status]) => [\n field,\n diagnostics.length\n ? prepared.length === 0\n ? 'unknown'\n : status === 'complete'\n ? 'partial'\n : status\n : status,\n ]),\n ) as NonNullable<\n NonNullable<TestRunReportMetrics['collection']>['fields']\n >,\n status: diagnostics.length\n ? prepared.length\n ? 'partial'\n : 'unknown'\n : metrics.collection!.status,\n expectedExecutionCount: 0,\n capturedExecutionCount: 0,\n reasons: [\n ...metrics.collection!.reasons,\n ...diagnostics.map((diagnostic) => diagnostic.message),\n ],\n },\n },\n };\n};\n\n/**\n * Build a self-contained Midscene Test report while preserving the existing\n * Agent dump format consumed by the Report App.\n *\n * Test hierarchy and status live in `midscene_test_run_dump`; Agent reports\n * remain independent `midscene_web_dump` groups addressed by `data-report-id`.\n */\nexport class TestRunReportAssembler {\n /** Runtime publisher: current Agent snapshots avoid parsing HTML or copying unused images. */\n public async assembleAsync(\n options: AssembleTestRunReportOptions,\n ): Promise<string> {\n validateTestRunReportFileName(options.reportFileName);\n const loaded = new Map<string, string | Error>();\n await Promise.all(\n options.sources.map(async (source) => {\n if (source.dumpPath) {\n try {\n loaded.set(\n source.dumpPath,\n await fsAsync.readFile(source.dumpPath, 'utf8'),\n );\n } catch (error) {\n loaded.set(\n source.dumpPath,\n error instanceof Error ? error : new Error(String(error)),\n );\n }\n }\n }),\n );\n const prepared = prepareTestRunReportSources(options.sources, loaded);\n const dump = options.buildRunnerDump({\n sources: prepared.sources,\n metrics: prepared.metrics,\n capturedMetrics: prepared.capturedMetrics,\n executionMetrics: prepared.executionMetrics,\n diagnostics: prepared.diagnostics,\n });\n if (dump.kind !== 'test-runner' || dump.schemaVersion !== 1)\n throw new Error('Invalid Runner report dump');\n const directoryMode = options.outputFormat === 'html-and-external-assets';\n const outputDir = path.resolve(options.outputDir);\n await fsAsync.mkdir(outputDir, { recursive: true });\n const artifact = path.join(outputDir, options.reportFileName);\n const finalPath = directoryMode\n ? path.join(artifact, 'index.html')\n : `${artifact}.html`;\n if (!options.overwrite && existsSync(directoryMode ? artifact : finalPath))\n throw new Error(`Report artifact already exists: ${artifact}`);\n const temporary = await fsAsync.mkdtemp(\n path.join(outputDir, '.test-run-report-'),\n );\n const htmlPath = path.join(temporary, 'index.html');\n try {\n const writer = new ReportArtifactWriter(\n htmlPath,\n directoryMode,\n 'test',\n dump.runId,\n );\n await writer.initialize();\n const reports: ReportActionDump[] = [];\n for (const source of new Map(\n prepared.sources.map((source) => [source.reportId, source]),\n ).values()) {\n reports.push(source.dump);\n await writer.addGroup(\n source.reportId,\n source.dump.serialize(),\n source.dumpPath ?? source.sourcePath,\n {\n 'data-report-id': source.reportId,\n 'data-runner-scope-id': source.scopeId,\n },\n source.imageOrigins,\n );\n }\n await writer.finish(dump, mergedAgentReportComment(reports));\n await publishReportArtifact(\n directoryMode ? temporary : htmlPath,\n directoryMode ? artifact : finalPath,\n directoryMode,\n options.overwrite,\n );\n return finalPath;\n } finally {\n await fsAsync.rm(temporary, { recursive: true, force: true });\n }\n }\n\n public assemble(options: AssembleTestRunReportOptions): string {\n validateTestRunReportFileName(options.reportFileName);\n const outputDir = path.resolve(options.outputDir);\n mkdirSync(outputDir, { recursive: true });\n\n const prepared = prepareTestRunReportSources(options.sources);\n const index: TestRunReportSourceIndex = {\n sources: prepared.sources.map(\n ({ reportId, scopeId, sourcePath, executionIds, collection }) => ({\n reportId,\n scopeId,\n sourcePath,\n executionIds,\n collection,\n }),\n ),\n metrics: prepared.metrics,\n capturedMetrics: prepared.capturedMetrics,\n executionMetrics: prepared.executionMetrics,\n diagnostics: prepared.diagnostics,\n };\n const runnerDump = options.buildRunnerDump(index);\n if (runnerDump.schemaVersion !== 1 || runnerDump.kind !== 'test-runner') {\n throw new Error(\n 'buildRunnerDump must return a Midscene Test report dump with schemaVersion 1 and kind \"test-runner\".',\n );\n }\n // Validate serializability before creating any output artifact.\n JSON.stringify(runnerDump);\n\n const directoryMode = options.outputFormat === 'html-and-external-assets';\n const finalArtifactPath = path.join(outputDir, options.reportFileName);\n const directoryReportPath = path.join(finalArtifactPath, 'index.html');\n const standaloneReportPath = `${finalArtifactPath}.html`;\n const finalReportPath = directoryMode\n ? directoryReportPath\n : standaloneReportPath;\n const existingArtifacts = [\n directoryMode ? finalArtifactPath : standaloneReportPath,\n ].filter(existsSync);\n if (existingArtifacts.length > 0 && !options.overwrite) {\n throw new Error(\n `Report artifact already exists: ${existingArtifacts[0]}\\nSet overwrite to true to overwrite this report.`,\n );\n }\n\n const temporaryRoot = mkdtempSync(\n path.join(outputDir, '.test-run-report-'),\n );\n const temporaryArtifactPath = path.join(\n temporaryRoot,\n options.reportFileName,\n );\n const temporaryReportPath = directoryMode\n ? path.join(temporaryArtifactPath, 'index.html')\n : `${temporaryArtifactPath}.html`;\n\n try {\n if (directoryMode) {\n mkdirSync(temporaryArtifactPath, { recursive: true });\n }\n\n const writer = new ReportArtifactWriter(\n temporaryReportPath,\n directoryMode,\n 'test',\n runnerDump.runId,\n );\n writer.initializeSync();\n const agentReports: ReportActionDump[] = [];\n for (const source of new Map(\n prepared.sources.map((source) => [source.reportId, source]),\n ).values()) {\n agentReports.push(source.dump);\n writer.addGroupSync(\n source.reportId,\n source.dump.serialize(),\n source.dumpPath ?? source.sourcePath,\n {\n 'data-report-id': source.reportId,\n 'data-runner-scope-id': source.scopeId,\n },\n source.imageOrigins,\n );\n }\n writer.finishSync(runnerDump, mergedAgentReportComment(agentReports));\n\n publishReportArtifactSync(\n directoryMode ? temporaryArtifactPath : temporaryReportPath,\n directoryMode ? finalArtifactPath : standaloneReportPath,\n directoryMode,\n options.overwrite,\n );\n rmSync(temporaryRoot, { recursive: true, force: true });\n return finalReportPath;\n } catch (error) {\n rmSync(temporaryRoot, { recursive: true, force: true });\n throw error;\n }\n }\n}\n\nexport interface SplitReportHtmlOptions {\n htmlPath: string;\n outputDir: string;\n}\n\nexport interface SplitReportHtmlResult {\n executionJsonFiles: string[];\n screenshotFiles: string[];\n}\n\nexport interface CollectedReportExecutions {\n baseDump: ReportActionDump;\n executions: IExecutionDump[];\n}\n\n/**\n * Collect executions from a report HTML, deduplicating by stable id while\n * keeping only the latest occurrence. Old-format executions without id are\n * always preserved.\n */\nexport function collectDedupedExecutions(\n htmlPath: string,\n): CollectedReportExecutions {\n let baseDump: ReportActionDump | null = null;\n let executionSerial = 0;\n const latestSerialByExecutionId = new Map<string, number>();\n\n streamReportDumpScripts(htmlPath, (dumpScript) => {\n if (!dumpScript.openTag.includes('data-group-id')) {\n return false;\n }\n const groupedDump = ReportActionDump.fromSerializedString(\n antiEscapeScriptTag(dumpScript.content),\n );\n for (const execution of groupedDump.executions) {\n executionSerial += 1;\n if (execution.id) {\n latestSerialByExecutionId.set(execution.id, executionSerial);\n }\n }\n return false;\n });\n\n const executions: IExecutionDump[] = [];\n executionSerial = 0;\n streamReportDumpScripts(htmlPath, (dumpScript) => {\n if (!dumpScript.openTag.includes('data-group-id')) {\n return false;\n }\n\n const groupedDump = ReportActionDump.fromSerializedString(\n antiEscapeScriptTag(dumpScript.content),\n );\n if (!baseDump) {\n baseDump = groupedDump;\n }\n\n for (const execution of groupedDump.executions) {\n executionSerial += 1;\n if (\n execution.id &&\n latestSerialByExecutionId.get(execution.id) !== executionSerial\n ) {\n continue;\n }\n executions.push(execution);\n }\n\n return false;\n });\n\n if (!baseDump) {\n throw new Error(`No report dump scripts found in ${htmlPath}`);\n }\n\n return {\n baseDump,\n executions,\n };\n}\n\nfunction externalizeImagesInExecution(\n execution: IExecutionDump,\n images: ReportImageExporter,\n): void {\n const visit = (node: unknown): void => {\n if (Array.isArray(node)) {\n for (const item of node) {\n visit(item);\n }\n return;\n }\n\n if (typeof node !== 'object' || node === null) return;\n\n const ref = normalizeStoredImageRef(node);\n if (ref) {\n const fileName = images.write(ref);\n const relativePath = `./screenshots/${fileName}`;\n\n ref.storage = 'file';\n ref.path = relativePath;\n return;\n }\n\n for (const value of Object.values(node)) {\n visit(value);\n }\n };\n\n visit(execution);\n}\n\n/**\n * Reverse parse a Midscene report HTML into per-execution JSON files and\n * externalized screenshots.\n */\nexport function splitReportHtmlByExecution(\n options: SplitReportHtmlOptions,\n): SplitReportHtmlResult {\n const { htmlPath, outputDir } = options;\n const screenshotsDir = path.join(outputDir, 'screenshots');\n\n mkdirSync(outputDir, { recursive: true });\n mkdirSync(screenshotsDir, { recursive: true });\n\n const executionJsonFiles: string[] = [];\n const images = new ReportImageExporter(htmlPath, screenshotsDir);\n const { baseDump, executions } = collectDedupedExecutions(htmlPath);\n\n let fileIndex = 0;\n for (const execution of executions) {\n fileIndex += 1;\n externalizeImagesInExecution(execution, images);\n const singleExecutionDump = new ReportActionDump({\n sdkVersion: baseDump.sdkVersion,\n groupName: baseDump.groupName,\n groupDescription: baseDump.groupDescription,\n modelBriefs: baseDump.modelBriefs,\n deviceType: baseDump.deviceType,\n executions: [execution],\n });\n\n const jsonFilePath = path.join(outputDir, `${fileIndex}.execution.json`);\n writeFileSync(jsonFilePath, singleExecutionDump.serialize(2), 'utf-8');\n executionJsonFiles.push(jsonFilePath);\n }\n\n return {\n executionJsonFiles,\n screenshotFiles: images.files,\n };\n}\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","exportReportArtifact","options","validateTestRunReportFileName","input","path","output","external","artifact","destination","Error","existsSync","manifest","readReportArtifactManifest","runner","readReportRunnerDump","groups","Map","source","readReportDumpScripts","attributes","value","decodeURIComponent","id","dump","ReportActionDump","antiEscapeScriptTag","previous","dedupeExecutionsKeepLatest","hint","kind","fsAsync","temporary","entry","writer","ReportArtifactWriter","group","mergedAgentReportComment","publishReportArtifact","screenshotModeAttrRegExp","RegExp","DATA_SCREENSHOT_MODE_ATTR","readDeclaredScreenshotMode","reportFilePath","mode","streamDumpScriptsSync","openTag","match","isDirectoryModeReport","declared","isDirectoryBasedReport","removeReportArtifact","rmSync","unlinkSync","executions","noIdCounter","deduped","exec","Array","peekReportSdkVersion","streamReportDumpScripts","content","extractLastDumpScriptSync","undefined","warnedMismatchedVersions","Set","tryParseAgentReportDump","dumpString","trimmed","reports","generateAgentReportComment","deviceTypes","report","Boolean","mergedReport","getVersion","ReportMergingTool","groupName","groupDescription","reportInfo","sourceVersion","currentVersion","logMsg","contents","unescaped","c","base","allExecutions","i","other","reportFileName","opts","rmOriginalReports","overwrite","outputDir","outputFormat","runnerDumps","info","hasRunnerDump","name","getReportFileName","targetDir","getMidsceneRunSubDir","mkdirSync","outputFilePath","mkdtempSync","agentReports","runnerSources","groupIds","index","serialized","groupId","dumps","originalId","uuid","agentReport","agentReportTiming","metrics","collectTestRunReportMetrics","executionMetrics","execution","mergeTestRunReportDumps","publishReportArtifactSync","sourcePath","durationMs","timing","collectReportSummary","executionTimes","Number","started","Math","ended","Date","fileName","uniqueTestRunReportSources","sources","unique","scopeId","prepareTestRunReportSources","loadedDumps","prepared","diagnostics","ownerByScopedExecution","preparedByPath","sourceIndex","baseDump","readFileSync","collectDedupedExecutions","error","String","sourceKey","imageOrigins","JSON","_key","ref","normalizeStoredImageRef","shared","origin","scoped","item","executionIds","executionId","owner","partial","collection","reportId","scopedExecution","previousOwner","preparedSource","field","status","diagnostic","TestRunReportAssembler","loaded","Promise","directoryMode","finalPath","htmlPath","runnerDump","finalArtifactPath","directoryReportPath","standaloneReportPath","finalReportPath","existingArtifacts","temporaryRoot","temporaryArtifactPath","temporaryReportPath","executionSerial","latestSerialByExecutionId","dumpScript","groupedDump","externalizeImagesInExecution","images","visit","node","relativePath","splitReportHtmlByExecution","screenshotsDir","executionJsonFiles","ReportImageExporter","fileIndex","singleExecutionDump","jsonFilePath","writeFileSync"],"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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACmFO,eAAeI,qBACpBC,OAAoC;IAEpCC,8BAA8BD,QAAQ,cAAc;IACpD,MAAME,QAAQC,mCAAAA,OAAY,CAACH,QAAQ,UAAU;IAC7C,MAAMI,SAASD,mCAAAA,OAAY,CAACH,QAAQ,SAAS;IAC7C,MAAMK,WAAWL,AAAyB,+BAAzBA,QAAQ,YAAY;IACrC,MAAMM,WAAWH,mCAAAA,IAAS,CAACC,QAAQJ,QAAQ,cAAc;IACzD,MAAMO,cAAcF,WAChBF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UAAU;YAC/B,YAAY;gBAACzB;aAAU;QACzB;QAEA,MAAMkF,eAAerM,mCAAAA,IAAS,CAACyF,WAAW,GAAG0G,UAAU,eAAe,CAAC;QACvEG,IAAAA,iCAAAA,aAAAA,AAAAA,EAAcD,cAAcD,oBAAoB,SAAS,CAAC,IAAI;QAC9DH,mBAAmB,IAAI,CAACI;IAC1B;IAEA,OAAO;QACLJ;QACA,iBAAiBN,OAAO,KAAK;IAC/B;AACF"}
|
package/dist/lib/utils.js
CHANGED
|
@@ -228,7 +228,7 @@ function stringifyDumpData(data, indents) {
|
|
|
228
228
|
return JSON.stringify(data, replacerForPageObject, indents);
|
|
229
229
|
}
|
|
230
230
|
function getVersion() {
|
|
231
|
-
return "1.17.
|
|
231
|
+
return "1.17.7";
|
|
232
232
|
}
|
|
233
233
|
function debugLog(...message) {
|
|
234
234
|
const debugMode = process.env[env_namespaceObject.MIDSCENE_DEBUG_MODE];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ConversationSystemMessage, ConversationUserMessage } from '../service-caller/types';
|
|
2
|
+
declare const parts: readonly ["instructions", "screenshot", "task", "references"];
|
|
3
|
+
type Part = (typeof parts)[number];
|
|
4
|
+
export type LocateMessages = (ConversationSystemMessage | ConversationUserMessage)[];
|
|
5
|
+
type TextPart = Extract<Part, 'instructions' | 'task'>;
|
|
6
|
+
type PromptGroup = {
|
|
7
|
+
mode: 'system';
|
|
8
|
+
parts: TextPart[];
|
|
9
|
+
} | {
|
|
10
|
+
mode: 'userTogether' | 'userEach';
|
|
11
|
+
parts: Part[];
|
|
12
|
+
};
|
|
13
|
+
export interface LocatePromptOrder {
|
|
14
|
+
groups: readonly PromptGroup[];
|
|
15
|
+
}
|
|
16
|
+
export declare function parseLocatePromptOrder(order?: string): LocatePromptOrder;
|
|
17
|
+
export declare function buildLocateMessages(order: LocatePromptOrder, input: {
|
|
18
|
+
instructions: string;
|
|
19
|
+
screenshot: string;
|
|
20
|
+
task: string;
|
|
21
|
+
references: ConversationUserMessage[];
|
|
22
|
+
}): LocateMessages;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=locate-prompt-order.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locate-prompt-order.d.ts","sourceRoot":"","sources":["../../../../src/ai-model/model-adapter/locate-prompt-order.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yBAAyB,EACzB,uBAAuB,EAExB,MAAM,yBAAyB,CAAC;AAEjC,QAAA,MAAM,KAAK,+DAAgE,CAAC;AAC5E,KAAK,IAAI,GAAG,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnC,MAAM,MAAM,cAAc,GAAG,CACzB,yBAAyB,GACzB,uBAAuB,CAC1B,EAAE,CAAC;AAEJ,KAAK,QAAQ,GAAG,OAAO,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAAC,CAAC;AACvD,KAAK,WAAW,GACZ;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,QAAQ,EAAE,CAAA;CAAE,GACrC;IAAE,IAAI,EAAE,cAAc,GAAG,UAAU,CAAC;IAAC,KAAK,EAAE,IAAI,EAAE,CAAA;CAAE,CAAC;AAEzD,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,SAAS,WAAW,EAAE,CAAC;CAChC;AAED,wBAAgB,sBAAsB,CACpC,KAAK,SAA4E,GAChF,iBAAiB,CAuCnB;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,iBAAiB,EACxB,KAAK,EAAE;IACL,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,uBAAuB,EAAE,CAAC;CACvC,GACA,cAAc,CAgChB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locate.d.ts","sourceRoot":"","sources":["../../../../src/ai-model/model-adapter/locate.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"locate.d.ts","sourceRoot":"","sources":["../../../../src/ai-model/model-adapter/locate.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,yBAAyB,CAAC;AAMhF,OAAO,KAAK,EACV,6BAA6B,EAE9B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAcrE,wBAAgB,aAAa,CAC3B,MAAM,EAAE,sBAAsB,CAAC,QAAQ,CAAC,EACxC,qBAAqB,EAAE,gCAAgC,GAAG,SAAS,EACnE,eAAe,EAAE,6BAA6B,GAC7C,aAAa,CAoEf"}
|
|
@@ -9,6 +9,7 @@ import type { PlanFn } from '../workflows/planning/types';
|
|
|
9
9
|
import type { CustomPlanningDefinition } from './custom-planning-types';
|
|
10
10
|
import type { ImagePreprocessPolicy } from './image-preprocess';
|
|
11
11
|
import type { InsightAdapter, InsightDefinition } from './insight-protocol';
|
|
12
|
+
import type { LocatePromptOrder } from './locate-prompt-order';
|
|
12
13
|
import type { StandardLocateProtocol, StandardLocateProtocolDefinition } from './locate-protocol';
|
|
13
14
|
import type { StandardPlanningProtocol, StandardPlanningProtocolDefinition } from './planning-protocol';
|
|
14
15
|
export type { ImagePreprocessPolicy, JsonParser, JsonParserContext, JsonParserSource, };
|
|
@@ -172,10 +173,9 @@ export type PlanningDefinition = (Partial<PlanningPolicy> & {
|
|
|
172
173
|
planFn: PlanFn;
|
|
173
174
|
planner?: never;
|
|
174
175
|
}));
|
|
175
|
-
export type LocateUserMessageContentOrder = 'image-first' | 'prompt-first';
|
|
176
176
|
type StandardLocateAdapter = {
|
|
177
177
|
kind: 'standard';
|
|
178
|
-
|
|
178
|
+
promptOrder: LocatePromptOrder;
|
|
179
179
|
element: LocateOperation;
|
|
180
180
|
searchArea?: LocateOperation;
|
|
181
181
|
};
|
|
@@ -190,7 +190,13 @@ type CustomLocateAdapter = {
|
|
|
190
190
|
export type LocateAdapter = StandardLocateAdapter | CustomLocateAdapter;
|
|
191
191
|
type StandardLocateDefinition = {
|
|
192
192
|
kind?: 'standard';
|
|
193
|
-
|
|
193
|
+
/**
|
|
194
|
+
* Shared layout for element and search-area requests, in message order.
|
|
195
|
+
* system(...) accepts instructions and task; userTogether(...) and
|
|
196
|
+
* userEach(...) also accept screenshot and references. Each part occurs once.
|
|
197
|
+
* Text parts within one system group are joined with a blank line.
|
|
198
|
+
*/
|
|
199
|
+
promptOrder?: string;
|
|
194
200
|
element?: LocateOperationDefinition;
|
|
195
201
|
searchArea?: LocateOperationDefinition | false;
|
|
196
202
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/ai-model/model-adapter/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EACV,YAAY,EACZ,OAAO,EACP,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,KAAK,EACV,UAAU,EACV,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EACV,iBAAiB,EACjB,4BAA4B,EAC5B,iBAAiB,EACjB,+BAA+B,EAChC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,KAAK,EAAE,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C3B,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,EAAE,YAAY,CAAC;IACtB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE;QACd,cAAc,EAAE,MAAM,CAAC;QACvB,aAAa,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;QACpC,QAAQ,EAAE,aAAa,CAAC;QACxB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF;;;;;OAKG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IACvC,yEAAyE;IACzE,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC;AAED,MAAM,WAAW,sBAAsB;IACrC,8CAA8C;IAC9C,SAAS,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;IACtC,iEAAiE;IACjE,gBAAgB,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;IAC5C,+EAA+E;IAC/E,kBAAkB,CAAC,EAAE,cAAc,EAAE,CAAC;IACtC,UAAU,CAAC,EAAE,gBAAgB,GAAG,UAAU,CAAC;IAC3C,cAAc,CAAC,EAAE,wBAAwB,CAAC;IAC1C,SAAS,CAAC,EAAE,mBAAmB,CAAC;IAChC,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,yBAAyB,CAAC,EAAE,yBAAyB,CAAC;IACtD,eAAe,CAAC,EAAE,yBAAyB,CAAC;IAC5C,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B"}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import type { ConversationSystemMessage, ConversationUserMessage } from '../../service-caller/types';
|
|
2
1
|
import { type TUserPrompt } from '../../../common';
|
|
3
2
|
import { type ImagePreprocessPolicy, type PreparedModelImage } from '../../model-adapter/image-preprocess';
|
|
4
|
-
import type
|
|
3
|
+
import { type LocateMessages, type LocatePromptOrder } from '../../model-adapter/locate-prompt-order';
|
|
5
4
|
import type { ModelRuntime } from '../../models';
|
|
6
|
-
export
|
|
7
|
-
ConversationSystemMessage,
|
|
8
|
-
...ConversationUserMessage[]
|
|
9
|
-
];
|
|
10
|
-
export declare function prepareLocateModelInput({ locateImage, targetDescription, systemPrompt, userPrompt, imagePreprocess, userMessageContentOrder, }: {
|
|
5
|
+
export declare function prepareLocateModelInput({ locateImage, targetDescription, systemPrompt, userPrompt, imagePreprocess, promptOrder, }: {
|
|
11
6
|
locateImage: {
|
|
12
7
|
imageBase64: string;
|
|
13
8
|
width: number;
|
|
@@ -17,9 +12,9 @@ export declare function prepareLocateModelInput({ locateImage, targetDescription
|
|
|
17
12
|
systemPrompt: string;
|
|
18
13
|
userPrompt: string;
|
|
19
14
|
imagePreprocess: ImagePreprocessPolicy;
|
|
20
|
-
|
|
15
|
+
promptOrder: LocatePromptOrder;
|
|
21
16
|
}): Promise<{
|
|
22
|
-
messages:
|
|
17
|
+
messages: LocateMessages;
|
|
23
18
|
preparedImage: PreparedModelImage;
|
|
24
19
|
}>;
|
|
25
20
|
export declare function formatLocateModelContext(modelRuntime: ModelRuntime): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/ai-model/workflows/grounding/utils.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/ai-model/workflows/grounding/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAgC,MAAM,UAAU,CAAC;AAC1E,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EAExB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,iBAAiB,EAEvB,MAAM,yCAAyC,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAGjD,wBAAsB,uBAAuB,CAAC,EAC5C,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,UAAU,EACV,eAAe,EACf,WAAW,GACZ,EAAE;IACD,WAAW,EAAE;QACX,WAAW,EAAE,MAAM,CAAC;QACpB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,iBAAiB,EAAE,WAAW,CAAC;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,qBAAqB,CAAC;IACvC,WAAW,EAAE,iBAAiB,CAAC;CAChC,GAAG,OAAO,CAAC;IACV,QAAQ,EAAE,cAAc,CAAC;IACzB,aAAa,EAAE,kBAAkB,CAAC;CACnC,CAAC,CAmBD;AAED,wBAAgB,wBAAwB,CAAC,YAAY,EAAE,YAAY,GAAG,MAAM,CAG3E"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type StoredImageRef } from './image-reference';
|
|
2
|
+
/** Export image bytes once while keeping every observation's own metadata. */
|
|
3
|
+
export declare class ReportImageExporter {
|
|
4
|
+
private readonly reportPath;
|
|
5
|
+
private readonly screenshotsDir;
|
|
6
|
+
private readonly locations;
|
|
7
|
+
private readonly writtenFiles;
|
|
8
|
+
constructor(reportPath: string, screenshotsDir: string);
|
|
9
|
+
write(ref: StoredImageRef, dataUri?: string): string;
|
|
10
|
+
get files(): string[];
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=report-image-export.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report-image-export.d.ts","sourceRoot":"","sources":["../../../src/dump/report-image-export.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAyB,MAAM,mBAAmB,CAAC;AAO/E,8EAA8E;AAC9E,qBAAa,mBAAmB;IAK5B,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,cAAc;IALjC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA6B;IACvD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAqB;gBAG/B,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,MAAM;IAGzC,KAAK,CAAC,GAAG,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM;IAuBpD,IAAI,KAAK,IAAI,MAAM,EAAE,CAIpB;CACF"}
|
|
@@ -61,6 +61,8 @@ export declare class ReportImageStore {
|
|
|
61
61
|
enableFileCopies(): void;
|
|
62
62
|
/** Resolve an observation/reference ID to its content-addressed asset. */
|
|
63
63
|
getFilePath(id: string): string;
|
|
64
|
+
/** Keep diagnostic bytes without changing the screenshot's report location. */
|
|
65
|
+
persistFileCopy(screenshot: ScreenshotItem): Promise<ScreenshotRef>;
|
|
64
66
|
persist(screenshot: ScreenshotItem): Promise<ScreenshotRef>;
|
|
65
67
|
/** Persist a base64 multimodal prompt image and return its content-addressed ref. */
|
|
66
68
|
persistReferenceImage(imageUrl: string): Promise<ImageUrlRef>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenshot-store.d.ts","sourceRoot":"","sources":["../../../src/dump/screenshot-store.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,cAAc,EAMpB,MAAM,mBAAmB,CAAC;AAG3B,YAAY,EACV,WAAW,EACX,aAAa,EACb,cAAc,GACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,mBAAmB,CAAC;AAI3B,KAAK,mBAAmB,GACpB;IACE,IAAI,EAAE,UAAU,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,QA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MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;YAiDrD,kCAAkC;YA0BlC,2BAA2B;YAqB3B,sBAAsB;IAyCpC,+DAA+D;IAC/D,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM;IAmBtC,mCAAmC;IACnC,UAAU,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM;IAQrC,OAAO,IAAI,IAAI;CAchB;AAED,wCAAwC;AACxC,OAAO,EAAE,gBAAgB,IAAI,eAAe,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report-cli.d.ts","sourceRoot":"","sources":["../../src/report-cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"report-cli.d.ts","sourceRoot":"","sources":["../../src/report-cli.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkBxB,KAAK,mBAAmB,GAAG;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,KAAK,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACd,CAAC,CAAC;CACJ,CAAC;AAEF,KAAK,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC;AAEpD,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,eAAe,CAAC;IACxB,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC1E;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,0BAA0B,CAAC;CACjC;AAED,MAAM,MAAM,uBAAuB,GAC/B,OAAO,GACP,aAAa,GACb,YAAY,GACZ,QAAQ,CAAC;AAEb,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,sBAAsB,GAAG,wBAAwB,CAAC;AAC9D,MAAM,MAAM,2BAA2B,GAAG,wBAAwB,CAAC;AAEnE,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,aAAa,GAAG,0BAA0B,CAAC;IAC1D,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,sBAAsB;IACrC,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAyED,wBAAgB,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG;IAChE,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B,CAeA;AAED,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,2BAA2B,GACnC,OAAO,CAAC;IAAE,aAAa,EAAE,MAAM,EAAE,CAAC;IAAC,eAAe,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAYjE;AAuFD,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,uBAAuB,GAC/B,sBAAsB,CAiCxB;AAuLD,wBAAgB,uBAAuB,IAAI,qBAAqB,EAAE,CAOjE"}
|
|
@@ -19,7 +19,7 @@ export interface IReportGenerator {
|
|
|
19
19
|
* Wait for all queued write operations to complete.
|
|
20
20
|
*/
|
|
21
21
|
flush(): Promise<void>;
|
|
22
|
-
enableSourceSnapshots?(): void;
|
|
22
|
+
enableSourceSnapshots?(scopeId?: string): void;
|
|
23
23
|
createSourceSnapshot?(scopeId: string, executionIds?: readonly string[]): Promise<WorkflowReportSource | undefined>;
|
|
24
24
|
/**
|
|
25
25
|
* Finalize the report. Calls flush() internally.
|
|
@@ -44,6 +44,8 @@ export declare class ReportGenerator implements IReportGenerator {
|
|
|
44
44
|
private executionLogFileIndexByExecutionKey;
|
|
45
45
|
private readonly reportStreamId;
|
|
46
46
|
private screenshotStore;
|
|
47
|
+
private sourceStore?;
|
|
48
|
+
private sourceDirectory?;
|
|
47
49
|
private initialized;
|
|
48
50
|
private lastExecution?;
|
|
49
51
|
private lastReportMeta?;
|
|
@@ -77,7 +79,7 @@ export declare class ReportGenerator implements IReportGenerator {
|
|
|
77
79
|
private assertOpen;
|
|
78
80
|
getReportPath(): string | undefined;
|
|
79
81
|
writeRunnerReport(input: RunReportInput, scopeId: string, meta: ReportMeta): Promise<string>;
|
|
80
|
-
enableSourceSnapshots(): void;
|
|
82
|
+
enableSourceSnapshots(scopeId?: string): void;
|
|
81
83
|
private serializeSourceDump;
|
|
82
84
|
createSourceSnapshot(scopeId: string, executionIds?: readonly string[]): Promise<WorkflowReportSource & {
|
|
83
85
|
dumpPath: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report-generator.d.ts","sourceRoot":"","sources":["../../src/report-generator.ts"],"names":[],"mappings":"AA2CA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAEvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EACL,KAAK,aAAa,EAClB,gBAAgB,EAChB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,cAAc,EACpB,MAAM,SAAS,CAAC;AAMjB,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;OAOG;IACH,iBAAiB,CACf,SAAS,EAAE,aAAa,EACxB,UAAU,EAAE,UAAU,EACtB,UAAU,CAAC,EAAE,gBAAgB,GAC5B,IAAI,CAAC;IAER;;OAEG;IACH,YAAY,CAAC,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAE5C;;OAEG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,qBAAqB,CAAC,
|
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