testdriverai 4.1.46 → 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.
package/agent.js CHANGED
@@ -704,7 +704,7 @@ const firstPrompt = async () => {
704
704
  } else if (input.indexOf("/manual") == 0) {
705
705
  await manualInput(commands.slice(1).join(" "));
706
706
  } else if (input.indexOf("/run") == 0) {
707
- await run(commands[1], commands[2], commands[3]);
707
+ await run(commands[1], commands[2] == "true", commands[3] == "true");
708
708
  } else if (input.indexOf("/generate") == 0) {
709
709
  await generate(commands[1], commands[2]);
710
710
  } else {
@@ -948,14 +948,14 @@ ${yaml.dump(step)}
948
948
  await actOnMarkdown(markdown, 0, true);
949
949
  }
950
950
 
951
- if (shouldSave || shouldSave == "true") {
951
+ if (shouldSave) {
952
952
  await save({ filepath: file });
953
953
  }
954
954
 
955
955
  setTerminalWindowTransparency(false);
956
956
  emitter.emit(events.interactive, true);
957
957
 
958
- if (shouldExit || shouldExit == "true") {
958
+ if (shouldExit) {
959
959
  await summarize();
960
960
  await exit(false);
961
961
  }
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.46",
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": {