Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

[cuabot] fix outdated pkgs, add filtering for npx/pnpx aliases (#1015)

dduponte6f3a9265bce
diff --git a/libs/cuabot/package.json b/libs/cuabot/package.json
index 0408c7c308..1e1fa3ea61 100644
--- a/libs/cuabot/package.json
+++ b/libs/cuabot/package.json
@@ -42,9 +42,8 @@
},
"devDependencies": {
"@types/better-sqlite3": "^7.6.0",
- "@types/node": "^22.0.0",
+ "@types/node": "^25.2.0",
"@types/react": "^18.3.0",
- "@types/uuid": "^11.0.0",
"@types/ws": "^8.18.1",
"typescript": "^5.7.0"
}
diff --git a/libs/cuabot/pnpm-lock.yaml b/libs/cuabot/pnpm-lock.yaml
index d434fc6434..9e031ff101 100644
--- a/libs/cuabot/pnpm-lock.yaml
+++ b/libs/cuabot/pnpm-lock.yaml
@@ -61,14 +61,11 @@ importers:
specifier: ^7.6.0
version: 7.6.13
'@types/node':
- specifier: ^22.0.0
- version: 22.19.7
+ specifier: ^25.2.0
+ version: 25.2.0
'@types/react':
specifier: ^18.3.0
version: 18.3.27
- '@types/uuid':
- specifier: ^11.0.0
- version: 11.0.0
'@types/ws':
specifier: ^8.18.1
version: 8.18.1
@@ -542,8 +539,8 @@ packages:
resolution: {integrity: sha512-NMv9ASNARoKksWtsq/SHakpYAYnhBrQgGD8zkLYk/jaK8jUGn08CfEdTRgYhMypUQAfzSP8W6gNLe0q19/t4VA==}
- '@types/[email protected]':
- resolution: {integrity: sha512-MciR4AKGHWl7xwxkBa6xUGxQJ4VBOmPTF7sL+iGzuahOFaO0jHCsuEfS80pan1ef4gWId1oWOweIhrDEYLuaOw==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-DZ8VwRFUNzuqJ5khrvwMXHmvPe+zGayJhr2CDNiKB1WBE1ST8Djl00D0IC4vvNmHMdj6DlbYRIaFE7WHjlDl5w==}
resolution: {integrity: sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==}
@@ -551,10 +548,6 @@ packages:
resolution: {integrity: sha512-cisd7gxkzjBKU2GgdYrTdtQx1SORymWyaAFhaxQPK9bYO9ot3Y5OikQRvY0VYQtvwjeQnizCINJAenh/V7MK2w==}
- '@types/[email protected]':
- resolution: {integrity: sha512-HVyk8nj2m+jcFRNazzqyVKiZezyhDKrGUA3jlEcg/nZ6Ms+qHwocba1Y/AaVaznJTAM9xpdFSh+ptbNrhOGvZA==}
- deprecated: This is a stub types definition. uuid provides its own type definitions, so you do not need this installed.
-
resolution: {integrity: sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==}
@@ -1580,8 +1573,8 @@ packages:
engines: {node: '>=14.17'}
hasBin: true
- resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==}
+ resolution: {integrity: sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==}
resolution: {integrity: sha512-afXhuC55wkAmZ0P18QsVE6kp8JaxrEokN2HGIoIVv2ijHQd419H0+6EigAFcIzXeMIkcIkNBpB3L/DXB3cTS/g==}
@@ -2032,11 +2025,11 @@ snapshots:
dependencies:
- '@types/node': 22.19.7
+ '@types/node': 25.2.0
- '@types/[email protected]':
+ '@types/[email protected]':
dependencies:
- undici-types: 6.21.0
+ undici-types: 7.16.0
'@types/[email protected]': {}
@@ -2045,13 +2038,9 @@ snapshots:
'@types/prop-types': 15.7.15
csstype: 3.2.3
- '@types/[email protected]':
- dependencies:
- uuid: 13.0.0
-
dependencies:
- '@types/node': 22.19.7
+ '@types/node': 25.2.0
optional: true
@@ -3263,7 +3252,7 @@ snapshots:
dependencies:
diff --git a/libs/cuabot/src/cuabot.tsx b/libs/cuabot/src/cuabot.tsx
index 92807e15aa..34192ee9f8 100644
--- a/libs/cuabot/src/cuabot.tsx
+++ b/libs/cuabot/src/cuabot.tsx
@@ -16,8 +16,12 @@ import { join } from "path";
function isCuabotInPath(): boolean {
try {
const cmd = process.platform === "win32" ? "where cuabot" : "which cuabot";
- execSync(cmd, { stdio: "ignore" });
- return true;
+ const result = execSync(cmd, { encoding: "utf-8" }).trim();
+ // Ignore paths from npx/pnpm dlx temporary cache
+ const paths = result.split(/\r?\n/).filter(p =>
+ !p.includes("_npx") && !p.includes("\\dlx\\") && !p.includes("/dlx/")
+ );
+ return paths.length > 0;
} catch {
return false;
}
diff --git a/libs/cuabot/src/onboarding.tsx b/libs/cuabot/src/onboarding.tsx
index d603a76b08..aff96f76c8 100644
--- a/libs/cuabot/src/onboarding.tsx
+++ b/libs/cuabot/src/onboarding.tsx
@@ -23,8 +23,12 @@ interface Check {
function checkCuabotInPath(): boolean {
try {
const cmd = process.platform === "win32" ? "where cuabot" : "which cuabot";
- execSync(cmd, { stdio: "ignore" });
- return true;
+ const result = execSync(cmd, { encoding: "utf-8" }).trim();
+ // Ignore paths from npx/pnpm dlx temporary cache
+ const paths = result.split(/\r?\n/).filter(p =>
+ !p.includes("_npx") && !p.includes("\\dlx\\") && !p.includes("/dlx/")
+ );
+ return paths.length > 0;
} catch {
return false;
}
diff --git a/libs/cuabot/src/utils.ts b/libs/cuabot/src/utils.ts
index 5621252207..4388124856 100644
--- a/libs/cuabot/src/utils.ts
+++ b/libs/cuabot/src/utils.ts
@@ -4,7 +4,8 @@
*/
import { exec } from "child_process";
-import { existsSync } from "fs";
+import { copyFileSync, existsSync, mkdirSync } from "fs";
+import { tmpdir } from "os";
import { dirname, join } from "path";
import { fileURLToPath } from "url";
import { promisify } from "util";
@@ -62,11 +63,27 @@ export function getXpraBinPath(): string {
}
/**
- * Get the path to an asset file
+ * Get the path to an asset file, copying to temp to avoid file locking issues
*/
function getAssetPath(filename: string): string {
const currentDir = dirname(fileURLToPath(import.meta.url));
- return join(currentDir, "..", "assets", filename);
+ const srcPath = join(currentDir, "..", "assets", filename);
+
+ // Copy to temp directory to avoid file locking issues with npx cache
+ const tempDir = join(tmpdir(), "cuabot-assets");
+ const tempPath = join(tempDir, filename);
+
+ try {
+ if (!existsSync(tempDir)) {
+ mkdirSync(tempDir, { recursive: true });
+ }
+ // Always copy to ensure we have the latest version
+ copyFileSync(srcPath, tempPath);
+ return tempPath;
+ } catch {
+ // Fallback to original path if copy fails
+ return srcPath;
+ }
}
/**