tooltip bounds

This commit is contained in:
Boki 2026-02-10 21:21:07 -05:00
parent 930e00c9cc
commit bb2b9cf507
7 changed files with 474 additions and 56 deletions

View file

@ -1,7 +1,7 @@
import { mkdir } from 'fs/promises';
import { join } from 'path';
import { logger } from '../util/logger.js';
import { OcrDaemon, type OcrResponse } from './OcrDaemon.js';
import { OcrDaemon, type OcrResponse, type DiffOcrResponse } from './OcrDaemon.js';
import { GridReader, type GridLayout, type CellCoord } from './GridReader.js';
import type { Region } from '../types.js';
@ -102,6 +102,16 @@ export class ScreenReader {
return pos !== null;
}
// ── Snapshot / Diff-OCR (for tooltip reading) ──────────────────────
async snapshot(): Promise<void> {
await this.daemon.snapshot();
}
async diffOcr(savePath?: string, region?: Region): Promise<DiffOcrResponse> {
return this.daemon.diffOcr(savePath, region);
}
// ── Save utilities ──────────────────────────────────────────────────
async saveScreenshot(path: string): Promise<void> {