Files
oh-my-pi/packages/coding-agent/test/fixtures/computer-schema-construction-preload.ts
T
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

26 lines
714 B
TypeScript

import { spyOn } from "bun:test";
import * as arktype from "arktype";
declare global {
var __computerSchemaConstructionCount: number;
}
globalThis.__computerSchemaConstructionCount = 0;
const originalType = arktype.type;
const countedType = new Proxy(originalType, {
apply(target, thisArg, args) {
const definition = args[0];
if (
definition !== null &&
typeof definition === "object" &&
Object.hasOwn(definition, "code") &&
Object.hasOwn(definition, "read_only?")
) {
globalThis.__computerSchemaConstructionCount += 1;
}
return Reflect.apply(target, thisArg, args);
},
});
const typeSpy = spyOn(arktype, "type").mockImplementation(countedType);
Object.assign(typeSpy, originalType);