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.

fix cuabot publish (#1001)

ddupont514199d75a07
diff --git a/.github/workflows/ts-reusable-build.yml b/.github/workflows/ts-reusable-build.yml
index 8d519ad085..58d6d72cab 100644
--- a/.github/workflows/ts-reusable-build.yml
+++ b/.github/workflows/ts-reusable-build.yml
@@ -56,7 +56,7 @@ jobs:
bun run build
fi
else
- pnpm run build --if-present
+ pnpm run --if-present build
fi
- name: Verify build
diff --git a/.github/workflows/ts-reusable-publish.yml b/.github/workflows/ts-reusable-publish.yml
index 3b631d6f8e..74b65c2dc6 100644
--- a/.github/workflows/ts-reusable-publish.yml
+++ b/.github/workflows/ts-reusable-publish.yml
@@ -98,7 +98,7 @@ jobs:
bun run build
fi
else
- pnpm run build --if-present
+ pnpm run --if-present build
fi
- name: Publish to npm
diff --git a/libs/cuabot/src/types/node-pty.d.ts b/libs/cuabot/src/types/node-pty.d.ts
new file mode 100644
index 0000000000..d849e2431c
--- /dev/null
+++ b/libs/cuabot/src/types/node-pty.d.ts
@@ -0,0 +1,35 @@
+declare module "@lydell/node-pty" {
+ export interface IPtyForkOptions {
+ name?: string;
+ cols?: number;
+ rows?: number;
+ cwd?: string;
+ env?: { [key: string]: string | undefined };
+ encoding?: string | null;
+ handleFlowControl?: boolean;
+ flowControlPause?: string;
+ flowControlResume?: string;
+ }
+
+ export interface IPty {
+ readonly pid: number;
+ readonly cols: number;
+ readonly rows: number;
+ readonly process: string;
+ readonly handleFlowControl: boolean;
+ onData: (callback: (data: string) => void) => void;
+ onExit: (callback: (exitCode: { exitCode: number; signal?: number }) => void) => void;
+ on(event: "data", callback: (data: string) => void): void;
+ on(event: "exit", callback: (exitCode: number, signal?: number) => void): void;
+ resize(cols: number, rows: number): void;
+ clear(): void;
+ write(data: string): void;
+ kill(signal?: string): void;
+ }
+
+ export function spawn(
+ file: string,
+ args: string[] | string,
+ options: IPtyForkOptions
+ ): IPty;
+}
diff --git a/libs/cuabot/src/utils.ts b/libs/cuabot/src/utils.ts
index 6a3242440c..5621252207 100644
--- a/libs/cuabot/src/utils.ts
+++ b/libs/cuabot/src/utils.ts
@@ -122,7 +122,7 @@ export async function checkDocker(): Promise<{ ok: boolean; message: string }> {
/**
* Check if Xpra client is available
*/
-export async function checkXpra(): Promise<{ ok: boolean; message: string }> {
+export async function checkXpra(): Promise<{ ok: boolean; message: string; quarantined?: boolean }> {
const xpraPath = getXpraBinPath();
const platform = process.platform;
@@ -141,7 +141,7 @@ export async function checkXpra(): Promise<{ ok: boolean; message: string }> {
try {
const { stdout } = await execAsync("xattr /Applications/Xpra.app");
if (stdout.includes("com.apple.quarantine")) {
- return { ok: false, message: `Xpra is installed but quarantined. Run: xattr -d com.apple.quarantine /Applications/Xpra.app` };
+ return { ok: false, message: `Xpra is installed but quarantined. Run: xattr -d com.apple.quarantine /Applications/Xpra.app`, quarantined: true };
}
} catch {
// xattr command failed, ignore