import { z } from "zod";
import { tool } from "@anthropic-ai/claude-agent-sdk";
import { takeScreenshot } from "./screenshot.js";
import { logger } from "../logger.js";
export const waitTool = tool("wait", "Wait (pause) for a specified number of seconds before continuing. Returns a screenshot of the current desktop after waiting.", {
    seconds: z
        .number()
        .min(1)
        .max(300)
        .describe("Number of seconds to wait (1-300)"),
}, async (args) => {
    const { seconds } = args;
    await new Promise((resolve) => setTimeout(resolve, seconds * 1000));
    try {
        const { base64 } = await takeScreenshot();
        logger.screenshot(base64);
        return {
            content: [
                {
                    type: "text",
                    text: `Waited ${seconds} second(s).`,
                },
                {
                    type: "image",
                    data: base64,
                    mimeType: "image/png",
                }
            ],
        };
    }
    catch {
        return {
            content: [
                {
                    type: "text",
                    text: `Waited ${seconds} second(s). (Screenshot failed)`,
                },
            ],
        };
    }
});
//# sourceMappingURL=wait.js.map