chore: remove computer use (re-applied after main merge)

The merge of main into this branch (0907d87) hit a modify/delete conflict
for the computer-use module — main removed it in 6761f31 while this branch
had extended it — and the conflict was resolved by keeping the branch's
copies, silently resurrecting the whole feature.

This re-applies 6761f31's removal on top of the browser-use work:
- deletes the computer-use server module, client panel, settings tab,
  desktop-agent websocket service, electron computerAgent, and the
  computer-semantics build scripts
- strips computer-use wiring from shared files (server/index.js, electron
  launcher/main, MainContent, settings, i18n) while preserving browser-use
- removes src/constants/featureFlags.ts (existed only for the CU menu flag)

browser-use (camoufox/noVNC) is untouched. typecheck passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Simos Mikelatos
2026-07-01 15:38:59 +00:00
parent a34249497e
commit 19e4bf9d80
57 changed files with 14 additions and 6298 deletions

View File

@@ -1,51 +0,0 @@
import type { WebSocket } from 'ws';
import { desktopAgentRelay } from '@/modules/computer-use/index.js';
import type { AuthenticatedWebSocketRequest } from '@/shared/types.js';
import { parseIncomingJsonObject } from '@/shared/utils.js';
/**
* Handles the `/desktop-agent` websocket — the inbound side of the cloud
* Computer Use relay. A linked CloudCLI desktop app connects here and registers
* itself as the executor for this hosted environment. The server then forwards
* `computer_*` actions via `desktopAgentRelay`, and the agent returns results as
* `computer_relay_result` frames correlated by `id`.
*/
export function handleDesktopAgentConnection(
ws: WebSocket,
request: AuthenticatedWebSocketRequest
): void {
let registered = false;
ws.on('message', (rawMessage) => {
const data = parseIncomingJsonObject(rawMessage);
if (!data) {
return;
}
const kind = typeof data.kind === 'string' ? data.kind : typeof data.type === 'string' ? data.type : '';
if (kind === 'register' && !registered) {
const label = typeof data.label === 'string' && data.label.trim()
? data.label.trim()
: request.user?.username
? `desktop:${request.user.username}`
: 'desktop-agent';
registered = true;
console.log('[INFO] Desktop agent websocket registered:', label);
desktopAgentRelay.register(ws, label);
return;
}
if (kind === 'computer_relay_result' && typeof data.id === 'string') {
desktopAgentRelay.handleResult(
data.id,
(data as Record<string, unknown>).result,
typeof (data as Record<string, unknown>).error === 'string'
? ((data as Record<string, unknown>).error as string)
: undefined
);
}
});
ws.on('close', () => {
console.log('[INFO] Desktop agent websocket disconnected');
});
}

View File

@@ -7,7 +7,6 @@ import { VIEWER_COOKIE_NAME } from '@/modules/browser-use/index.js';
import { verifyWebSocketClient } from '@/modules/websocket/services/websocket-auth.service.js';
import { handlePluginWsProxy } from '@/modules/websocket/services/plugin-websocket-proxy.service.js';
import { handleShellConnection } from '@/modules/websocket/services/shell-websocket.service.js';
import { handleDesktopAgentConnection } from '@/modules/websocket/services/desktop-agent-websocket.service.js';
import { handleDesktopNotificationsConnection } from '@/modules/notifications/index.js';
import type { AuthenticatedWebSocketRequest } from '@/shared/types.js';
@@ -89,11 +88,6 @@ export function createWebSocketServer(
return;
}
if (pathname === '/desktop-agent') {
handleDesktopAgentConnection(ws, incomingRequest);
return;
}
if (pathname === '/desktop-notifications') {
handleDesktopNotificationsConnection(ws, incomingRequest);
return;