@midscene/core 1.10.6 → 1.10.7-beta-20260720030503.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/es/agent/utils.mjs +3 -15
  2. package/dist/es/agent/utils.mjs.map +1 -1
  3. package/dist/es/dump/report-action-dump.mjs +5 -2
  4. package/dist/es/dump/report-action-dump.mjs.map +1 -1
  5. package/dist/es/dump/screenshot-store.mjs +5 -2
  6. package/dist/es/dump/screenshot-store.mjs.map +1 -1
  7. package/dist/es/report-cli.mjs.map +1 -1
  8. package/dist/es/report-markdown.mjs +19 -19
  9. package/dist/es/report-markdown.mjs.map +1 -1
  10. package/dist/es/report.mjs +4 -3
  11. package/dist/es/report.mjs.map +1 -1
  12. package/dist/es/screenshot-item.mjs +13 -8
  13. package/dist/es/screenshot-item.mjs.map +1 -1
  14. package/dist/es/types.mjs.map +1 -1
  15. package/dist/es/utils.mjs +2 -2
  16. package/dist/lib/agent/utils.js +2 -14
  17. package/dist/lib/agent/utils.js.map +1 -1
  18. package/dist/lib/dump/report-action-dump.js +5 -2
  19. package/dist/lib/dump/report-action-dump.js.map +1 -1
  20. package/dist/lib/dump/screenshot-store.js +5 -2
  21. package/dist/lib/dump/screenshot-store.js.map +1 -1
  22. package/dist/lib/report-cli.js.map +1 -1
  23. package/dist/lib/report-markdown.js +19 -19
  24. package/dist/lib/report-markdown.js.map +1 -1
  25. package/dist/lib/report.js +4 -3
  26. package/dist/lib/report.js.map +1 -1
  27. package/dist/lib/screenshot-item.js +13 -8
  28. package/dist/lib/screenshot-item.js.map +1 -1
  29. package/dist/lib/types.js.map +1 -1
  30. package/dist/lib/utils.js +2 -2
  31. package/dist/types/dump/report-action-dump.d.ts +2 -2
  32. package/dist/types/dump/screenshot-store.d.ts +2 -1
  33. package/dist/types/report-markdown.d.ts +2 -1
  34. package/dist/types/screenshot-item.d.ts +6 -3
  35. package/dist/types/types.d.ts +2 -2
  36. package/package.json +2 -2
@@ -75,10 +75,10 @@ export declare class ReportActionDump implements IReportActionDump {
75
75
  */
76
76
  collectAllScreenshots(): ScreenshotItem[];
77
77
  /**
78
- * Serialize the dump to files with screenshots as separate PNG files.
78
+ * Serialize the dump to files with screenshots as separate image files.
79
79
  * Creates:
80
80
  * - {basePath} - dump JSON with { $screenshot: id } references
81
- * - {basePath}.screenshots/ - PNG files
81
+ * - {basePath}.screenshots/ - screenshot image files
82
82
  *
83
83
  * @param basePath - Base path for the dump file
84
84
  */
@@ -1,9 +1,10 @@
1
+ import { type ScreenshotImageMimeType } from '@midscene/shared/img';
1
2
  import type { ScreenshotItem } from '../screenshot-item';
2
3
  export interface ScreenshotRef {
3
4
  type: 'midscene_screenshot_ref';
4
5
  id: string;
5
6
  capturedAt: number;
6
- mimeType: 'image/png' | 'image/jpeg';
7
+ mimeType: ScreenshotImageMimeType;
7
8
  storage: 'inline' | 'file';
8
9
  path?: string;
9
10
  }
@@ -1,4 +1,5 @@
1
1
  import type { ExecutionDump, IExecutionDump, IReportActionDump, ReportActionDump } from './types';
2
+ import { type ScreenshotImageMimeType } from '@midscene/shared/img';
2
3
  import type { ScreenshotRef } from './dump/screenshot-store';
3
4
  export interface MarkdownAttachment {
4
5
  id: string;
@@ -8,7 +9,7 @@ export interface MarkdownAttachment {
8
9
  * write the screenshot under this name to keep links in sync. See #2392.
9
10
  */
10
11
  suggestedFileName: string;
11
- mimeType?: string;
12
+ mimeType?: ScreenshotImageMimeType;
12
13
  /**
13
14
  * Reference to the screenshot in the source report, used to locate the
14
15
  * original bytes when copying them to the exported name. Absent for in-memory
@@ -1,3 +1,4 @@
1
+ import { type ScreenshotImageFormat, type ScreenshotImageMimeType } from '@midscene/shared/img';
1
2
  import { type ScreenshotRef } from './dump/screenshot-store';
2
3
  /**
3
4
  * Serialization format for ScreenshotItem
@@ -27,10 +28,12 @@ export declare class ScreenshotItem {
27
28
  /** Create a new ScreenshotItem from base64 data */
28
29
  static create(base64: string, capturedAt: number): ScreenshotItem;
29
30
  get id(): string;
30
- /** Get the image format (png or jpeg) */
31
- get format(): 'png' | 'jpeg';
31
+ /** Get the image format (PNG, JPEG, or WebP). */
32
+ get format(): ScreenshotImageFormat;
32
33
  /** Get the file extension for this screenshot */
33
- get extension(): string;
34
+ get extension(): ScreenshotImageFormat;
35
+ /** Get the MIME type for this screenshot. */
36
+ get mimeType(): ScreenshotImageMimeType;
34
37
  /** Get screenshot capture timestamp in milliseconds */
35
38
  get capturedAt(): number;
36
39
  get base64(): string;
@@ -369,7 +369,7 @@ export interface ExecutionRecorderItem {
369
369
  }
370
370
  export interface RecordToReportScreenshot {
371
371
  /**
372
- * PNG/JPEG data URI, or raw PNG base64 body.
372
+ * PNG/JPEG/WebP data URI, or raw PNG/WebP base64 body.
373
373
  */
374
374
  base64: string;
375
375
  description?: string;
@@ -628,7 +628,7 @@ export interface AgentOpt {
628
628
  * Use directory-based report format with separate image files.
629
629
  *
630
630
  * When enabled:
631
- * - Screenshots are saved as PNG files in a `screenshots/` subdirectory
631
+ * - Screenshots retain their image format in a `screenshots/` subdirectory
632
632
  * - Report is generated as `index.html` with relative image paths
633
633
  * - Reduces memory usage and report file size
634
634
  *
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@midscene/core",
3
3
  "description": "Automate browser actions, extract data, and perform assertions using AI. It offers JavaScript SDK, Chrome extension, and support for scripting in YAML. See https://midscenejs.com/ for details.",
4
- "version": "1.10.6",
4
+ "version": "1.10.7-beta-20260720030503.0",
5
5
  "repository": "https://github.com/web-infra-dev/midscene",
6
6
  "homepage": "https://midscenejs.com/",
7
7
  "main": "./dist/lib/index.js",
@@ -115,7 +115,7 @@
115
115
  "semver": "7.5.2",
116
116
  "undici": "^6.0.0",
117
117
  "zod": "^3.25.1",
118
- "@midscene/shared": "1.10.6"
118
+ "@midscene/shared": "1.10.7-beta-20260720030503.0"
119
119
  },
120
120
  "devDependencies": {
121
121
  "@rslib/core": "^0.18.3",