@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.
- package/dist/es/env/parse-model-config.mjs +1 -1
- package/dist/es/mcp/tool-generator.mjs +3 -0
- package/dist/lib/env/parse-model-config.js +1 -1
- package/dist/lib/mcp/tool-generator.js +3 -0
- package/dist/types/mcp/types.d.ts +4 -0
- package/package.json +1 -1
- package/src/mcp/tool-generator.ts +3 -0
- package/src/mcp/types.ts +4 -0
|
@@ -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
|
|
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
|
|
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
|
@@ -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,
|