Files
oh-my-pi/packages/coding-agent/test/fixtures/computer-worker-cli-selector.ts
can1357 ef852af986 feat(computer): implemented modular desktop backend and script workflows
- Replaced monolithic desktop native bindings and action batching with a modular cross-platform backend structure supporting Wayland, X11, macOS, and Win32.
- Updated the computer tool schema and supervisor to execute persistent JavaScript script runs with timeout clamping and asynchronous tool calling.
- Integrated accessibility (AX) tree snapshotting, node querying, and bounds-based hit testing across platform desktop layers.
- Added native clipboard bindings and updated coding-agent prompts, renderers, and tests to validate script-based computer workflows.
2026-08-02 19:46:25 +02:00

16 lines
623 B
TypeScript

const worker = new Worker(new URL("../../src/cli.ts", import.meta.url).href, {
type: "module",
argv: ["__omp_worker_computer"],
});
const response = Promise.withResolvers<unknown>();
worker.addEventListener("message", event => {
if (event.data?.type === "pong" && event.data.id === "computer-cli-selector") response.resolve(event.data);
});
worker.addEventListener("error", event => response.reject(event.error ?? new Error(event.message)));
worker.postMessage({ type: "ping", id: "computer-cli-selector" });
try {
process.stdout.write(`${JSON.stringify(await response.promise)}\n`);
} finally {
worker.terminate();
}