openclaw/extensions/cua-computer/index.ts
f-trycua 438c80b758 refactor: move computer tool to cua-computer plugin
Move GUI automation from core to a standalone plugin. This keeps the
core lean and lets users opt-in when they need computer-use capabilities.

Plugin provides:
- Screenshot capture
- Mouse clicks (left, right, double)
- Keyboard input (type, key, hotkey)
- Scrolling and dragging
- Cursor position/screen size queries

Enable via config:
```yaml
plugins:
  cua-computer:
    serverUrl: "http://localhost:8000"
```
2026-01-26 15:56:22 -08:00

34 lines
803 B
TypeScript

/**
* Cua Computer Plugin
*
* Provides GUI automation via cua-computer-server - screenshots, clicks, typing, scrolling.
*
* @see https://github.com/trycua/cua/tree/main/libs/python/computer-server
*/
import type { ClawdbotPluginDefinition } from "../../src/plugins/types.js";
import { createComputerTool } from "./computer-tool.js";
interface CuaComputerConfig {
serverUrl?: string;
}
const plugin: ClawdbotPluginDefinition = {
id: "cua-computer",
name: "Cua Computer",
description: "GUI automation via cua-computer-server",
register(api) {
const config = api.pluginConfig as CuaComputerConfig | undefined;
api.registerTool(
createComputerTool({
defaultServerUrl: config?.serverUrl,
config: api.config,
}),
);
},
};
export default plugin;