@midscene/shared 1.8.5-beta-20260525120212.0 → 1.8.5

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.
@@ -5,7 +5,7 @@ import { assert } from "../utils.mjs";
5
5
  import { maskConfig, parseJson } from "./helper.mjs";
6
6
  import { initDebugConfig } from "./init-debug.mjs";
7
7
  const MODEL_CONFIG_DOC_URL = 'https://midscenejs.com/model-common-config.html';
8
- const getCurrentVersion = ()=>"1.8.5-beta-20260525120212.0";
8
+ const getCurrentVersion = ()=>"1.8.5";
9
9
  const getInvalidModelFamilyMessage = (modelFamily)=>`Invalid MIDSCENE_MODEL_FAMILY value: ${modelFamily}. Current version v${getCurrentVersion()} accepts the following model families: ${MODEL_FAMILY_VALUES.join(', ')}. You can also visit ${MODEL_CONFIG_DOC_URL} for the latest configuration information.`;
10
10
  const KEYS_MAP = {
11
11
  insight: INSIGHT_MODEL_CONFIG_KEYS,
@@ -337,6 +337,9 @@ function generateCommonTools(getAgent, initArgSchema = {}, initArgCliMetadata) {
337
337
  const agent = await getAgent(args);
338
338
  const screenshot = await agent.page?.screenshotBase64();
339
339
  if (!screenshot) return createErrorResult('Screenshot not available');
340
+ await agent.recordToReport?.('take_screenshot', {
341
+ screenshotBase64: screenshot
342
+ });
340
343
  const { mimeType, body } = parseBase64(screenshot);
341
344
  return {
342
345
  content: [
@@ -37,7 +37,7 @@ const external_utils_js_namespaceObject = require("../utils.js");
37
37
  const external_helper_js_namespaceObject = require("./helper.js");
38
38
  const external_init_debug_js_namespaceObject = require("./init-debug.js");
39
39
  const MODEL_CONFIG_DOC_URL = 'https://midscenejs.com/model-common-config.html';
40
- const getCurrentVersion = ()=>"1.8.5-beta-20260525120212.0";
40
+ const getCurrentVersion = ()=>"1.8.5";
41
41
  const getInvalidModelFamilyMessage = (modelFamily)=>`Invalid MIDSCENE_MODEL_FAMILY value: ${modelFamily}. Current version v${getCurrentVersion()} accepts the following model families: ${external_types_js_namespaceObject.MODEL_FAMILY_VALUES.join(', ')}. You can also visit ${MODEL_CONFIG_DOC_URL} for the latest configuration information.`;
42
42
  const KEYS_MAP = {
43
43
  insight: external_constants_js_namespaceObject.INSIGHT_MODEL_CONFIG_KEYS,
@@ -367,6 +367,9 @@ function generateCommonTools(getAgent, initArgSchema = {}, initArgCliMetadata) {
367
367
  const agent = await getAgent(args);
368
368
  const screenshot = await agent.page?.screenshotBase64();
369
369
  if (!screenshot) return createErrorResult('Screenshot not available');
370
+ await agent.recordToReport?.('take_screenshot', {
371
+ screenshotBase64: screenshot
372
+ });
370
373
  const { mimeType, body } = (0, img_namespaceObject.parseBase64)(screenshot);
371
374
  return {
372
375
  content: [
@@ -107,6 +107,10 @@ export interface BaseAgent {
107
107
  page?: {
108
108
  screenshotBase64(): Promise<string>;
109
109
  };
110
+ recordToReport?: (title?: string, opt?: {
111
+ content?: string;
112
+ screenshotBase64?: string;
113
+ }) => Promise<void>;
110
114
  callActionInActionSpace?: (actionName: string, params?: unknown) => Promise<unknown>;
111
115
  aiAction?: (description: string, params?: Record<string, unknown>) => Promise<unknown>;
112
116
  aiWaitFor?: (assertion: string, options: Record<string, unknown>) => Promise<unknown>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midscene/shared",
3
- "version": "1.8.5-beta-20260525120212.0",
3
+ "version": "1.8.5",
4
4
  "repository": "https://github.com/web-infra-dev/midscene",
5
5
  "homepage": "https://midscenejs.com/",
6
6
  "types": "./dist/types/index.d.ts",
@@ -571,6 +571,9 @@ export function generateCommonTools(
571
571
  if (!screenshot) {
572
572
  return createErrorResult('Screenshot not available');
573
573
  }
574
+ await agent.recordToReport?.('take_screenshot', {
575
+ screenshotBase64: screenshot,
576
+ });
574
577
  const { mimeType, body } = parseBase64(screenshot);
575
578
  return {
576
579
  content: [{ type: 'image', data: body, mimeType }],
package/src/mcp/types.ts CHANGED
@@ -110,6 +110,10 @@ export interface BaseAgent {
110
110
  page?: {
111
111
  screenshotBase64(): Promise<string>;
112
112
  };
113
+ recordToReport?: (
114
+ title?: string,
115
+ opt?: { content?: string; screenshotBase64?: string },
116
+ ) => Promise<void>;
113
117
  callActionInActionSpace?: (
114
118
  actionName: string,
115
119
  params?: unknown,