/** * Weavetab — tools/clipboard.ts * browser_clipboard: Read and write text + images to the system/browser clipboard. * Uses synthetic mouse click to grant user activation before clipboard API calls. * Weavetab by fy2ne */ import CDP from "chrome-remote-interface"; import type { Config } from "../config/loader.js"; export interface ClipboardOptions { action: "read" | "write"; /** Text content to write (required for text write, optional if dataUrl is provided) */ text?: string; /** Base64 data URL for image write (e.g. "data:image/png;base64,iVBOR...") */ dataUrl?: string; /** MIME type override (auto-detected from dataUrl by default) */ mimeType?: string; /** * When true, skips the (5,5) user-activation click before clipboard write. * Set this when the calling context already has input focus (e.g. browser_type) * to prevent blurring the focused field before Ctrl+V. */ skipActivation?: boolean; } export declare function browserClipboard(session: CDP.Client, options: ClipboardOptions, _config: Config): Promise<{ success: boolean; text?: string; dataUrl?: string; message: string; }>;