Skip to content

Commit 4626aaf

Browse files
dveltonCopilot
andcommitted
Update eyeball plugin with bug fixes and Windows support
- Fix resource leaks (pdf_doc closed in finally blocks) - Fix Windows Word COM automation (DispatchEx, proper cleanup) - Fix converter order (Word before LibreOffice on Windows) - Add source file existence checks with clear errors - Fix Playwright cache detection for all platforms - Fix setup.sh error handling (pipefail) - Fix AppleScript path injection - Fix highlight padding scaling with DPI - Add pywin32 as Windows dependency - Update README with Windows setup instructions Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent eeb7cb1 commit 4626aaf

3 files changed

Lines changed: 245 additions & 85 deletions

File tree

plugins/eyeball/README.md

Lines changed: 55 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,77 @@
1-
# Eyeball
1+
A tool to help verify AI statements, without (or at least with fewer) context switching pains.
22

33
When AI analyzes a document and tells you "Section 10 requires mutual indemnification," how do you know Section 10 actually says that? Eyeball lets you see for yourself.
44

5-
Eyeball is a Copilot CLI plugin that generates document analyses as Word files with inline screenshots from the source material. Every factual claim in the analysis includes a highlighted excerpt from the original document, so you can verify each assertion without switching between files or hunting for the right page.
5+
This is a Copilot CLI plugin that generates document analyses as Word files with inline screenshots of relevant portions from the source material. Every factual claim in the analysis includes a highlighted excerpt from the original document, so you can verify each assertion without switching between files or hunting for the right page.
66

77
## What it does
88

99
You give Copilot a document (Word file, PDF, or web URL) and ask it to analyze something specific. Eyeball reads the source, writes the analysis, and for each claim, captures a screenshot of the relevant section from the original document with the cited text highlighted in yellow. The output is a Word document on your Desktop with analysis text and source screenshots interleaved.
1010

1111
If the analysis says "Section 9.3 allows termination for cause with a 30-day cure period," the screenshot below it shows Section 9.3 from the actual document with that language highlighted. If the screenshot shows something different, the analysis is wrong and you can see it immediately.
1212

13-
## Prerequisites
13+
## Installation
14+
15+
### Prerequisites
1416

