import { z } from "zod";
export function registerWbReload(server, client) {
    server.registerTool("wb_reload", {
        description: "Reload scripts or plugins in the Workbench. Use after editing .c script files or Workbench plugins to pick up changes without restarting.",
        inputSchema: {
            target: z
                .enum(["scripts", "plugins", "both"])
                .default("scripts")
                .describe("What to reload: scripts, plugins, or both"),
        },
    }, async ({ target }) => {
        try {
            const result = await client.call("EMCP_WB_Reload", { target });
            return {
                content: [
                    {
                        type: "text",
                        text: `**Reload Complete**\n\n${result.message || "Reload triggered."}`,
                    },
                ],
            };
        }
        catch (e) {
            const msg = e instanceof Error ? e.message : String(e);
            return {
                content: [{ type: "text", text: `Error reloading: ${msg}` }],
            };
        }
    });
}
//# sourceMappingURL=wb-reload.js.map