/**
 * Platform dispatcher for desktop executor.
 * Re-exports the correct platform implementation based on process.platform.
 */
import { platform } from "node:os";
let _impl = null;
async function getImpl() {
    if (_impl)
        return _impl;
    if (platform() === "win32") {
        _impl = await import("./desktop-executor-windows.js");
    }
    else {
        _impl = await import("./desktop-executor.js");
    }
    return _impl;
}
export async function captureScreen() {
    return (await getImpl()).captureScreen();
}
export async function initDisplaySize() {
    return (await getImpl()).initDisplaySize();
}
/**
 * Whether display size detection has succeeded. Computer_use tools must
 * gate entry on this — a false result means coordinate math would be
 * wrong, so the tools should refuse with a clear error and the owner
 * should be notified.
 */
export function isDisplaySizeInitialized() {
    if (!_impl)
        return false;
    return _impl.isDisplaySizeInitialized();
}
export function getDisplaySize() {
    // getDisplaySize is synchronous and called after initDisplaySize,
    // so the impl must already be loaded.
    if (!_impl) {
        throw new Error("Display size not initialized — desktop executor impl not loaded");
    }
    return _impl.getDisplaySize();
}
export async function click(x, y) {
    return (await getImpl()).click(x, y);
}
export async function doubleClick(x, y) {
    return (await getImpl()).doubleClick(x, y);
}
export async function rightClick(x, y) {
    return (await getImpl()).rightClick(x, y);
}
export async function moveTo(x, y) {
    return (await getImpl()).moveTo(x, y);
}
export async function drag(x1, y1, x2, y2) {
    return (await getImpl()).drag(x1, y1, x2, y2);
}
export async function typeText(text) {
    return (await getImpl()).typeText(text);
}
export async function pressKey(key) {
    return (await getImpl()).pressKey(key);
}
export async function scroll(x, y, direction, amount) {
    return (await getImpl()).scroll(x, y, direction, amount);
}
//# sourceMappingURL=desktop-executor-factory.js.map