1517
- [Copilot CLI](https://docs.github.com/copilot/concepts/agents/about-copilot-cli) installed and authenticated
1618
- Python 3.8 or later
1719
- One of the following for Word document support (PDFs and web URLs work without these):
1820
- Microsoft Word (macOS or Windows)
1921
- LibreOffice (any platform)
2022

21-
## Setup
23+
### Install the plugin
24+
25+
Point your CLI at this repo and ask it to install the plugin for you, with this prompt:
26+
27+
```
28+
Install the plugin at github.com/dvelton/eyeball for me.
29+
```
30+
31+
Or:
2232

23-
After installing the plugin, install the Python dependencies:
33+
Install via the Copilot CLI plugin system, or clone the repo:
2434

2535
```bash
26-
pip3 install pymupdf pillow python-docx playwright
27-
python3 -m playwright install chromium
36+
git clone https://github.com/dvelton/eyeball.git
2837
```
2938

30-
Verify setup:
39+
### Install dependencies
40+
41+
**macOS / Linux:**
3142

3243
```bash
33-
python3 <plugin-path>/skills/eyeball/tools/eyeball.py setup-check
44+
cd eyeball
45+
bash setup.sh
3446
```
3547

36-
## Usage
48+
**Windows (PowerShell):**
49+
50+
```powershell
51+
cd eyeball
52+
.\setup.ps1
53+
```
3754

38-
In a Copilot CLI conversation:
55+
**Manual install (any platform):**
56+
57+
```bash
58+
pip install pymupdf pillow python-docx playwright
59+
python -m playwright install chromium
60+
```
61+
62+
On Windows, `pywin32` is also needed for Microsoft Word automation and is installed automatically by the setup script.
63+
64+
### Verify setup
65+
66+
```bash
67+
python3 skills/eyeball/tools/eyeball.py setup-check
68+
```
69+
70+
This shows which source types are supported on your machine.
71+
72+
## How to use it
73+
74+
In a Copilot CLI conversation, tell it to use eyeball and what you want analyzed:
3975

4076
```
4177
use eyeball on ~/Desktop/vendor-agreement.docx -- analyze the indemnification
@@ -51,15 +87,15 @@ developer-friendly aspects of these terms
5187
use eyeball to analyze this NDA for non-compete provisions
5288
```
5389

54-
Eyeball reads the source document, writes the analysis with exact section references, and generates a Word document on your Desktop with source screenshots inline.
90+
Eyeball activates, reads the source document, writes the analysis with exact section references, and generates a Word document on your Desktop with source screenshots inline.
5591

56-
## Supported source types
92+
## What it supports
5793

5894
| Source type | Requirements |
5995
|---|---|
6096
| PDF files | Python + PyMuPDF (included in setup) |
6197
| Web pages | Python + Playwright + Chromium (included in setup) |
62-
| Word documents (.docx) | Microsoft Word (macOS/Windows) or LibreOffice |
98+
| Word documents (.docx) | Microsoft Word (macOS/Windows) or LibreOffice (any platform). On Windows, pywin32 is also required (included in setup). |
6399

64100
## How it works
65101

@@ -74,14 +110,16 @@ The screenshots are dynamically sized: if a section of analysis references text
74110

75111
## Why screenshots instead of quoted text?
76112

77-
Quoted text is easy to fabricate. A model can generate a plausible-sounding quote that doesn't actually appear in the source, and without checking, you'd never know. Screenshots from the rendered source are harder to fake -- they show the actual formatting, layout, and surrounding context of the original document. You can see at a glance whether the highlighted text matches the claim, and the surrounding text provides context that a cherry-picked quote might omit.
113+
In hallucination-sensitive contexts, sometimes we need to see receipts.
114+
115+
Quoted text is easy to fabricate. A model can generate a plausible-sounding quote that doesn't actually appear in the source, and without checking, you'd never know. Screenshots from the rendered source are harder to fake; they show the actual formatting, layout, and surrounding context of the original document. You can see at a glance whether the highlighted text matches the claim, and the surrounding text provides context that a cherry-picked quote might omit.
78116

79117
## Limitations
80118

81119
- Word document conversion requires Microsoft Word or LibreOffice. Without one of these, you can still use Eyeball with PDFs and web URLs.
82-
- Text search is string-matching. If the source document uses unusual encoding, ligatures, or non-standard characters, some searches may not match.
120+
- Text search is string-matching. If the source document uses unusual encoding, ligatures, or non-standard characters, some searches may not match. The skill instructions tell the AI to use verbatim phrases from the extracted text, which handles most cases.
83121
- Web page rendering depends on Playwright and may not perfectly capture all dynamic content (e.g., content loaded by JavaScript after page load, content behind login walls).
84-
- Screenshot quality depends on the source formatting. Dense multi-column layouts or very small text may produce less readable screenshots.
122+
- Screenshot quality depends on the source formatting. Dense multi-column layouts or very small text may produce less readable screenshots. Increase the DPI setting if needed.
85123

86124
## License
87125

skills/eyeball/SKILL.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@ Before first use, check that dependencies are installed:
4242
python3 <path-to>/eyeball.py setup-check
4343
```
4444

45-
If anything is missing, install the required dependencies:
45+
If anything is missing, run the setup script from the eyeball plugin directory:
46+
```bash
47+
bash <path-to>/setup.sh
48+
```
49+
50+
Or install manually:
4651
```bash
4752
pip3 install pymupdf pillow python-docx playwright
4853
python3 -m playwright install chromium
@@ -57,7 +62,7 @@ Follow these steps exactly. The order matters.
5762
Before writing any analysis, extract and read the full text of the source document:
5863

5964
```bash
60-
python3 <path-to>/eyeball.py extract-text --source "<path-or-url>"
65+
python3 eyeball.py extract-text --source "<path-or-url>"
6166
```
6267

6368
Read the output carefully. Identify actual section numbers, headings, page numbers, and key language.
@@ -113,7 +118,7 @@ RIGHT -- includes the section number for precision, targets the correct page:
113118
Construct a JSON array of sections and call the build command:
114119

115120
```bash
116-
python3 <path-to>/eyeball.py build \
121+
python3 eyeball.py build \
117122
--source "<path-or-url>" \
118123
--output ~/Desktop/<title>.docx \
119124
--title "Analysis Title" \

0 commit comments

Comments
 (0)