@midscene/cli 1.2.1-beta-20260109075435.0 → 1.2.1-beta-20260112112154.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
@@ -8,6 +8,7 @@ import puppeteer from "puppeteer";
8
8
  import { createServer } from "http-server";
9
9
  import node_assert from "node:assert";
10
10
  import { agentFromAdbDevice } from "@midscene/android";
11
+ import { agentFromComputer } from "@midscene/computer";
11
12
  import { createAgent } from "@midscene/core/agent";
12
13
  import { processCacheConfig } from "@midscene/core/utils";
13
14
  import { agentFromWebDriverAgent } from "@midscene/ios";
@@ -3024,7 +3025,7 @@ var __webpack_modules__ = {
3024
3025
  "./src/index.ts" (__unused_rspack_module, __unused_rspack___webpack_exports__, __webpack_require__) {
3025
3026
  var main = __webpack_require__("../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/lib/main.js");
3026
3027
  var main_default = /*#__PURE__*/ __webpack_require__.n(main);
3027
- var package_namespaceObject = JSON.parse('{"rE":"1.2.1-beta-20260109075435.0"}');
3028
+ var package_namespaceObject = JSON.parse('{"rE":"1.2.1-beta-20260112112154.0"}');
3028
3029
  class Node {
3029
3030
  value;
3030
3031
  next;
@@ -3177,6 +3178,7 @@ var __webpack_modules__ = {
3177
3178
  void 0 !== webTarget,
3178
3179
  void 0 !== clonedYamlScript.android,
3179
3180
  void 0 !== clonedYamlScript.ios,
3181
+ void 0 !== clonedYamlScript.computer,
3180
3182
  void 0 !== clonedYamlScript.interface
3181
3183
  ].filter(Boolean).length;
3182
3184
  if (targetCount > 1) {
@@ -3184,9 +3186,10 @@ var __webpack_modules__ = {
3184
3186
  void 0 !== webTarget ? 'web' : null,
3185
3187
  void 0 !== clonedYamlScript.android ? 'android' : null,
3186
3188
  void 0 !== clonedYamlScript.ios ? 'ios' : null,
3189
+ void 0 !== clonedYamlScript.computer ? 'computer' : null,
3187
3190
  void 0 !== clonedYamlScript.interface ? 'interface' : null
3188
3191
  ].filter(Boolean);
3189
- 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.`);
3192
+ throw new Error(`Only one target type can be specified, but found multiple: ${specifiedTargets.join(', ')}. Please specify only one of: web, android, ios, computer, or interface.`);
3190
3193
  }
3191
3194
  if (void 0 !== webTarget) {
3192
3195
  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.");
@@ -3266,6 +3269,21 @@ var __webpack_modules__ = {
3266
3269
  freeFn
3267
3270
  };
3268
3271
  }
3272
+ if (void 0 !== clonedYamlScript.computer) {
3273
+ const computerTarget = clonedYamlScript.computer;
3274
+ const agent = await agentFromComputer({
3275
+ ...computerTarget,
3276
+ ...buildAgentOptions(clonedYamlScript.agent, preference.testId, fileName)
3277
+ });
3278
+ freeFn.push({
3279
+ name: 'destroy_computer_agent',
3280
+ fn: ()=>agent.destroy()
3281
+ });
3282
+ return {
3283
+ agent,
3284
+ freeFn
3285
+ };
3286
+ }
3269
3287
  if (void 0 !== clonedYamlScript.interface) {
3270
3288
  const interfaceTarget = clonedYamlScript.interface;
3271
3289
  const moduleSpecifier = interfaceTarget.module;
@@ -3292,7 +3310,7 @@ var __webpack_modules__ = {
3292
3310
  freeFn
3293
3311
  };
3294
3312
  }
3295
- throw new Error('No valid interface configuration found in the yaml script, should be either "web", "android", "ios", or "interface"');
3313
+ throw new Error('No valid interface configuration found in the yaml script, should be either "web", "android", "ios", "computer", or "interface"');
3296
3314
  }, void 0, file);
3297
3315
  return player;
3298
3316
  }
@@ -11888,7 +11906,7 @@ Usage:
11888
11906
  type: 'boolean',
11889
11907
  description: `Turn on logging to help debug why certain keys or values are not being set as you expect, default is ${config_factory_defaultConfig.dotenvDebug}`
11890
11908
  }
11891
- }).version('version', 'Show version number', "1.2.1-beta-20260109075435.0").help().epilogue(`For complete list of configuration options, please visit:
11909
+ }).version('version', 'Show version number', "1.2.1-beta-20260112112154.0").help().epilogue(`For complete list of configuration options, please visit:
11892
11910
  • Web options: https://midscenejs.com/automate-with-scripts-in-yaml#the-web-part
11893
11911
  • Android options: https://midscenejs.com/automate-with-scripts-in-yaml#the-android-part
11894
11912
  • iOS options: https://midscenejs.com/automate-with-scripts-in-yaml#the-ios-part