testdriverai 4.1.47 → 4.1.48

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.
Files changed (2) hide show
  1. package/lib/system.js +17 -2
  2. package/package.json +4 -4
package/lib/system.js CHANGED
@@ -4,7 +4,6 @@ const os = require("os");
4
4
  const path = require("path");
5
5
  const screenshot = require("screenshot-desktop");
6
6
  const si = require("systeminformation");
7
- const activeWindow = require("active-win");
8
7
  const robot = require("robotjs");
9
8
  const sharp = require("sharp");
10
9
  const { emitter, events } = require("./events.js");
@@ -111,9 +110,25 @@ const platform = () => {
111
110
  return platform;
112
111
  };
113
112
 
113
+ // Import get-windows using dynamic import for ES module compatibility
114
+ let activeWindowFn = null;
115
+ const initializeActiveWindow = async () => {
116
+ if (!activeWindowFn) {
117
+ const { activeWindow } = await import('get-windows');
118
+ activeWindowFn = activeWindow;
119
+ }
120
+ return activeWindowFn;
121
+ };
122
+
114
123
  // this is the focused window
115
124
  const activeWin = async () => {
116
- return await activeWindow();
125
+ try {
126
+ const activeWindow = await initializeActiveWindow();
127
+ return await activeWindow();
128
+ } catch (error) {
129
+ console.error('Error getting active window:', error);
130
+ return null;
131
+ }
117
132
  };
118
133
 
119
134
  const getMousePosition = async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testdriverai",
3
- "version": "4.1.47",
3
+ "version": "4.1.48",
4
4
  "description": "Next generation autonomous AI agent for end-to-end testing of web & desktop",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -17,7 +17,6 @@
17
17
  "license": "ISC",
18
18
  "dependencies": {
19
19
  "@electerm/strip-ansi": "^1.0.0",
20
- "active-win": "^8.2.1",
21
20
  "axios": "^1.7.7",
22
21
  "chalk": "^4.1.2",
23
22
  "cli-progress": "^3.12.0",
@@ -25,6 +24,7 @@
25
24
  "decompress": "^4.2.1",
26
25
  "dotenv": "^16.4.5",
27
26
  "electron": "^33.0.2",
27
+ "get-windows": "^9.2.0",
28
28
  "jimp": "^0.22.12",
29
29
  "js-yaml": "^4.1.0",
30
30
  "mac-screen-capture-permissions": "^2.1.0",
@@ -51,14 +51,14 @@
51
51
  },
52
52
  "devDependencies": {
53
53
  "@eslint/js": "^9.10.0",
54
+ "chai": "^5.1.2",
54
55
  "esbuild": "0.20.2",
55
56
  "esbuild-plugin-fileloc": "^0.0.6",
56
57
  "eslint": "^9.10.0",
57
58
  "globals": "^15.9.0",
59
+ "mocha": "^10.8.2",
58
60
  "node-addon-api": "^8.0.0",
59
61
  "node-gyp": "^10.1.0",
60
- "mocha": "^10.8.2",
61
- "chai": "^5.1.2",
62
62
  "prettier": "3.3.3"
63
63
  },
64
64
  "optionalDependencies": {