@midscene/cli 1.0.1-beta-20251024064637.0 → 1.0.1-beta-20251027033034.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/lib/index.js CHANGED
@@ -3015,7 +3015,7 @@ var __webpack_modules__ = {
3015
3015
  var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
3016
3016
  var main = __webpack_require__("../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/lib/main.js");
3017
3017
  var main_default = /*#__PURE__*/ __webpack_require__.n(main);
3018
- var package_namespaceObject = JSON.parse('{"i8":"1.0.1-beta-20251024064637.0"}');
3018
+ var package_namespaceObject = JSON.parse('{"i8":"1.0.1-beta-20251027033034.0"}');
3019
3019
  const yaml_namespaceObject = require("@midscene/core/yaml");
3020
3020
  const common_namespaceObject = require("@midscene/shared/common");
3021
3021
  const external_lodash_merge_namespaceObject = require("lodash.merge");
@@ -3186,7 +3186,7 @@ var __webpack_modules__ = {
3186
3186
  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.`);
3187
3187
  }
3188
3188
  if (void 0 !== webTarget) {
3189
- var _yamlScript_agent;
3189
+ var _clonedYamlScript_agent, _clonedYamlScript_agent1;
3190
3190
  if (void 0 !== clonedYamlScript.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.");
3191
3191
  let localServer;
3192
3192
  let urlToVisit;
@@ -3202,10 +3202,10 @@ var __webpack_modules__ = {
3202
3202
  webTarget.url = urlToVisit;
3203
3203
  }
3204
3204
  if (!webTarget.bridgeMode) {
3205
- var _yamlScript_agent1;
3205
+ var _clonedYamlScript_agent2;
3206
3206
  const { agent, freeFn: newFreeFn } = await (0, puppeteer_agent_launcher_namespaceObject.puppeteerAgentForTarget)(webTarget, {
3207
3207
  ...preference,
3208
- cache: (0, utils_namespaceObject.processCacheConfig)(null == (_yamlScript_agent1 = yamlScript.agent) ? void 0 : _yamlScript_agent1.cache, fileName)
3208
+ cache: (0, utils_namespaceObject.processCacheConfig)(null == (_clonedYamlScript_agent2 = clonedYamlScript.agent) ? void 0 : _clonedYamlScript_agent2.cache, fileName)
3209
3209
  }, null == options ? void 0 : options.browser);
3210
3210
  freeFn.push(...newFreeFn);
3211
3211
  return {
@@ -3217,7 +3217,8 @@ var __webpack_modules__ = {
3217
3217
  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.');
3218
3218
  const agent = new bridge_mode_namespaceObject.AgentOverChromeBridge({
3219
3219
  closeNewTabsAfterDisconnect: webTarget.closeNewTabsAfterDisconnect,
3220
- cache: (0, utils_namespaceObject.processCacheConfig)(null == (_yamlScript_agent = yamlScript.agent) ? void 0 : _yamlScript_agent.cache, fileName)
3220
+ cache: (0, utils_namespaceObject.processCacheConfig)(null == (_clonedYamlScript_agent = clonedYamlScript.agent) ? void 0 : _clonedYamlScript_agent.cache, fileName),
3221
+ aiActionContext: null == (_clonedYamlScript_agent1 = clonedYamlScript.agent) ? void 0 : _clonedYamlScript_agent1.aiActionContext
3221
3222
  });
3222
3223
  if ('newTabWithUrl' === webTarget.bridgeMode) await agent.connectNewTabWithUrl(webTarget.url);
3223
3224
  else {
@@ -3234,10 +3235,12 @@ var __webpack_modules__ = {
3234
3235
  };
3235
3236
  }
3236
3237
  if (void 0 !== clonedYamlScript.android) {
3237
- var _yamlScript_agent2;
3238
+ var _clonedYamlScript_agent3, _clonedYamlScript_agent4;
3238
3239
  const androidTarget = clonedYamlScript.android;
3239
3240
  const agent = await (0, android_namespaceObject.agentFromAdbDevice)(null == androidTarget ? void 0 : androidTarget.deviceId, {
3240
- cache: (0, utils_namespaceObject.processCacheConfig)(null == (_yamlScript_agent2 = yamlScript.agent) ? void 0 : _yamlScript_agent2.cache, fileName)
3241
+ ...androidTarget,
3242
+ cache: (0, utils_namespaceObject.processCacheConfig)(null == (_clonedYamlScript_agent3 = clonedYamlScript.agent) ? void 0 : _clonedYamlScript_agent3.cache, fileName),
3243
+ aiActionContext: null == (_clonedYamlScript_agent4 = clonedYamlScript.agent) ? void 0 : _clonedYamlScript_agent4.aiActionContext
3241
3244
  });
3242
3245
  if (null == androidTarget ? void 0 : androidTarget.launch) await agent.launch(androidTarget.launch);
3243
3246
  freeFn.push({
@@ -3250,10 +3253,12 @@ var __webpack_modules__ = {
3250
3253
  };
3251
3254
  }
3252
3255
  if (void 0 !== clonedYamlScript.ios) {
3256
+ var _clonedYamlScript_agent5, _clonedYamlScript_agent6;
3253
3257
  const iosTarget = clonedYamlScript.ios;
3254
3258
  const agent = await (0, ios_namespaceObject.agentFromWebDriverAgent)({
3255
- wdaPort: null == iosTarget ? void 0 : iosTarget.wdaPort,
3256
- wdaHost: null == iosTarget ? void 0 : iosTarget.wdaHost
3259
+ ...iosTarget,
3260
+ cache: (0, utils_namespaceObject.processCacheConfig)(null == (_clonedYamlScript_agent5 = clonedYamlScript.agent) ? void 0 : _clonedYamlScript_agent5.cache, fileName),
3261
+ aiActionContext: null == (_clonedYamlScript_agent6 = clonedYamlScript.agent) ? void 0 : _clonedYamlScript_agent6.aiActionContext
3257
3262
  });
3258
3263
  if (null == iosTarget ? void 0 : iosTarget.launch) await agent.launch(iosTarget.launch);
3259
3264
  freeFn.push({
@@ -3266,7 +3271,7 @@ var __webpack_modules__ = {
3266
3271
  };
3267
3272
  }
3268
3273
  if (void 0 !== clonedYamlScript.interface) {
3269
- var _yamlScript_agent3;
3274
+ var _clonedYamlScript_agent7;
3270
3275
  const interfaceTarget = clonedYamlScript.interface;
3271
3276
  const moduleSpecifier = interfaceTarget.module;
3272
3277
  let finalModuleSpecifier;
@@ -3281,8 +3286,8 @@ var __webpack_modules__ = {
3281
3286
  const device = new DeviceClass(interfaceTarget.param || {});
3282
3287
  debug('creating agent from device', device);
3283
3288
  const agent = (0, agent_namespaceObject.createAgent)(device, {
3284
- ...yamlScript.agent,
3285
- cache: (0, utils_namespaceObject.processCacheConfig)(null == (_yamlScript_agent3 = yamlScript.agent) ? void 0 : _yamlScript_agent3.cache, fileName)
3289
+ ...clonedYamlScript.agent,
3290
+ cache: (0, utils_namespaceObject.processCacheConfig)(null == (_clonedYamlScript_agent7 = clonedYamlScript.agent) ? void 0 : _clonedYamlScript_agent7.cache, fileName)
3286
3291
  });
3287
3292
  freeFn.push({
3288
3293
  name: 'destroy_general_interface_agent',
@@ -11918,7 +11923,7 @@ Usage:
11918
11923
  type: 'string',
11919
11924
  description: 'Override WebDriverAgent host for iOS environments.'
11920
11925
  }
11921
- }).version('version', 'Show version number', "1.0.1-beta-20251024064637.0").help().wrap(yargs().terminalWidth());
11926
+ }).version('version', 'Show version number', "1.0.1-beta-20251027033034.0").help().wrap(yargs().terminalWidth());
11922
11927
  const argv = await args.argv;
11923
11928
  cli_utils_debug('argv', argv);
11924
11929
  const transformedArgv = {