mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-02 09:41:37 +00:00
* feat(cua-computer): add experimental Windows/Linux computer-use fulfiller Bundled plugin that fulfills the capability-based computer.act + screen.snapshot node contract on Windows and Linux by supervising a pinned cua-driver 0.10.x daemon over MCP stdio. macOS keeps the Peekaboo fulfiller; this plugin is disabled by default and never available on darwin. Grounded in cua-driver 0.10.0 source (tool schemas, refusal codes, coordinate spaces, session/daemon lifecycle). Notable safety and correctness properties: - Deny-by-default env allowlist so OpenClaw secrets (provider/channel tokens, CUA_API_KEY) never reach the separately installed daemon; telemetry and update checks forced off. - Version-gated handshake (exact-minor pin + capability/schema version), time-bounded so a corrected driver recovers without a node restart. - Robust daemon supervision: full readiness-budget polling, startup-race tolerance, signal-death and spawn-error recovery, shared-daemon lifecycle (never killed on dispose). - Frame authorization preserved within upstream limits (generation + full live geometry; capture refused when screen and screenshot geometry diverge). - Action mapping refuses inputs cua-driver cannot faithfully deliver: layout-shifted keys, modifier-held drag/scroll, Linux modifier clicks, hold_key/mouse down-up, non-positive scroll; drag duration clamped. * fix(cua-computer): satisfy lint, test-types, dead-code, and docs-map gates
35 lines
1.1 KiB
TypeScript
35 lines
1.1 KiB
TypeScript
import { buildPluginConfigSchema, definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
import { z } from "zod";
|
|
import { createCuaComputerCommands } from "./src/commands.js";
|
|
|
|
const CuaComputerConfigSchema = z.strictObject({
|
|
driverPath: z.string().trim().min(1).optional(),
|
|
});
|
|
|
|
const configSchema = buildPluginConfigSchema(CuaComputerConfigSchema, {
|
|
uiHints: {
|
|
driverPath: {
|
|
label: "cua-driver path",
|
|
help: "Absolute path or executable name resolved through PATH. Defaults to cua-driver.",
|
|
},
|
|
},
|
|
});
|
|
|
|
export default definePluginEntry({
|
|
id: "cua-computer",
|
|
name: "CUA Computer",
|
|
description: "Experimental cua-driver computer control for Windows and Linux node hosts.",
|
|
configSchema,
|
|
register(api) {
|
|
const parsed = CuaComputerConfigSchema.safeParse(api.pluginConfig ?? {});
|
|
if (!parsed.success) {
|
|
throw new Error(
|
|
`Invalid cua-computer plugin config: ${parsed.error.issues[0]?.message ?? "invalid config"}`,
|
|
);
|
|
}
|
|
for (const command of createCuaComputerCommands({ driverPath: parsed.data.driverPath })) {
|
|
api.registerNodeHostCommand(command);
|
|
}
|
|
},
|
|
});
|