@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/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-20251024063839.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,11 +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
3234
  ...androidTarget,
3234
- cache: processCacheConfig(null == (_yamlScript_agent2 = yamlScript.agent) ? void 0 : _yamlScript_agent2.cache, fileName)
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
3235
3237
  });
3236
3238
  if (null == androidTarget ? void 0 : androidTarget.launch) await agent.launch(androidTarget.launch);
3237
3239
  freeFn.push({
@@ -3244,11 +3246,12 @@ var __webpack_modules__ = {
3244
3246
  };
3245
3247
  }
3246
3248
  if (void 0 !== clonedYamlScript.ios) {
3247
- var _yamlScript_agent3;
3249
+ var _clonedYamlScript_agent5, _clonedYamlScript_agent6;
3248
3250
  const iosTarget = clonedYamlScript.ios;
3249
3251
  const agent = await agentFromWebDriverAgent({
3250
3252
  ...iosTarget,
3251
- cache: processCacheConfig(null == (_yamlScript_agent3 = yamlScript.agent) ? void 0 : _yamlScript_agent3.cache, fileName)
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
3252
3255
  });
3253
3256
  if (null == iosTarget ? void 0 : iosTarget.launch) await agent.launch(iosTarget.launch);
3254
3257
  freeFn.push({
@@ -3261,7 +3264,7 @@ var __webpack_modules__ = {
3261
3264
  };
3262
3265
  }
3263
3266
  if (void 0 !== clonedYamlScript.interface) {
3264
- var _yamlScript_agent4;
3267
+ var _clonedYamlScript_agent7;
3265
3268
  const interfaceTarget = clonedYamlScript.interface;
3266
3269
  const moduleSpecifier = interfaceTarget.module;
3267
3270
  let finalModuleSpecifier;
@@ -3276,8 +3279,8 @@ var __webpack_modules__ = {
3276
3279
  const device = new DeviceClass(interfaceTarget.param || {});
3277
3280
  debug('creating agent from device', device);
3278
3281
  const agent = createAgent(device, {
3279
- ...yamlScript.agent,
3280
- cache: processCacheConfig(null == (_yamlScript_agent4 = yamlScript.agent) ? void 0 : _yamlScript_agent4.cache, fileName)
3282
+ ...clonedYamlScript.agent,
3283
+ cache: processCacheConfig(null == (_clonedYamlScript_agent7 = clonedYamlScript.agent) ? void 0 : _clonedYamlScript_agent7.cache, fileName)
3281
3284
  });
3282
3285
  freeFn.push({
3283
3286
  name: 'destroy_general_interface_agent',
@@ -11905,7 +11908,7 @@ Usage:
11905
11908
  type: 'string',
11906
11909
  description: 'Override WebDriverAgent host for iOS environments.'
11907
11910
  }
11908
- }).version('version', 'Show version number', "1.0.1-beta-20251024063839.0").help().wrap(yargs().terminalWidth());
11911
+ }).version('version', 'Show version number', "1.0.1-beta-20251027033034.0").help().wrap(yargs().terminalWidth());
11909
11912
  const argv = await args.argv;
11910
11913
  cli_utils_debug('argv', argv);
11911
11914
  const transformedArgv = {