@midscene/cli 1.0.1-beta-20251024063839.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-20251024063839.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,11 +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
3241
  ...androidTarget,
3241
- cache: (0, utils_namespaceObject.processCacheConfig)(null == (_yamlScript_agent2 = yamlScript.agent) ? void 0 : _yamlScript_agent2.cache, fileName)
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
3242
3244
  });
3243
3245
  if (null == androidTarget ? void 0 : androidTarget.launch) await agent.launch(androidTarget.launch);
3244
3246
  freeFn.push({
@@ -3251,11 +3253,12 @@ var __webpack_modules__ = {
3251
3253
  };
3252
3254
  }
3253
3255
  if (void 0 !== clonedYamlScript.ios) {
3254
- var _yamlScript_agent3;
3256
+ var _clonedYamlScript_agent5, _clonedYamlScript_agent6;
3255
3257
  const iosTarget = clonedYamlScript.ios;
3256
3258
  const agent = await (0, ios_namespaceObject.agentFromWebDriverAgent)({
3257
3259
  ...iosTarget,
3258
- cache: (0, utils_namespaceObject.processCacheConfig)(null == (_yamlScript_agent3 = yamlScript.agent) ? void 0 : _yamlScript_agent3.cache, fileName)
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
3259
3262
  });
3260
3263
  if (null == iosTarget ? void 0 : iosTarget.launch) await agent.launch(iosTarget.launch);
3261
3264
  freeFn.push({
@@ -3268,7 +3271,7 @@ var __webpack_modules__ = {
3268
3271
  };
3269
3272
  }
3270
3273
  if (void 0 !== clonedYamlScript.interface) {
3271
- var _yamlScript_agent4;
3274
+ var _clonedYamlScript_agent7;
3272
3275
  const interfaceTarget = clonedYamlScript.interface;
3273
3276
  const moduleSpecifier = interfaceTarget.module;
3274
3277
  let finalModuleSpecifier;
@@ -3283,8 +3286,8 @@ var __webpack_modules__ = {
3283
3286
  const device = new DeviceClass(interfaceTarget.param || {});
3284
3287
  debug('creating agent from device', device);
3285
3288
  const agent = (0, agent_namespaceObject.createAgent)(device, {
3286
- ...yamlScript.agent,
3287
- cache: (0, utils_namespaceObject.processCacheConfig)(null == (_yamlScript_agent4 = yamlScript.agent) ? void 0 : _yamlScript_agent4.cache, fileName)
3289
+ ...clonedYamlScript.agent,
3290
+ cache: (0, utils_namespaceObject.processCacheConfig)(null == (_clonedYamlScript_agent7 = clonedYamlScript.agent) ? void 0 : _clonedYamlScript_agent7.cache, fileName)
3288
3291
  });
3289
3292
  freeFn.push({
3290
3293
  name: 'destroy_general_interface_agent',
@@ -11920,7 +11923,7 @@ Usage:
11920
11923
  type: 'string',
11921
11924
  description: 'Override WebDriverAgent host for iOS environments.'
11922
11925
  }
11923
- }).version('version', 'Show version number', "1.0.1-beta-20251024063839.0").help().wrap(yargs().terminalWidth());
11926
+ }).version('version', 'Show version number', "1.0.1-beta-20251027033034.0").help().wrap(yargs().terminalWidth());
11924
11927
  const argv = await args.argv;
11925
11928
  cli_utils_debug('argv', argv);
11926
11929
  const transformedArgv = {