Skip to content

find_text: on-screen OCR with Windows.Media.Ocr, plus redaction suggestions #117

Closed

Description

@TMHSDigital

What and who

New find_text { input | target, query? } tool that runs OCR with the OCR engine built into Windows (Windows.Media.Ocr, no extra install) and returns words/lines with bounding boxes. With query (string or regex), it returns only matches. For agents that need to locate UI text, assert what's on screen, or find secrets to redact.

Why

  • The threat model says "Redaction is declared, not detected": redact_region depends on someone having found the secret first. find_text { query: "sk-|ghp_|password" } -> rectangles -> redact_region closes that loop, with the human still reviewing.
  • Frame-level OCR also gives agents text they can search instead of only pixels (screenpipe built a product on searchable screen text: https://screenpi.pe/resources/use-cases/mcp-tools).
  • Windows ships the engine, which fits the project's Windows-first, no-extra-dependencies approach.

Approach

  • PowerShell/WinRT shim like the existing monitors.ts / windows.ts pattern: load the image as SoftwareBitmap, OcrEngine.TryCreateFromUserProfileLanguages(), return JSON lines/words with rects.
  • Video inputs: OCR at given timestamps (reuse sample_frames).
  • redact: true option returns suggested redact_region rectangles (padded) instead of applying them.
  • Map coordinates back to video pixels (DPI handling from Bug: monitor:N capture is cropped/wrong on DPI-scaled displays (logical vs physical pixels) #39).

Done when

find_text on a screenshot of known text returns correct boxes. A regex query finds a fake token in a recording and its rectangles feed redact_region directly. Docs explain this is best-effort detection, not a guarantee.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort: mediumfeatureimpact: high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions