@midscene/cli 0.29.6 → 0.29.7-beta-20250930025459.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/es/index.mjs +20 -10
- package/dist/es/index.mjs.map +1 -1
- package/dist/lib/index.js +20 -10
- package/dist/lib/index.js.map +1 -1
- package/package.json +6 -6
package/dist/es/index.mjs
CHANGED
|
@@ -8,6 +8,7 @@ import { createServer } from "http-server";
|
|
|
8
8
|
import node_assert from "node:assert";
|
|
9
9
|
import { agentFromAdbDevice } from "@midscene/android";
|
|
10
10
|
import { createAgent } from "@midscene/core/agent";
|
|
11
|
+
import { processCacheConfig } from "@midscene/core/utils";
|
|
11
12
|
import { agentFromWebDriverAgent } from "@midscene/ios";
|
|
12
13
|
import { getDebug } from "@midscene/shared/logger";
|
|
13
14
|
import { AgentOverChromeBridge } from "@midscene/web/bridge-mode";
|
|
@@ -3023,9 +3024,7 @@ var __webpack_modules__ = {
|
|
|
3023
3024
|
"./src/index.ts": function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
|
|
3024
3025
|
var main = __webpack_require__("../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/lib/main.js");
|
|
3025
3026
|
var main_default = /*#__PURE__*/ __webpack_require__.n(main);
|
|
3026
|
-
var package_namespaceObject = {
|
|
3027
|
-
i8: "0.29.6"
|
|
3028
|
-
};
|
|
3027
|
+
var package_namespaceObject = JSON.parse('{"i8":"0.29.7-beta-20250930025459.0"}');
|
|
3029
3028
|
class Node {
|
|
3030
3029
|
value;
|
|
3031
3030
|
next;
|
|
@@ -3158,8 +3157,7 @@ var __webpack_modules__ = {
|
|
|
3158
3157
|
const preference = {
|
|
3159
3158
|
headed: null == options ? void 0 : options.headed,
|
|
3160
3159
|
keepWindow: null == options ? void 0 : options.keepWindow,
|
|
3161
|
-
testId: fileName
|
|
3162
|
-
cacheId: fileName
|
|
3160
|
+
testId: fileName
|
|
3163
3161
|
};
|
|
3164
3162
|
const player = new ScriptPlayer(yamlScript, async ()=>{
|
|
3165
3163
|
const freeFn = [];
|
|
@@ -3180,6 +3178,7 @@ var __webpack_modules__ = {
|
|
|
3180
3178
|
throw new Error(`Only one target type can be specified, but found multiple: ${specifiedTargets.join(', ')}. Please specify only one of: web, android, ios, or interface.`);
|
|
3181
3179
|
}
|
|
3182
3180
|
if (void 0 !== webTarget) {
|
|
3181
|
+
var _yamlScript_agent;
|
|
3183
3182
|
if (void 0 !== yamlScript.target) console.warn("target is deprecated, please use web instead. See https://midscenejs.com/automate-with-scripts-in-yaml for more information. Sorry for the inconvenience.");
|
|
3184
3183
|
let localServer;
|
|
3185
3184
|
let urlToVisit;
|
|
@@ -3195,7 +3194,11 @@ var __webpack_modules__ = {
|
|
|
3195
3194
|
webTarget.url = urlToVisit;
|
|
3196
3195
|
}
|
|
3197
3196
|
if (!webTarget.bridgeMode) {
|
|
3198
|
-
|
|
3197
|
+
var _yamlScript_agent1;
|
|
3198
|
+
const { agent, freeFn: newFreeFn } = await puppeteerAgentForTarget(webTarget, {
|
|
3199
|
+
...preference,
|
|
3200
|
+
cache: processCacheConfig(null == (_yamlScript_agent1 = yamlScript.agent) ? void 0 : _yamlScript_agent1.cache, fileName)
|
|
3201
|
+
}, null == options ? void 0 : options.browser);
|
|
3199
3202
|
freeFn.push(...newFreeFn);
|
|
3200
3203
|
return {
|
|
3201
3204
|
agent,
|
|
@@ -3206,7 +3209,7 @@ var __webpack_modules__ = {
|
|
|
3206
3209
|
if (webTarget.userAgent || webTarget.viewportWidth || webTarget.viewportHeight || webTarget.viewportScale || webTarget.waitForNetworkIdle || webTarget.cookie) console.warn('puppeteer options (userAgent, viewportWidth, viewportHeight, viewportScale, waitForNetworkIdle, cookie) are not supported in bridge mode. They will be ignored.');
|
|
3207
3210
|
const agent = new AgentOverChromeBridge({
|
|
3208
3211
|
closeNewTabsAfterDisconnect: webTarget.closeNewTabsAfterDisconnect,
|
|
3209
|
-
|
|
3212
|
+
cache: processCacheConfig(null == (_yamlScript_agent = yamlScript.agent) ? void 0 : _yamlScript_agent.cache, fileName)
|
|
3210
3213
|
});
|
|
3211
3214
|
if ('newTabWithUrl' === webTarget.bridgeMode) await agent.connectNewTabWithUrl(webTarget.url);
|
|
3212
3215
|
else {
|
|
@@ -3223,8 +3226,11 @@ var __webpack_modules__ = {
|
|
|
3223
3226
|
};
|
|
3224
3227
|
}
|
|
3225
3228
|
if (void 0 !== yamlScript.android) {
|
|
3229
|
+
var _yamlScript_agent2;
|
|
3226
3230
|
const androidTarget = yamlScript.android;
|
|
3227
|
-
const agent = await agentFromAdbDevice(null == androidTarget ? void 0 : androidTarget.deviceId
|
|
3231
|
+
const agent = await agentFromAdbDevice(null == androidTarget ? void 0 : androidTarget.deviceId, {
|
|
3232
|
+
cache: processCacheConfig(null == (_yamlScript_agent2 = yamlScript.agent) ? void 0 : _yamlScript_agent2.cache, fileName)
|
|
3233
|
+
});
|
|
3228
3234
|
if (null == androidTarget ? void 0 : androidTarget.launch) await agent.launch(androidTarget.launch);
|
|
3229
3235
|
freeFn.push({
|
|
3230
3236
|
name: 'destroy_android_agent',
|
|
@@ -3252,6 +3258,7 @@ var __webpack_modules__ = {
|
|
|
3252
3258
|
};
|
|
3253
3259
|
}
|
|
3254
3260
|
if (void 0 !== yamlScript.interface) {
|
|
3261
|
+
var _yamlScript_agent3;
|
|
3255
3262
|
const interfaceTarget = yamlScript.interface;
|
|
3256
3263
|
const moduleSpecifier = interfaceTarget.module;
|
|
3257
3264
|
let finalModuleSpecifier;
|
|
@@ -3265,7 +3272,10 @@ var __webpack_modules__ = {
|
|
|
3265
3272
|
debug('DeviceClass', DeviceClass, 'with param', interfaceTarget.param);
|
|
3266
3273
|
const device = new DeviceClass(interfaceTarget.param || {});
|
|
3267
3274
|
debug('creating agent from device', device);
|
|
3268
|
-
const agent = createAgent(device,
|
|
3275
|
+
const agent = createAgent(device, {
|
|
3276
|
+
...yamlScript.agent,
|
|
3277
|
+
cache: processCacheConfig(null == (_yamlScript_agent3 = yamlScript.agent) ? void 0 : _yamlScript_agent3.cache, fileName)
|
|
3278
|
+
});
|
|
3269
3279
|
freeFn.push({
|
|
3270
3280
|
name: 'destroy_general_interface_agent',
|
|
3271
3281
|
fn: ()=>{
|
|
@@ -11866,7 +11876,7 @@ Usage:
|
|
|
11866
11876
|
type: 'string',
|
|
11867
11877
|
description: 'Override WebDriverAgent host for iOS environments.'
|
|
11868
11878
|
}
|
|
11869
|
-
}).version('version', 'Show version number', "0.29.
|
|
11879
|
+
}).version('version', 'Show version number', "0.29.7-beta-20250930025459.0").help().wrap(yargs().terminalWidth());
|
|
11870
11880
|
const argv = await args.argv;
|
|
11871
11881
|
cli_utils_debug('argv', argv);
|
|
11872
11882
|
const transformedArgv = {
|