export declare const CLAUDE_MAX_LONG_EDGE_PX = 1568;
export declare const CLAUDE_MAX_PIXELS = 1150000;
/**
 * Compute how much to scale image dimensions to fit Claude's vision constraints.
 * Returns a factor <= 1.0.
 */
export declare function getVisionScaleFactor(width: number, height: number): number;
/**
 * Get image dimensions using system tools (sips on macOS, identify on Linux).
 * Returns { width, height } or null on failure.
 */
export declare function getImageDimensions(buffer: Buffer): Promise<{
    width: number;
    height: number;
} | null>;
/**
 * Get image dimensions from a file path directly (avoids base64 decode + temp file).
 */
export declare function getImageDimensionsFromFile(filePath: string): Promise<{
    width: number;
    height: number;
} | null>;
/**
 * Resize a PNG buffer to fit within Claude's vision constraints.
 * Uses system tools (sips on macOS, ImageMagick on Linux).
 * Returns the (possibly resized) buffer.
 */
export declare function resizeForVision(buffer: Buffer): Promise<Buffer>;
/**
 * Resize a base64-encoded image to fit within Claude's vision constraints.
 * Returns the (possibly resized) image as base64.
 */
export declare function resizeBase64ForVision(base64: string): Promise<string>;
/**
 * Download an image from a URL and resize it for Claude's vision constraints.
 * Returns `{ base64, mimeType }` if successful, or `null` on failure.
 * Used to replace URL-referenced images with properly-sized base64 data.
 */
export declare function downloadAndResizeForVision(url: string, retries?: number, delayMs?: number): Promise<{
    base64: string;
    mimeType: string;
} | null>;
/**
 * Remove image files older than 24 hours from the screenshots directory.
 * Cleans up both our own screenshots and Playwright output.
 * Throttled to run at most once every 10 minutes.
 */
export declare function cleanOldScreenshots(): Promise<void>;
export interface ScreenshotResult {
    base64: string;
    filePath: string;
}
/**
 * Kill any stale `macos-screenshot` helper processes that are not children
 * of the current agent. When the ScreenCaptureKit helper hangs (see the
 * Swift source for context) and the agent is then restarted, macOS
 * reparents the stuck helper to launchd (PPID=1) and it continues to
 * spin at 100% CPU until someone kills it. We've observed instances
 * running for hours accumulating >4h of CPU time.
 *
 * Runs once at agent startup, best-effort. On a healthy machine this
 * finds nothing and returns in ~10ms.
 *
 * Notes on safety:
 *   - We only match our own helper binary path under
 *     `<visionclaw-base-dir>/bin/macos-screenshot`, so other tools are
 *     untouched.
 *   - We skip processes whose PPID is the current agent PID, in case an
 *     in-flight capture is still running (only relevant for re-entry
 *     edge cases; the single-instance PID lock usually prevents this).
 *   - Errors are logged at debug level and never propagated.
 */
export declare function killStaleScreenshotHelpers(): Promise<void>;
/**
 * Take a screenshot of the current desktop.
 * Returns the base64-encoded PNG image and the path to the persisted file.
 * The file is saved to ~/screenshots/ for later use (e.g. sending to user).
 *
 * Wrapped in an overall wall-clock timeout as a last-resort guard — the
 * per-subprocess `execWithTimeout` calls are the primary defence, but a
 * rogue sequence (e.g. display-wake → stuck cliclick → stuck SCK helper)
 * could in theory still eat the full sum of those budgets. The overall
 * ceiling guarantees the agent's wake cycle never deadlocks on screenshot.
 */
export declare function takeScreenshot(): Promise<ScreenshotResult>;
//# sourceMappingURL=screenshot.d.ts.map