@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/es/index.mjs CHANGED
@@ -3024,7 +3024,7 @@ var __webpack_modules__ = {
3024
3024
  "./src/index.ts": function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
3025
3025
  var main = __webpack_require__("../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/lib/main.js");
3026
3026
  var main_default = /*#__PURE__*/ __webpack_require__.n(main);
3027
- var package_namespaceObject = JSON.parse('{"i8":"1.0.1-beta-20251024064637.0"}');
3027
+ var package_namespaceObject = JSON.parse('{"i8":"1.0.1-beta-20251027033034.0"}');
3028
3028
  class Node {
3029
3029
  value;
3030
3030
  next;
@@ -3179,7 +3179,7 @@ var __webpack_modules__ = {
3179
3179
  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.`);
3180
3180
  }
3181
3181
  if (void 0 !== webTarget) {
3182
- var _yamlScript_agent;
3182
+ var _clonedYamlScript_agent, _clonedYamlScript_agent1;
3183
3183
  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.");
3184
3184
  let localServer;
3185
3185
  let urlToVisit;
@@ -3195,10 +3195,10 @@ var __webpack_modules__ = {
3195
3195
  webTarget.url = urlToVisit;
3196
3196
  }
3197
3197
  if (!webTarget.bridgeMode) {
3198
- var _yamlScript_agent1;
3198
+ var _clonedYamlScript_agent2;
3199
3199
  const { agent, freeFn: newFreeFn } = await puppeteerAgentForTarget(webTarget, {
3200
3200
  ...preference,
3201
- cache: processCacheConfig(null == (_yamlScript_agent1 = yamlScript.agent) ? void 0 : _yamlScript_agent1.cache, fileName)
3201
+ cache: processCacheConfig(null == (_clonedYamlScript_agent2 = clonedYamlScript.agent) ? void 0 : _clonedYamlScript_agent2.cache, fileName)
3202
3202
  }, null == options ? void 0 : options.browser);
3203
3203
  freeFn.push(...newFreeFn);
3204
3204
  return {
@@ -3210,7 +3210,8 @@ var __webpack_modules__ = {
3210
3210
  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.');
3211
3211
  const agent = new AgentOverChromeBridge({
3212
3212
  closeNewTabsAfterDisconnect: webTarget.closeNewTabsAfterDisconnect,
3213
- cache: processCacheConfig(null == (_yamlScript_agent = yamlScript.agent) ? void 0 : _yamlScript_agent.cache, fileName)
3213
+ cache: processCacheConfig(null == (_clonedYamlScript_agent = clonedYamlScript.agent) ? void 0 : _clonedYamlScript_agent.cache, fileName),
3214
+ aiActionContext: null == (_clonedYamlScript_agent1 = clonedYamlScript.agent) ? void 0 : _clonedYamlScript_agent1.aiActionContext
3214
3215
  });
3215
3216
  if ('newTabWithUrl' === webTarget.bridgeMode) await agent.connectNewTabWithUrl(webTarget.url);
3216
3217
  else {
@@ -3227,10 +3228,12 @@ var __webpack_modules__ = {
3227
3228
  };
3228
3229
  }
3229
3230
  if (void 0 !== clonedYamlScript.android) {
3230
- var _yamlScript_agent2;
3231
+ var _clonedYamlScript_agent3, _clonedYamlScript_agent4;
3231
3232
  const androidTarget = clonedYamlScript.android;
3232
3233
  const agent = await agentFromAdbDevice(null == androidTarget ? void 0 : androidTarget.deviceId, {
3233
- cache: processCacheConfig(null == (_yamlScript_agent2 = yamlScript.agent) ? void 0 : _yamlScript_agent2.cache, fileName)
3234
+ ...androidTarget,
3235
+ cache: processCacheConfig(null == (_clonedYamlScript_agent3 = clonedYamlScript.agent) ? void 0 : _clonedYamlScript_agent3.cache, fileName),
3236
+ aiActionContext: null == (_clonedYamlScript_agent4 = clonedYamlScript.agent) ? void 0 : _clonedYamlScript_agent4.aiActionContext
3234
3237
  });
3235
3238
  if (null == androidTarget ? void 0 : androidTarget.launch) await agent.launch(androidTarget.launch);
3236
3239
  freeFn.push({
@@ -3243,10 +3246,12 @@ var __webpack_modules__ = {
3243
3246
  };
3244
3247
  }
3245
3248
  if (void 0 !== clonedYamlScript.ios) {
3249
+ var _clonedYamlScript_agent5, _clonedYamlScript_agent6;
3246
3250
  const iosTarget = clonedYamlScript.ios;
3247
3251
  const agent = await agentFromWebDriverAgent({
3248
- wdaPort: null == iosTarget ? void 0 : iosTarget.wdaPort,
3249
- wdaHost: null == iosTarget ? void 0 : iosTarget.wdaHost
3252
+ ...iosTarget,
3253
+ cache: processCacheConfig(null == (_clonedYamlScript_agent5 = clonedYamlScript.agent) ? void 0 : _clonedYamlScript_agent5.cache, fileName),
3254
+ aiActionContext: null == (_clonedYamlScript_agent6 = clonedYamlScript.agent) ? void 0 : _clonedYamlScript_agent6.aiActionContext
3250
3255
  });
3251
3256
  if (null == iosTarget ? void 0 : iosTarget.launch) await agent.launch(iosTarget.launch);
3252
3257
  freeFn.push({
@@ -3259,7 +3264,7 @@ var __webpack_modules__ = {
3259
3264
  };
3260
3265
  }
3261
3266
  if (void 0 !== clonedYamlScript.interface) {
3262
- var _yamlScript_agent3;
3267
+ var _clonedYamlScript_agent7;
3263
3268
  const interfaceTarget = clonedYamlScript.interface;
3264
3269
  const moduleSpecifier = interfaceTarget.module;
3265
3270
  let finalModuleSpecifier;
@@ -3274,8 +3279,8 @@ var __webpack_modules__ = {
3274
3279
  const device = new DeviceClass(interfaceTarget.param || {});
3275
3280
  debug('creating agent from device', device);
3276
3281
  const agent = createAgent(device, {
3277
- ...yamlScript.agent,
3278
- cache: processCacheConfig(null == (_yamlScript_agent3 = yamlScript.agent) ? void 0 : _yamlScript_agent3.cache, fileName)
3282
+ ...clonedYamlScript.agent,
3283
+ cache: processCacheConfig(null == (_clonedYamlScript_agent7 = clonedYamlScript.agent) ? void 0 : _clonedYamlScript_agent7.cache, fileName)
3279
3284
  });
3280
3285
  freeFn.push({
3281
3286
  name: 'destroy_general_interface_agent',
@@ -11903,7 +11908,7 @@ Usage:
11903
11908
  type: 'string',
11904
11909
  description: 'Override WebDriverAgent host for iOS environments.'
11905
11910
  }
11906
- }).version('version', 'Show version number', "1.0.1-beta-20251024064637.0").help().wrap(yargs().terminalWidth());
11911
+ }).version('version', 'Show version number', "1.0.1-beta-20251027033034.0").help().wrap(yargs().terminalWidth());
11907
11912
  const argv = await args.argv;
11908
11913
  cli_utils_debug('argv', argv);
11909
11914
  const transformedArgv = {