diff --git a/packages/computer-use/cua/native/Sources/CuaNative/AXWorker.swift b/packages/computer-use/cua/native/Sources/CuaNative/AXWorker.swift index 726522e00e..1dec79ed9f 100644 --- a/packages/computer-use/cua/native/Sources/CuaNative/AXWorker.swift +++ b/packages/computer-use/cua/native/Sources/CuaNative/AXWorker.swift @@ -234,8 +234,8 @@ actor AXWorker { guard let action = try ax().actions(selected).first(where: { Self.actionKey($0) == Self.actionKey(requested) }) else { throw NativeFailure(code: "NATIVE_ERROR", message: "Element does not advertise this action; refresh getAXState") } - try ax().requireEnabled(selected) if action == "AXRaise" { + try ax().requireEnabled(selected) return .foreground(ForegroundPlan(appHandle: handle, identity: identity, snapshotID: try params.string("snapshotId"), index: try params.integer("elementIndex", in: 0...Int.max), targetWindowID: try ax().windowID(selected), role: try ax().string(selected, "AXRole"), main: try ax().boolean(selected, "AXMain"), minimized: try ax().boolean(selected, "AXMinimized"))) diff --git a/packages/computer-use/cua/native/Sources/CuaNative/RequestCoordinator.swift b/packages/computer-use/cua/native/Sources/CuaNative/RequestCoordinator.swift index f43177b4d1..31f0783e50 100644 --- a/packages/computer-use/cua/native/Sources/CuaNative/RequestCoordinator.swift +++ b/packages/computer-use/cua/native/Sources/CuaNative/RequestCoordinator.swift @@ -62,7 +62,6 @@ import Darwin do { let request = try NativeRequest(data: data) requestID = .string(request.id) - _ = try RequestParameters(request) let requiresCatalog = ["getApp", "listApps", "typeText", "pressKey"].contains(request.method) let catalog = requiresCatalog ? ApplicationCatalog.snapshot() : ApplicationCatalogSnapshot(applications: [], frontPID: nil) let outcome = try await self.worker.execute(request, catalog: catalog) diff --git a/packages/computer-use/cua/package.json b/packages/computer-use/cua/package.json index 0c4e263984..d14f4b4487 100644 --- a/packages/computer-use/cua/package.json +++ b/packages/computer-use/cua/package.json @@ -27,15 +27,10 @@ "./bridge": { "types": "./lib/types/bridge.d.ts", "default": "./lib/bridge.js" - }, - "./native-build": { - "types": "./lib/types/native-build.d.ts", - "default": "./lib/native-build.js" } }, "files": [ "lib/index.js", - "lib/native-build.js", "native/bin", "lib/api.js", "lib/bridge.js", diff --git a/packages/computer-use/cua/src/native-build.ts b/packages/computer-use/cua/src/native-build.ts index 33847c0692..9fbefb00e3 100644 --- a/packages/computer-use/cua/src/native-build.ts +++ b/packages/computer-use/cua/src/native-build.ts @@ -84,7 +84,7 @@ async function compileNative(spec: NativeBuildSpec, signal: AbortSignal, executa let outcome: SubprocessOutcome try { outcome = await handle.done } finally { try { handle.terminate() } finally { - if (!await handle.waitForExit()) throw new Error('Computer Use preparation process did not exit cleanly') + await handle.waitForExit() } } signal.throwIfAborted() diff --git a/packages/computer-use/cua/tests/native-build.spec.ts b/packages/computer-use/cua/tests/native-build.spec.ts index 84b456466e..579432a157 100644 --- a/packages/computer-use/cua/tests/native-build.spec.ts +++ b/packages/computer-use/cua/tests/native-build.spec.ts @@ -111,10 +111,10 @@ it('awaits compiler cleanup and refuses to publish after cancellation', async () expect(f.spawn).toHaveBeenCalledTimes(1) }) -it('reports incomplete compiler process cleanup before publishing', async () => { +it('reports failed compiler range observation before publishing', async () => { const f = await fixture() - f.waitForExit.mockResolvedValue(false) - await expect(buildNativeExecutable(f.spec)).rejects.toThrow('did not exit cleanly') + f.waitForExit.mockRejectedValue(new Error('compiler range observation failed')) + await expect(buildNativeExecutable(f.spec)).rejects.toThrow('compiler range observation failed') await expect(readFile(nativeExecutablePath(f.spec.packageRoot, 'arm64'))).rejects.toMatchObject({ code: 'ENOENT' }) }) diff --git a/packages/computer-use/cua/tsdown.config.ts b/packages/computer-use/cua/tsdown.config.ts index 6b5e654d3a..6f91243efb 100644 --- a/packages/computer-use/cua/tsdown.config.ts +++ b/packages/computer-use/cua/tsdown.config.ts @@ -1,7 +1,7 @@ import { defineConfig } from 'tsdown' export default defineConfig(Object.entries({ - index: 'lib/types/index.js', api: 'lib/types/api.js', bridge: 'lib/types/bridge.js', 'native-build': 'lib/types/native-build.js', + index: 'lib/types/index.js', api: 'lib/types/api.js', bridge: 'lib/types/bridge.js', }).map(([name, path]) => ({ entry: { [name]: path }, outDir: 'lib', format: ['esm'], platform: 'node', target: 'es2024', diff --git a/scripts/check-workspace-constraints.ts b/scripts/check-workspace-constraints.ts index 2199634946..67c01f481e 100644 --- a/scripts/check-workspace-constraints.ts +++ b/scripts/check-workspace-constraints.ts @@ -175,7 +175,7 @@ export function readWorkspaceManifests(repositoryRoot: string): WorkspaceManifes const packageFileExtras: Readonly> = { // CUA publishes its client API and attributed native source for local macOS builds. - '@deepseek-ai/dsh-cua': ['lib/native-build.js', 'native/bin', 'lib/api.js', 'lib/bridge.js', 'native/Package.swift', 'native/Sources', 'native/tests/swift', 'native/tests/test_swift.py', 'native/LICENSE.cua-driver', 'native/upstream.json', 'native/README.txt', 'native/protocol.schema.json'], + '@deepseek-ai/dsh-cua': ['native/bin', 'lib/api.js', 'lib/bridge.js', 'native/Package.swift', 'native/Sources', 'native/tests/swift', 'native/tests/test_swift.py', 'native/LICENSE.cua-driver', 'native/upstream.json', 'native/README.txt', 'native/protocol.schema.json'], // Owned Worker bundles import this public bootstrap before their business entry. '@deepseek-ai/dsh-app-boot': ['lib/worker/profile-resolution-bootstrap.js'], // Statically linked client libraries keep their stylesheets next to the emitted diff --git a/tsconfig.base.json b/tsconfig.base.json index 0ec95cee8b..97b3cbdde4 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -71,7 +71,6 @@ "@deepseek-ai/dsh-cua": ["./packages/computer-use/cua/src/index.ts"], "@deepseek-ai/dsh-cua/api": ["./packages/computer-use/cua/src/api.ts"], "@deepseek-ai/dsh-cua/bridge": ["./packages/computer-use/cua/src/bridge.ts"], - "@deepseek-ai/dsh-cua/native-build": ["./packages/computer-use/cua/src/native-build.ts"], "@deepseek-ai/dsh-experimental-computer-use-cua-driver-native": ["./packages/experimental/computer-use-cua-driver-native/src/index.ts"], "@deepseek-ai/cordis": ["./vendor/cordis/src"], "@deepseek-ai/cosmokit": ["./vendor/cosmokit/src"],