@midscene/mcp 1.2.1-beta-20260112114129.0 → 1.2.1-beta-20260113073450.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +18 -12
- package/dist/server.js +18 -12
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -24035,6 +24035,12 @@ var __webpack_modules__ = {
|
|
|
24035
24035
|
thought: lib.z.string().describe('The thought of the assertion, like "I can see there are A, B, C elements on the page, which means ... , so the assertion is true"'),
|
|
24036
24036
|
result: lib.z.boolean().describe('The result of the assertion, true or false')
|
|
24037
24037
|
});
|
|
24038
|
+
lib.z.object({
|
|
24039
|
+
millisecond: lib.z.number().default(1000).optional().describe('Sleep duration in milliseconds, defaults to 1000ms (1 second)')
|
|
24040
|
+
});
|
|
24041
|
+
lib.z.object({
|
|
24042
|
+
message: lib.z.string().optional().describe('The conclusion, data, or return value that the user needs. This message will be provided to the user when the task is finalized.')
|
|
24043
|
+
});
|
|
24038
24044
|
require("node:assert");
|
|
24039
24045
|
__webpack_require__("../../node_modules/.pnpm/semver@7.5.2/node_modules/semver/index.js");
|
|
24040
24046
|
__webpack_require__("../../node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/dayjs.min.js");
|
|
@@ -24088,7 +24094,7 @@ var __webpack_modules__ = {
|
|
|
24088
24094
|
}
|
|
24089
24095
|
return false;
|
|
24090
24096
|
}
|
|
24091
|
-
function
|
|
24097
|
+
function getZodTypeName(field, locatorTypeDescription) {
|
|
24092
24098
|
const actualField = unwrapZodField(field);
|
|
24093
24099
|
const fieldTypeName = actualField._def?.typeName;
|
|
24094
24100
|
if ('ZodString' === fieldTypeName) return 'string';
|
|
@@ -24106,14 +24112,14 @@ var __webpack_modules__ = {
|
|
|
24106
24112
|
if ('ZodUnion' === fieldTypeName) {
|
|
24107
24113
|
const options = actualField._def?.options;
|
|
24108
24114
|
if (options && options.length > 0) {
|
|
24109
|
-
const types = options.map((opt)=>
|
|
24115
|
+
const types = options.map((opt)=>getZodTypeName(opt, locatorTypeDescription));
|
|
24110
24116
|
return types.join(' | ');
|
|
24111
24117
|
}
|
|
24112
24118
|
return 'union';
|
|
24113
24119
|
}
|
|
24114
24120
|
return 'unknown';
|
|
24115
24121
|
}
|
|
24116
|
-
function
|
|
24122
|
+
function getZodDescription(field) {
|
|
24117
24123
|
if ("description" in field) return field.description || null;
|
|
24118
24124
|
const actualField = unwrapZodField(field);
|
|
24119
24125
|
if ("description" in actualField) return actualField.description || null;
|
|
@@ -24129,16 +24135,16 @@ var __webpack_modules__ = {
|
|
|
24129
24135
|
const schema = action.paramSchema;
|
|
24130
24136
|
const isZodObjectType = schema._def?.typeName === 'ZodObject';
|
|
24131
24137
|
if (!isZodObjectType || !schema.shape) {
|
|
24132
|
-
const typeName =
|
|
24133
|
-
const description =
|
|
24138
|
+
const typeName = getZodTypeName(schema);
|
|
24139
|
+
const description = getZodDescription(schema);
|
|
24134
24140
|
const paramDesc = description ? `${typeName} - ${description}` : typeName;
|
|
24135
24141
|
return `${action.name} action, ${actionDesc}. Parameter: ${paramDesc}`;
|
|
24136
24142
|
}
|
|
24137
24143
|
const paramDescriptions = [];
|
|
24138
24144
|
for (const [key, field] of Object.entries(schema.shape))if (field && 'object' == typeof field) {
|
|
24139
24145
|
const isFieldOptional = 'function' == typeof field.isOptional && field.isOptional();
|
|
24140
|
-
const typeName =
|
|
24141
|
-
const description =
|
|
24146
|
+
const typeName = getZodTypeName(field);
|
|
24147
|
+
const description = getZodDescription(field);
|
|
24142
24148
|
let paramStr = `${key}${isFieldOptional ? '?' : ''} (${typeName})`;
|
|
24143
24149
|
if (description) paramStr += ` - ${description}`;
|
|
24144
24150
|
paramDescriptions.push(paramStr);
|
|
@@ -24149,7 +24155,7 @@ var __webpack_modules__ = {
|
|
|
24149
24155
|
function isZodOptional(value) {
|
|
24150
24156
|
return '_def' in value && value._def?.typeName === 'ZodOptional';
|
|
24151
24157
|
}
|
|
24152
|
-
function
|
|
24158
|
+
function isZodObject(value) {
|
|
24153
24159
|
return '_def' in value && value._def?.typeName === 'ZodObject' && 'shape' in value;
|
|
24154
24160
|
}
|
|
24155
24161
|
function unwrapOptional(value) {
|
|
@@ -24163,7 +24169,7 @@ var __webpack_modules__ = {
|
|
|
24163
24169
|
};
|
|
24164
24170
|
}
|
|
24165
24171
|
function isLocateField(value) {
|
|
24166
|
-
if (!
|
|
24172
|
+
if (!isZodObject(value)) return false;
|
|
24167
24173
|
return 'prompt' in value.shape;
|
|
24168
24174
|
}
|
|
24169
24175
|
function makePromptOptional(value, wrapInOptional) {
|
|
@@ -24177,7 +24183,7 @@ var __webpack_modules__ = {
|
|
|
24177
24183
|
}
|
|
24178
24184
|
function transformSchemaField(key, value) {
|
|
24179
24185
|
const { innerValue, isOptional } = unwrapOptional(value);
|
|
24180
|
-
if (
|
|
24186
|
+
if (isZodObject(innerValue) && isLocateField(innerValue)) return [
|
|
24181
24187
|
key,
|
|
24182
24188
|
makePromptOptional(innerValue, isOptional)
|
|
24183
24189
|
];
|
|
@@ -24189,7 +24195,7 @@ var __webpack_modules__ = {
|
|
|
24189
24195
|
function extractActionSchema(paramSchema) {
|
|
24190
24196
|
if (!paramSchema) return {};
|
|
24191
24197
|
const schema = paramSchema;
|
|
24192
|
-
if (!
|
|
24198
|
+
if (!isZodObject(schema)) return schema;
|
|
24193
24199
|
return Object.fromEntries(Object.entries(schema.shape).map(([key, value])=>transformSchemaField(key, value)));
|
|
24194
24200
|
}
|
|
24195
24201
|
function serializeArgsToDescription(args) {
|
|
@@ -24576,7 +24582,7 @@ For more information, visit: https://midscenejs.com/mcp-migration
|
|
|
24576
24582
|
constructor(){
|
|
24577
24583
|
super({
|
|
24578
24584
|
name: '@midscene/mcp',
|
|
24579
|
-
version: '1.2.1-beta-
|
|
24585
|
+
version: '1.2.1-beta-20260113073450.0',
|
|
24580
24586
|
description: 'Deprecated - Use @midscene/web-bridge-mcp, @midscene/android-mcp, or @midscene/ios-mcp'
|
|
24581
24587
|
});
|
|
24582
24588
|
}
|
package/dist/server.js
CHANGED
|
@@ -31235,6 +31235,12 @@ var __webpack_exports__ = {};
|
|
|
31235
31235
|
thought: lib.z.string().describe('The thought of the assertion, like "I can see there are A, B, C elements on the page, which means ... , so the assertion is true"'),
|
|
31236
31236
|
result: lib.z.boolean().describe('The result of the assertion, true or false')
|
|
31237
31237
|
});
|
|
31238
|
+
lib.z.object({
|
|
31239
|
+
millisecond: lib.z.number().default(1000).optional().describe('Sleep duration in milliseconds, defaults to 1000ms (1 second)')
|
|
31240
|
+
});
|
|
31241
|
+
lib.z.object({
|
|
31242
|
+
message: lib.z.string().optional().describe('The conclusion, data, or return value that the user needs. This message will be provided to the user when the task is finalized.')
|
|
31243
|
+
});
|
|
31238
31244
|
require("node:assert");
|
|
31239
31245
|
__webpack_require__("../../node_modules/.pnpm/semver@7.5.2/node_modules/semver/index.js");
|
|
31240
31246
|
__webpack_require__("../../node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/dayjs.min.js");
|
|
@@ -31288,7 +31294,7 @@ var __webpack_exports__ = {};
|
|
|
31288
31294
|
}
|
|
31289
31295
|
return false;
|
|
31290
31296
|
}
|
|
31291
|
-
function
|
|
31297
|
+
function getZodTypeName(field, locatorTypeDescription) {
|
|
31292
31298
|
const actualField = unwrapZodField(field);
|
|
31293
31299
|
const fieldTypeName = actualField._def?.typeName;
|
|
31294
31300
|
if ('ZodString' === fieldTypeName) return 'string';
|
|
@@ -31306,14 +31312,14 @@ var __webpack_exports__ = {};
|
|
|
31306
31312
|
if ('ZodUnion' === fieldTypeName) {
|
|
31307
31313
|
const options = actualField._def?.options;
|
|
31308
31314
|
if (options && options.length > 0) {
|
|
31309
|
-
const types = options.map((opt)=>
|
|
31315
|
+
const types = options.map((opt)=>getZodTypeName(opt, locatorTypeDescription));
|
|
31310
31316
|
return types.join(' | ');
|
|
31311
31317
|
}
|
|
31312
31318
|
return 'union';
|
|
31313
31319
|
}
|
|
31314
31320
|
return 'unknown';
|
|
31315
31321
|
}
|
|
31316
|
-
function
|
|
31322
|
+
function getZodDescription(field) {
|
|
31317
31323
|
if ("description" in field) return field.description || null;
|
|
31318
31324
|
const actualField = unwrapZodField(field);
|
|
31319
31325
|
if ("description" in actualField) return actualField.description || null;
|
|
@@ -31329,16 +31335,16 @@ var __webpack_exports__ = {};
|
|
|
31329
31335
|
const schema = action.paramSchema;
|
|
31330
31336
|
const isZodObjectType = schema._def?.typeName === 'ZodObject';
|
|
31331
31337
|
if (!isZodObjectType || !schema.shape) {
|
|
31332
|
-
const typeName =
|
|
31333
|
-
const description =
|
|
31338
|
+
const typeName = getZodTypeName(schema);
|
|
31339
|
+
const description = getZodDescription(schema);
|
|
31334
31340
|
const paramDesc = description ? `${typeName} - ${description}` : typeName;
|
|
31335
31341
|
return `${action.name} action, ${actionDesc}. Parameter: ${paramDesc}`;
|
|
31336
31342
|
}
|
|
31337
31343
|
const paramDescriptions = [];
|
|
31338
31344
|
for (const [key, field] of Object.entries(schema.shape))if (field && 'object' == typeof field) {
|
|
31339
31345
|
const isFieldOptional = 'function' == typeof field.isOptional && field.isOptional();
|
|
31340
|
-
const typeName =
|
|
31341
|
-
const description =
|
|
31346
|
+
const typeName = getZodTypeName(field);
|
|
31347
|
+
const description = getZodDescription(field);
|
|
31342
31348
|
let paramStr = `${key}${isFieldOptional ? '?' : ''} (${typeName})`;
|
|
31343
31349
|
if (description) paramStr += ` - ${description}`;
|
|
31344
31350
|
paramDescriptions.push(paramStr);
|
|
@@ -31349,7 +31355,7 @@ var __webpack_exports__ = {};
|
|
|
31349
31355
|
function isZodOptional(value) {
|
|
31350
31356
|
return '_def' in value && value._def?.typeName === 'ZodOptional';
|
|
31351
31357
|
}
|
|
31352
|
-
function
|
|
31358
|
+
function isZodObject(value) {
|
|
31353
31359
|
return '_def' in value && value._def?.typeName === 'ZodObject' && 'shape' in value;
|
|
31354
31360
|
}
|
|
31355
31361
|
function unwrapOptional(value) {
|
|
@@ -31363,7 +31369,7 @@ var __webpack_exports__ = {};
|
|
|
31363
31369
|
};
|
|
31364
31370
|
}
|
|
31365
31371
|
function isLocateField(value) {
|
|
31366
|
-
if (!
|
|
31372
|
+
if (!isZodObject(value)) return false;
|
|
31367
31373
|
return 'prompt' in value.shape;
|
|
31368
31374
|
}
|
|
31369
31375
|
function makePromptOptional(value, wrapInOptional) {
|
|
@@ -31377,7 +31383,7 @@ var __webpack_exports__ = {};
|
|
|
31377
31383
|
}
|
|
31378
31384
|
function transformSchemaField(key, value) {
|
|
31379
31385
|
const { innerValue, isOptional } = unwrapOptional(value);
|
|
31380
|
-
if (
|
|
31386
|
+
if (isZodObject(innerValue) && isLocateField(innerValue)) return [
|
|
31381
31387
|
key,
|
|
31382
31388
|
makePromptOptional(innerValue, isOptional)
|
|
31383
31389
|
];
|
|
@@ -31389,7 +31395,7 @@ var __webpack_exports__ = {};
|
|
|
31389
31395
|
function extractActionSchema(paramSchema) {
|
|
31390
31396
|
if (!paramSchema) return {};
|
|
31391
31397
|
const schema = paramSchema;
|
|
31392
|
-
if (!
|
|
31398
|
+
if (!isZodObject(schema)) return schema;
|
|
31393
31399
|
return Object.fromEntries(Object.entries(schema.shape).map(([key, value])=>transformSchemaField(key, value)));
|
|
31394
31400
|
}
|
|
31395
31401
|
function serializeArgsToDescription(args) {
|
|
@@ -31776,7 +31782,7 @@ For more information, visit: https://midscenejs.com/mcp-migration
|
|
|
31776
31782
|
constructor(){
|
|
31777
31783
|
super({
|
|
31778
31784
|
name: '@midscene/mcp',
|
|
31779
|
-
version: '1.2.1-beta-
|
|
31785
|
+
version: '1.2.1-beta-20260113073450.0',
|
|
31780
31786
|
description: 'Deprecated - Use @midscene/web-bridge-mcp, @midscene/android-mcp, or @midscene/ios-mcp'
|
|
31781
31787
|
});
|
|
31782
31788
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midscene/mcp",
|
|
3
|
-
"version": "1.2.1-beta-
|
|
3
|
+
"version": "1.2.1-beta-20260113073450.0",
|
|
4
4
|
"description": "Deprecated - Use @midscene/web-bridge-mcp, @midscene/android-mcp, or @midscene/ios-mcp",
|
|
5
5
|
"bin": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"@rslib/core": "^0.18.3",
|
|
26
26
|
"@types/node": "^18.0.0",
|
|
27
27
|
"typescript": "^5.8.3",
|
|
28
|
-
"@midscene/core": "1.2.1-beta-
|
|
28
|
+
"@midscene/core": "1.2.1-beta-20260113073450.0",
|
|
29
29
|
"@midscene/report": "1.0.0",
|
|
30
|
-
"@midscene/
|
|
31
|
-
"@midscene/
|
|
32
|
-
"@midscene/web": "1.2.1-beta-
|
|
30
|
+
"@midscene/shared": "1.2.1-beta-20260113073450.0",
|
|
31
|
+
"@midscene/android": "1.2.1-beta-20260113073450.0",
|
|
32
|
+
"@midscene/web": "1.2.1-beta-20260113073450.0"
|
|
33
33
|
},
|
|
34
34
|
"license": "MIT",
|
|
35
35
|
"scripts": {
|